farfalla
farfalla

Reputation: 173

Add SCTP protocol in scapy

I have to build SCTP packets in scapy, however it seems that SCTP does not exist in scapy folders. So I searched on the net and I found the sctp.py script:

https://github.com/jwiegley/scapy/blob/master/scapy/layers/sctp.py

I tried to copy this file in all folders that contains "/scapy/layers" but unfortunately SCTP is still undefined in scapy. ie: when I write sctp=SCTP(dport=2500,sport=2600) I got this error message :

NameError: name 'SCTP' is not defined

How can I solve this problem; Is there any command that I missed to run ? Thanks in advance.

Upvotes: 1

Views: 2655

Answers (1)

DeepStar
DeepStar

Reputation: 21

Not sure why you get an error ... I try this

scapy
s=SCTP(dport=2500,sport=2600)
>>> s.show()
###[ SCTP ]###
sport= 2600
dport= 2500
tag= None
chksum= None

Which looks good to me.

s.pdfdump("sctp.pdf")

This requires Gnu-Plot and some other package but this also works.

SCTP works !!

Hope this helps.

Upvotes: 2

Related Questions