Merge pull request #192 from Shreejan-35/packet-sniffer

Packet Sniffer
This commit is contained in:
Bartick Maiti 2022-10-09 02:07:55 +05:30 committed by GitHub
commit 34112c299b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# PACKET SNIFFER
Hi all! This is a packet sniffer in python.
## Libraries
I have used ```scapy``` library
## Getting started
1. First of all -
```
pip install requirements.txt
```
2. Secondly -
```
python main.py
```
OR
```
sudo python3 main.py
```
That's all. This is how we can use the packet sniffer.

View File

@ -0,0 +1,20 @@
import scapy.all as scapy
from scapy.layers import http
def sniffing(interface):
scapy.sniff(iface=interface,
storage=False, prn=process_packet, filter='tcp')
def process_packet(packet):
if packet.haslayer(http.HTTPRequest):
print(packet[http.HTTPRequest].Host)
def main():
sniffing("Wi-Fi")
if __name__ == "__main__":
main()

View File

@ -0,0 +1 @@
scapy==2.4.5