scapy - Pulling data from a file to use as a payload -


how can have scapy pull file , send within icmp packet?

i using scapy create icmp packet , want pull file , include in payload. have been messing basic send command , cant figure out next step.

send(ip(dst="1.1.1.1")/icmp()/{file.txt}

simplest way read file string (or bytes) open , read, add raw.

with open('file.txt') f:     s = f.read() send(ip(dst = '1.1.1.1') / icmp() / raw(load = s)) # can, also, omit raw(load = s) , add ... / string_variable 

depending on file length , content type slight modifications may needed. example works small text file.

answer tested scapy3k (http://github.com/phaethon/scapy) , python3, should work scapy, too.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -