mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-02 06:46:07 -04:00
scapy scripts (including ddos)
This commit is contained in:
parent
2acc68c3dd
commit
8ca96e0b02
28 changed files with 172723 additions and 125 deletions
30
Network_and_802.11/scapy/sniff_simple.py
Executable file → Normal file
30
Network_and_802.11/scapy/sniff_simple.py
Executable file → Normal file
|
@ -4,16 +4,40 @@ __author__ = "bt3"
|
|||
|
||||
from scapy.all import *
|
||||
|
||||
def save():
|
||||
a = sniff(filter='icmp', iface='wlp1s0', timeout=10, count=3, prn=lambda x:x.summary())
|
||||
def save(a):
|
||||
wrpcap('packets.pcap', a)
|
||||
|
||||
def open():
|
||||
p = rdpcap('packets.pcap', p)
|
||||
p.show()
|
||||
|
||||
def os_finger():
|
||||
load_module("p0f")
|
||||
p0f(p)
|
||||
|
||||
def scan():
|
||||
res, unans = sr( IP(dst='192.168.1.114')/TCP(flags='S', dport=(1, 1024)))
|
||||
print res.summary()
|
||||
|
||||
scan()
|
||||
|
||||
def sniff_simple():
|
||||
p = sniff(iface='wlp1s0', timeout=10, count=5)
|
||||
print p.summary()
|
||||
|
||||
def sniff_lambda():
|
||||
a = sniff(filter='icmp', iface='wlp1s0', timeout=10, count=3, prn=lambda x:x.summary())
|
||||
return a
|
||||
|
||||
def tcp_sniff():
|
||||
p = sniff(filter="tcp and (port 25 or port 110)")
|
||||
p.show()
|
||||
|
||||
def sniff_callback():
|
||||
def packet_callback(packet):
|
||||
print packet.show()
|
||||
|
||||
sniff(filter='icmp', iface='wlp1s0', prn=packet_callback, count=1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
tcp_sniff()
|
Loading…
Add table
Add a link
Reference in a new issue