# one 转发端口监听 $ ncat -vc ./orw -kl 127.0.0.1 8888 Ncat: Version 7.80 ( https://nmap.org/ncat ) Ncat: Listening on 127.0.0.1:8888 Ncat: Connection from 127.0.0.1. Ncat: Connection from 127.0.0.1:55184. # two 连接端口传输 $ nc 127.0.0.1 8888 Give my your shellcode:
1 2 3 4 5 6 7 8 9 10 11
$ pidof orw # 查看进程pid 986668 $ gdb attach 986668 Attaching to process 986668 (gdb) Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf ptrace: Operation not permitted. $ echo 0 | /proc/sys/kernel/yama/ptrace_scope # 就可以attach了 $ echo "0"|sudo tee /proc/sys/kernel/yama/ptrace_scope