Sending a file over icmp with hping

hping3 10.0.2.254 --icmp --sign MSGID1 -d 50 -c 1 --file a_file
you need to start a listening hping on the reciever: hping3 --listen 10.0.2.254 -I eth0 --sign MSGID1 then you can send your file: hping3 10.0.2.254 --icmp --sign MSGID1 -d 50 -c 1 --file a_file
Sample Output
SENDER:
  root@hdc3:/tmp # cat a_file 
this is a file...
and some data...

  root@hdc3:/tmp # hping3 10.0.2.254 --icmp --sign MSGID1 -d 50 -c 1 --file a_file
HPING 10.0.2.254 (eth0 10.0.2.254): icmp mode set, 28 headers + 50 data bytes
[main] memlockall(): Success
Warning: can't disable memory paging!
len=78 ip=10.0.2.254 ttl=64 id=48083 icmp_seq=0 rtt=0.3 ms

--- 10.0.2.254 hping statistic ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.3/0.3/0.3 ms
  root@hdc3:/tmp # 

RECIEVER:
root@monitor:/home/hadace # hping3 --listen 10.0.2.254 -I eth0 --sign MSGID1
hping3 listen mode
[main] memlockall(): Success
Warning: can't disable memory paging!
this is a file...
and some data...

this is a file...
and some data...

^C
---  hping statistic ---
0 packets transmitted, 0 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
root@monitor:/home/hadace # 

11
By: hadace
2013-10-23 14:01:01

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: