Understand what I'm doing : Upon reception of the SYN packet, it generates its own SYN....that's "reflective"
# Generate Port Number
srcport = RandShort()
srcport = RandShort()
# Send SYNC and receive RST-ACK or SYN-ACK
SYNACKpkt = sr1(IP(dst=target) /
TCP(sport=srcport, dport=port, flags="S"))
SYNACKpkt = sr1(IP(dst=target) /
TCP(sport=srcport, dport=port, flags="S"))
# Extract flags of received packet
pktflags = SYNACKpkt.getlayer(TCP).flags
pktflags = SYNACKpkt.getlayer(TCP).flags
if pktflags == SYNACK:
# port is open
pass
else:
# port is not open
# ...
pass
# port is open
pass
else:
# port is not open
# ...
pass
our code..we just want that previouse post few lines..
No comments:
Post a Comment