Take the 2-minute tour ×

I'm currently building an IRC bot for learning purposes in C for learning purposes. I'm having a bit of trouble handling the ident message that the server is sending to my bot. I know I have to listen on port 113 for the ident message and send back an ident response. The trouble is that I can't bind the socket I created to port 113 in order to listen for that message.

Is there any way for me to bind to port 113 or another solution to this problem? Also, how do I respond to the ident message the server sends?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Binding to ports lower than 1024 requires root access on Linux, and administrator rights on Windows. Try running as an admin user and see if that helps. If you still can't bind, check nothing else is running a service on 113:

# Windows
netstat -a | find "listening"
# Linux
netstat -lnptu

Again, you may need to run as root/admin to see which ports are in use.

You can find more information on Ident on the RFC, http://tools.ietf.org/html/rfc1413 which is actually quite a concise.

Also, you may not necessarily need to run an Ident service to connect (although it is preferred!), depending on the network. It will depend on the server you connect to, but try waiting for the server's attempted Ident query to fail and see how it behaves.

share|improve this answer
It says "Ident request timed out." then "Could not find your ident, using ~testbot instead." before going on and displaying normal IRC behavior and joining a channel. So I guess it isn't necessary for me to handle it then? –  seraphzero Jun 11 '12 at 1:22
Then you can feel free to ignore it. There are few servers which require it these days, so if you don't need to run/spoof identd, don't bother. Interestingly, if you want to see the difference, the popular IRC client mIRC has an option to run an identd service for IRC connections. –  stew Jun 11 '12 at 2:01
OK thanks for the explanation. –  seraphzero Jun 11 '12 at 6:49
add comment

Responding to ident is not a privilege or responsibility your bot has. The whole point of the ident protocol is for the machine to identify which user a network client is running as to a remove server the client has connected to; this is for the purpose of identifying a responsible party if the client is found to be abusive, so that the abusive user, rather than the administrator of the shell box, can be held accountable.

share|improve this answer
add comment

Your Answer


