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?
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:
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, https://www.rfc-editor.org/rfc/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.