Ping... a message arrrived
SAKSHAM TRIVEDI
Security (SOC) Analyst || Microsoft Certified Security Operation Canter Analyst
In this short tutorial, Here I am going to demonstrate chatting using ping command.
For this first of all you need a program that can convert your text into hexadecimal format and at the same time it should not exceed the ICMP payload limit.
If you have a program that's great if you don't have a program for this refer here
Once you have converted the string into hexadecimal
Open terminal window on host one type the command mentioned below and hit enter.
Explanation to above command
In the above command there are two things working at the same time to deliver your message to another host. here, ping command as usual we all have used to check whether the target host is up or not is used with -p option to customize the payload that can be send through ICMP packet which contains additional 16 bytes of padding in the ICMP header.
and then used this ICMP payload to pipe the output of ping to netcat to send over the network and then receiving it on another host and also, we can read the message at the same time and for out communication we will use port 8000.
To read the message on the other side we will use netcat in listening mode on another host:
and pipe the output to the grep command to filter out rest of the irrelevant ICMP message that was combined with our text.
领英推荐
As you can see the message our message has arrived successfully on the other host.
But... Wait a minute...
It's totally unreadable.
If you think that then let me tell you... Whatever you saw as a text in the received message is a hexadecimal form of 'Hi' which is converted because ICMP don't deals with the text any computer system even never deals with the text directly it converts it accordingly and, in our case, this has to be done as ICMP header only can take hexadecimal values and up to only 16 Bytes because of the limitation of ICMP header size.
So, in order to send any messages over the ICMP it's crucial to send the text within certain limit and using hex converter.
Thanks
- SK -
World Record Holder | 2x TEDx Speaker | Philanthropist | Sr. Principal Consultant | Entrepreneur | Founder LW Informatics | Founder Hash13 pvt ltd | Founder IIEC
1 年Nice