S
S
SOmar2017-03-17 16:36:04
Python
SOmar, 2017-03-17 16:36:04

How to send network packets in python?

There are scales to which I send the request "test" using the sctp program,
here is the command itself 0002180000000100000000
Eth Write: 02 0C 00 01 00 04 00 - Eth Write header
: 00 DA 00 00 00 01 00 01 -
Eth Write command header: 00 00 00 00 - sending body Eth Write :
DC 06 - checksum (each time the same)
protocol description https://olegon.ru/showthread.php?t=15986 send(02,0C,00,01,00,04,00,00,DA,00,00,00,01,00,01,00,00,00,00,DC,06) then like this
s.send(02,0C,00,01,00,04,00)
s.send(00,DA,00,00,00,01,00,01
)
s.send(DC,06)
then
s.send(b'2,12,0,1,0,4,0,0,218,0,0,0,1,0,1,0,0,0, 0,220,6')
then
s.send(b'2,12,0,1,0,4,0')
s.send(b'0,218,0,0,0,1,0,1')
s .send(b'0,0,0,0')
s.send(b'220,6')
and in response to silence, the scales are silent like partisans.
Is there a program written in python 2 on the Internet? but firstly it doesn’t fit, and secondly, I myself want to learn how to understand protocols and tcp

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
asd111, 2017-03-17
@asd111

try sending via telnet or netcat without python first to know exactly what text to send

V
Vladimir Kuts, 2017-03-18
@fox_12

If there is any running program - install a sniffer and listen to the traffic. Compare with yours. Use a socket. Just specify in what format your numbers are sent - big endian, little endian, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question