有人可以帮助我实现Winexec以执行命令或使用x86 asm启动cmd.exe吗?
以下是我如何使用msvcrt.system生成cmd.exe的示例!我想对winexec做同样的事情。
00446001 68 65786500 PUSH 657865 // exe
00446006 8BDC MOV EBX,ESP
00446008 68 636D642E PUSH 2E646D63 // cmd.
0044600D 8BCC MOV ECX,ESP
00446010 53 PUSH EBX
00446011 51 PUSH ECX
00446012 E8 B0337E77 CALL msvcrt.system
00446017 90 NOP
答案 0 :(得分:3)
您可以尝试这两种变体之一(已注释其中之一)
;mov eax,1
;push eax
;call there
;db "notepad.exe c:\windows\system32\drivers\etc\hosts",0
;there:
;call WinExec
push "sts"
push "oh\c"
push "te\s"
push "revi"
push "rd\2"
push "3met"
push "sys\"
push "swod"
push "niw\"
push ".\:c"
push " exe"
push ".dap"
push "eton"
mov eax,esp ; the last one pushed is the head of the string
push 1
push eax
call WinExec
add esp,52 ; restore stack state (13 pushes)
xor eax,eax
push eax
call ExitProcess