Question: PYTHON SCAPY HELP I need help modifying this code so that the ip address is not hardcoded. Please show code running I am trying to
PYTHON SCAPY HELP
I need help modifying this code so that the ip address is not hardcoded. Please show code running I am trying to figure out VM operating systems using IPID's.
from scapy.all import
targetip xxxx
targetport
synpacket IPdsttargetip TCPdporttargetport, flagsS
synresponse srsynpacket, timeout verboseFalse
if synresponse:
ipidsynack synresponse.id
ackpacket IPdsttargetip TCPdporttargetport, flagsA acksynresponse.seq
ackresponse srackpacket, timeout verboseFalse
if ackresponse:
ipidackack ackresponse.id
rstpacket IPdsttargetip TCPdporttargetport, flagsR seqackresponse.ack
rstresponse srrstpacket, timeout verboseFalse
if rstresponse:
ipidrstack rstresponse.id
if ipidsynack ipidackack and ipidrstack ipidackack :
printThe OS is likely FreeBSD"
elif ipidsynack ipidackack and ipidrstack ipidackack:
printThe OS is likely Windows"
else:
printThe OS is likely Linux"
else:
printNo response to RST packet"
else:
printNo response to ACK packet"
else:
printNo response to SYN packet"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
