November 2017
Intermediate to advanced
226 pages
5h 59m
English
The steps to create a TCP ACK scanner with Scapy are as following:
from scapy.all import *
# define the host, port
host = 'rejahrehim.com'
ip = socket.gethostbyname(host)
port = 80
# define the method to check the status of host
def is_up(ip):
icmp = IP(dst=ip)/ICMP()
resp = sr1(icmp, timeout=10)
if resp == None:
return False
else:
return True
def probe_port(ip, port, result = 1): src_port = RandShort() try: p = IP(dst=ip)/TCP(sport=src_port, dport=port, flags='A', seq=12345) resp = sr1(p, timeout=2) ...
Read now
Unlock full access