1

Topic: Scapy – transfered data change

Hi, looking for help. By program Scapy I’m trying to interrupt the communication connection found by  protocol SIP. I am able to catch the packet SIP INVITE:

>>> x=sniff(filter="udp and port 5060",count=1)
>>> x[0].show()
###[ Ethernet ]###
dst = 00:04:e2:f3:b0:00
……
……
……
###[ UDP ]###
sport = 5060
dport = 5060
len = 740
chksum = 0x12f7
###[ Raw ]###
load = ‘INVITE sip:[email protected] SIP/2.0rnVia: SIP/2.0/UDP 81.19.15.37:61497;rport;branch=z9hG4bK5AF5AB611197454B8EFBDB4329A4F000rnFrom:vomacka<sip:[email protected]>;
tag=1739627153rnTo:<sip:[email protected]>rnContact:<sip:[email protected]:61497………………

In the field Raw I need to change INVITE into BYE, but I don’t know how to do it by scapy.

2

Re: Scapy – transfered data change

Hi. You can change the value in Scapy (for example flag) = pile up a new packet from what you catch (I suppose you are not trying to make a change in the text file which you will run by print). Than send it back. Look in the part "packet manipulation" in the download (folder e-books/Scapy-packet-generation.pdf). Field ack in FIN packet but has to include (sequentialy) the right value. Rewritting the banner you will not disconnect the connection. I don’t think that you provide the transfer of VoIP by UDP protocol.

3

Re: Scapy – transfered data change

Hi. What you are in scapy looking for is probably sprintf( ) or pkt.payload