Thanks for your continued help, Diego. It seems now I’m getting the following error around the Raw field (see message below). I’ve also attached my code as it’s been written exactly as Zaid or so I thought when I checked it again.
[+] HTTP Request >> http://www.bing.com/fd/ls/l?IG=0F644CBDB97F475084D8232545A7016D&Type=Event.ClientInst&DATA=%5B{%22T%22:%22CI.ReturnTop%22,%22FID%22:%22CI%22,%22Name%22:%22ReturnTop60%22,%22Text%22:%22Triggered%22}]
Traceback (most recent call last):
File “/root/PycharmProjects/packet_sniffer/packet_sniffer.py”, line 28, in <module>
sniff(“eth0”)
File “/root/PycharmProjects/packet_sniffer/packet_sniffer.py”, line 6, in sniff
scapy.sniff(iface = interface, store = False, prn = process_sniffed_packet)
File “/usr/lib/python3/dist-packages/scapy/sendrecv.py”, line 1036, in sniff
sniffer._run(*args, **kwargs)
File “/usr/lib/python3/dist-packages/scapy/sendrecv.py”, line 989, in _run
session.on_packet_received(p)
File “/usr/lib/python3/dist-packages/scapy/sessions.py”, line 82, in on_packet_received
result = self.prn(pkt)
File “/root/PycharmProjects/packet_sniffer/packet_sniffer.py”, line 24, in process_sniffed_packet
login_info = get_login_info(packet)
File “/root/PycharmProjects/packet_sniffer/packet_sniffer.py”, line 12, in get_login_info
if packet.haslayer(scapy, Raw):
NameError: name ‘Raw’ is not defined
After which I thought it might be because I needed to import scapy so I attempted to install the module and got the following:
root@kali:~/PycharmProjects/packet_sniffer# python
Python 2.7.18 (default, Apr 20 2020, 20:30:41)
[GCC 9.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> pip install scapy_http
File “<stdin>”, line 1
pip install scapy_http
^
SyntaxError: invalid syntax
>>> apt-get install scapy
File “<stdin>”, line 1
apt-get install scapy
^
SyntaxError: invalid syntax
>>> apt-get update
File “<stdin>”, line 1
apt-get update
^
SyntaxError: invalid syntax
>>> pip install scapy.all as scapy
File “<stdin>”, line 1
pip install scapy.all as scapy