mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-02 14:56:10 -04:00
scanner codes and readme
This commit is contained in:
parent
4d4b0dcdff
commit
c8bf3d71c4
2 changed files with 330 additions and 17 deletions
|
@ -12,21 +12,6 @@ import os
|
|||
HOST = '192.168.1.114'
|
||||
|
||||
|
||||
def main(host):
|
||||
|
||||
OS = os.name
|
||||
|
||||
# create a raw socket, binding to the public interface
|
||||
# windows allow us to sniff all incoming packets regardless of protocol,
|
||||
# whereas Linux forces us to specify we are sniffing ICMP
|
||||
if OS == 'nt':
|
||||
socket_prot = socket.IPPROTO_IP
|
||||
sniffing(host, 1, socket_prot)
|
||||
|
||||
else:
|
||||
socket_prot = socket.IPPROTO_ICMP
|
||||
sniffing(host, 0, socket_prot)
|
||||
|
||||
|
||||
|
||||
def sniffing(host, win, socket_prot):
|
||||
|
@ -47,8 +32,23 @@ def sniffing(host, win, socket_prot):
|
|||
# read in a single packet
|
||||
print sniffer.recvfrom(65565)
|
||||
|
||||
if win == 1:
|
||||
sniffer(host, 0, socket_prot)
|
||||
|
||||
|
||||
def main(host):
|
||||
|
||||
OS = os.name
|
||||
|
||||
# create a raw socket, binding to the public interface
|
||||
# windows allow us to sniff all incoming packets regardless of protocol,
|
||||
# whereas Linux forces us to specify we are sniffing ICMP
|
||||
if OS == 'nt':
|
||||
socket_prot = socket.IPPROTO_IP
|
||||
sniffing(host, 1, socket_prot)
|
||||
|
||||
else:
|
||||
socket_prot = socket.IPPROTO_ICMP
|
||||
sniffing(host, 0, socket_prot)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue