📄 backdoors.txt
字号:
BackdoorsBy PuertoSince the early days of intruders breaking into computers, they have triedto develop techniques or backdoors that allow them to get back into thesystem. In this paper, it will be focused on many of the common backdoorsand possible ways to check for them. Most of focus will be on Unixbackdoors with some discussion on future Windows NT backdoors. This willdescribe the complexity of the issues in trying to determine the methodsthat intruders use and the basis for administrators understanding on howthey might be able to stop the intruders from getting back in. When anadministrator understands how difficult it would be to stop intruder oncethey are in, the appreciation of being proactive to block the intruder fromever getting in becomes better understood. This is intended to cover manyof the popular commonly used backdoors by beginner and advanced intruders. This is not intended to cover every possible way to create a backdoor asthe possibilities are limitless.The backdoor for most intruders provide two or three main functions:Be able to get back into a machine even if the administrator tries tosecure it, e.g., changing all the passwords.Be able to get back into the machine with the least amount of visibility. Most backdoors provide a way to avoid being logged and many times themachine can appear to have no one online even while an intruder is usingit.Be able to get back into the machine with the least amount of time. Mostintruders want to easily get back into the machine without having to do allthe work of exploiting a hole to gain access.In some cases, if the intruder may think the administrator may detect anyinstalled backdoor, they will resort to using the vulnerability repeatedlyto get on a machine as the only backdoor. Thus not touching anything thatmay tip off the administrator. Therefore in some cases, thevulnerabilities on a machine remain the only unnoticed backdoor.Password Cracking BackdoorOne of the first and oldest methods of intruders used to gain not onlyaccess to a Unix machine but backdoors was to run a password cracker. Thisuncovers weak passworded accounts. All these new accounts are now possiblebackdoors into a machine even if the system administrator locks out theintruder's current account. Many times, the intruder will look for unusedaccounts with easy passwords and change the password to somethingdifficult. When the administrator looked for all the weak passwordedaccounts, the accounts with modified passwords will not appear. Thus theadministrator will not be able to easily determine which accounts to lockout.Rhosts + + BackdoorOn networked Unix machines, services like Rsh and Rlogin used a simpleauthentication method based on hostnames that appear in rhosts. A usercould easily configure which machines not to require a password to loginto. An intruder that gained access to someone's rhosts file could put a"+ +" in the file and that would allow anyone from anywhere to log intothat account without a password. Many intruders use this method especiallywhen NFS is exporting home directories to the world. These accountsbecome backdoors for intruders to get back into the system. Many intrudersprefer using Rsh over Rlogin because it is many times lacking any loggingcapability. Many administrators check for "+ +" therefore an intruder mayactually put in a hostname and username from another compromised account onthe network, making it less obvious to spot.Checksum and Timestamp BackdoorsEarly on, many intruders replaced binaries with their own trojan versions. Many system administrators relied on time-stamping and the system checksumprograms, e.g., Unix's sum program, to try to determine when a binary filehas been modified. Intruders have developed technology that will recreate the same time-stamp for the trojan file as the original file. This isaccomplished by setting the system clock time back to the original file'stime and then adjusting the trojan file's time to the system clock. Oncethe binary trojan file has the exact same time as the original, the systemclock is reset to the current time. The sum program relies on a CRCchecksum and is easily spoofed. Intruders have developed programs thatwould modify the trojan binary to have the necessary original checksum,thus fooling the administrators. MD5 checksums is the recommended choiceto use today by most vendors. MD5 is based on an algorithm that no one hasyet to date proven can be spoofed.Login BackdoorOn Unix, the login program is the software that usually does the passwordauthentication when someone telnets to the machine. Intruders grabbed thesource code to login.c and modified it that when login compared the user'spassword with the stored password, it would first check for a backdoorpassword. If the user typed in the backdoor password, it would allow you tolog in regardless of what the administrator sets the passwords to. Thusthis allowed the intruder to log into any account, even root. Thepassword backdoor would spawn access before the user actually logged in andappeared in utmp and wtmp. Therefore an intruder could be logged in andhave shell access without it appearing anyone is on that machine as thataccount. Administrators started noticing these backdoors especially ifthey did a "strings" command to find what text was in the login program. Many times the backdoor password would show up. The intruders thenencrypted or hid the backdoor password better so it would not appear byjust doing strings. Many of the administrators can detect these backdoorswith MD5 checksums.Telnetd BackdoorWhen a user telnets to the machine, inetd service listens on the port andreceive the connection and then passes it to in.telnetd, that then runslogin. Some intruders knew the administrator was checking the loginprogram for tampering, so they modified in.telnetd. Within in.telnetd, itdoes several checks from the user for things like what kind of terminal theuser was using. Typically, the terminal setting might be Xterm or VT100. An intruder could backdoor it so that when the terminal was set to"letmein", it would spawn a shell without requiring any authentication. Intruders have backdoored some services so that any connection from aspecific source port can spawn a shell.Services BackdoorAlmost every network service has at one time been backdoored by anintruder. Backdoored versions of finger, rsh, rexec, rlogin, ftp, eveninetd, etc., have been floating around forever. There are programs thatare nothing more than a shell connected to a TCP port with maybe a backdoorpassword to gain access. These programs sometimes replace a service likeuucp that never gets used or they get added to the inetd.conf file as a newservice. Administrators should be very wary of what services are runningand analyze the original services by MD5 checksums.Cronjob backdoorCronjob on Unix schedules when certain programs should be run. An intrudercould add a backdoor shell program to run between 1 AM and 2 AM. So for 1hour every night, the intruder could gain access. Intruders have alsolooked at legitimate programs that typically run in cronjob and builtbackdoors into those programs as well.Library backdoorsAlmost every UNIX system uses shared libraries. The shared libraries areintended to reuse many of the same routines thus cutting down on the sizeof programs. Some intruders have backdoored some of the routines likecrypt.c and _crypt.c. Programs like login.c would use the crypt() routineand if a backdoor password was used it would spawn a shell. Therefore,even if the administrator was checking the MD5 of the login program, it wasstill spawning a backdoor routine and many administrators were not checkingthe libraries as a possible source of backdoors.One problem for many intruders was that some administrators started MD5checksums of almost everything. One method intruders used to get aroundthat is to backdoor the open() and file access routines. The backdoorroutines were configured to read the original files, but execute the trojanbackdoors. Therefore, when the MD5 checksum program was reading thesefiles, the checksums always looked good. But when the system ran theprogram, it executed the trojan version. Even the trojan library itself,could be hidden from the MD5 checksums. One way to an administrator couldget around this backdoor was to statically link the MD5 checksum checkerand run on the system. The statically linked program does not use thetrojan shared libraries.Kernel backdoorsThe kernel on Unix is the core of how Unix works. The same method used forlibraries for bypassing MD5 checksum could be used at the kernel level,except even a statically linked program could not tell the difference. Agood backdoored kernel is probably one of the hardest to find byadministrators, fortunately kernel backdoor scripts have not yet beenwidely made available and no one knows how wide spread they really are.File system backdoorsAn intruder may want to store their loot or data on a server somewherewithout the administrator finding the files. The intruder's files cantypically contain their toolbox of exploit scripts, backdoors, snifferlogs, copied data like email messages, source code, etc. To hide thesesometimes large files from an administrator, an intruder may patch thefiles system commands like "ls", "du", and "fsck" to hide the existence ofcertain directories or files. At a very low level, one intruder's backdoorcreated a section on the hard drive to have a proprietary format that wasdesignated as "bad" sectors on the hard drive. Thus an intruder couldaccess those hidden files with only special tools, but to the regularadministrator, it is very difficult to determine that the marked "bad"sectors were indeed storage area for the hidden file system.Bootblock backdoorsIn the PC world, many viruses have hid themselves within the bootblocksection and most antivirus software will check to see if the bootblock hasbeen altered. On Unix, most administrators do not have any software thatchecks the bootblock, therefore some intruders have hidden some backdoorsin the bootblock area.Process hiding backdoorsAn intruder many times wants to hide the programs they are running. Theprograms they want to hide are commonly a password cracker or a sniffer. There are quite a few methods and here are some of the more common:An intruder may write the program to modify its own argv[] to make it looklike another process name.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -