
 ----------------------------------------------------
| ## #### ### ### #####       #### ## ## ##### ##### |
| ## ##   ## # ## ##  ##      ##   ##### ## ##  ##   |
| ## ##   ##   ## #####  ###  ##   ## ## #####  ##   |
| ## #### ##   ## ##          #### ## ## ## ##  ##   |
 ====================================================

-=[ Description ]=-

ICMP Chat is a simple chat. The difference to other chat programs is the
fact that this one is based on the ICMP protocol.


-=[ ICMP protocol ]=-

The ICMP protocol was developed to provide a way of sending error messages
or gathering informations about a network. 
The mostly used tool with ICMP is ping, which simply sends an ICMP
echo_request packet to an adress and waits for an answer (echo_reply).

ICMP messages are send in IP datagrams, which does not mean that ICMP is 
a higher-level protocol like TCP. It is part of the Internet Protocol.

Structure of an ICMP packet:

0___4____8_______15_______________31 _ _
|  Type  |  Code  |    Checksum    |  |  4 bytes
|________|________|________________| _|_
|        Unused                    |  |  4 bytes
|__________________________________| _|_
|  IP Header + 64 bit (datagramm)  |
|__________________________________|


The unused field is used by icmpchat to send the text/commands.

See the following RFCs for more informations: 792, 1122, 1256, 1349,1812


-=[ Technical stuff ]=-

When constructing an ICMP packet, the string that is sent contains the
following content:
SessionID + Text/Command

The SessionID is defined in config.h and is static, so you have do choose your
SessionID before compiling. The default is 'icmpsid'.

When an ICMP packet arrives, it is checked against some filterrules, for
example the correct SessionID, ICMP code and ICMP sequence number. 
If everything matches, the text is stripped of the payload and gets displayed.


-=[ Problems ]=-

Using *request packets like echo_request still causes problems because the
packets won't arrive on a raw socket. 
I will include libpcap in the next versions so that this will be fixed.


-=[ Installation ]=-

If you want to set your own session_id, you have to do it before compiling 
ICMP Chat. It is defined in the file 'config.h'.

To build ICMP Chat just type 'make'. (For solaris type 'make solaris').

IMPORTANT NOTE: Only root can use icmpchat because it uses a raw socket.
Use 'su -c' or 'sudo' to run icmpchat or set the suid-flag for the
binary (chmod 4755 /usr/local/bin/icmpchat) to be able to use icmpchat
as a non-privileged user. This is not done by default because the code
has not been audited yet.

If you have got any problems while compiling icmpchat, just drop me a mail.


-=[ Usage ]=-

Quick start: 

$ icmpchat <host> <icmp_code> <nick>

<host>      = Host to connect to
<icmp_code> = icmp_code to use, see below for a list
<name>      = Set your nickname (default: 'user')

There are several commands included in the chat, which are called by 
placing a slash in front of them. See '/help' for a list. 

Options are for example the icmpcode, which can be changed while chatting, 
the nickname and so on. 


-=[ ICMP codes ]=-

These are the possible ICMP codes ICMP chat supports at the moment:

 [0] Echo Reply
 [5] Redirect
 [8] Echo Request
 [9] Router advertisement 
[10] Router solicitation 
[13] Timestamp request 
[14] Timestamp reply 
[15] Information request 
[16] Information reply 
[17] Adressmask request 
[18] Adressmask reply 


-=[ Author ]=-

Name:   Martin J. Muench 
E-Mail: mjm@codito.de
Web:    http://www.codito.de


-=[ Thanks ]=-

Martin Ruderer
Peter Simons
