gdb-peda调试pwnable.kr题目random

CTF实战进阶:自动化脚本、赛事规划与系统学习路线全解析 在网络安全领域,自动化脚本是提升效率的核心技术,其原理在于将重复性、模式化的任务通过编程实现流程化处理。这项技术的价值在于解放安全研究人员的精力,使其能更专注于复杂的逻辑分析与漏洞挖掘。在渗透测试、漏洞挖掘等应用场景中,自动化脚本常用于信息收集、漏洞探测和利用链构建。本文聚焦于CTF竞赛这一实战演练场,深入探讨如何利用自动化脚本工具应对Web安全和逆向工程挑战,并结合全年赛事时间表与分阶段学习路线,为参赛者提供一套从入门到精通的系统性成长方案。文中融入了针对SQL注入和SSTI等常见漏洞的自动化探测技术,帮 阅读详情

题目pwnable.kr——6.random

各种技术文章开始前的例行叨叨:

pwnable.kr是CTF—pwn类型题目学习网站,对其中第6题random解题过程做一份记录。

本萌新菜鸡刚接触pwn,顺手做记录,欢迎指正讨论。



源码:

文件【random.c】

#include <stdio.h>

int main(){
	unsigned int random;
	random = rand();	// random value!

	unsigned int key=0;
	scanf("%d", &key);

	if( (key ^ random) == 0xdeadbeef ){
		printf("Good!\n");
		system("/bin/cat flag");
		return 0;
	}

	printf("Wrong, maybe you should try 2^32 cases.\n");
	return 0;
}



分析:

变量random是rand随机函数返回值

变量key是由我们输入的值

要求key异或random后等于0xdeadbeef才能Get flag


突破点在于:rand函数没有设变化的随机种子,每次随机的结果都相同。

所以,获取到这个假随机rand值,就能计算出正确的key。



调试:

【目的】:通过gdb-peda调试random可执行文件获取rand值

(目标服务器上有random.c和random可执行文件,ssh连接后下载)

1、gdb-peda配置

gdb-peda是gdb的插件,相当于Linux的od

安装

yaffs2.0.2.9.tar.gz https://code.google.com/archive/p/yaffs2utils/downloads android yaffs2解压打包工具 版本0.2.9 需要环境linux 立即下载

相关推荐

瑞萨RH850/U2A8以太网模块mcal说明

如下所有功能的支持需要在达芬奇中开启EthGlobalTimeSupport。秒[32bit], 纳秒[32bit], 纳秒小数[20bit]每一帧发送数据的相关结构缓冲区都放在变量。每一帧接收数据的相关结构缓冲区都放在变量。

至道无难,唯嫌拣择。 1861

ROS2学习笔记(二)-- 多机通讯原理简介及配置方法

简单介绍ROS2多机通信原理以及配置注意事项

aibingjin的博客 1万+

obisidian插件之【templater】模板的中文说明书

Templater 是一种模板语言,可让您将变量和函数结果插入到笔记中。它还允许您执行操作这些变量和函数的 JavaScript 代码。使用 Templater,您将能够创建强大的模板来自动执行手动任务。

m0_55795604的博客 1万+

Power BI----各类切片器的使用

首先介绍切片器的最基础的创建和效果演示,紧跟着介绍切片器在多页中的同步和本身与报表的联动,再然后介绍关于切片器属性的设置,使得交互更加美观,最后介绍几种很好看的第三方的切片器样式和自己构建的可折叠的切片器.........

Itsme_MrJJ的博客 2万+

Ansys Motor-CAD:概述(EMag、THERM、LAB、MECH)

在这篇博客中,我概述了如何使用 Ansys Motor-CAD 模型、模拟、分析和后处理结果来评估电机性能,并帮助您为您的应用选择优化的电机,并通过电机设计选择实现成本效益和效率。我介绍了各种可用的电机类型、可供选择的物理模块和可配置的多物理选项。E-Mag 物理模块有许多选项卡,涵盖几何创建、材料选择、电磁设置、条件、求解器类型、解决方案模型、耦合设置等的所有设置。热物理模块有许多选项卡,涵盖几何创建、材料选择、热设置、条件、求解器类型、解决方案模型、耦合设置等的所有设置。分析结果的速度相结合。

jkh920184196的博客 1759

SAP:QUERY中SQ02增加选择屏幕权限控制

【代码】SAP:QUERY中SQ02增加选择屏幕权限控制。

weixin_43734184的博客 2326

2025年7月5日全国青少年信息素养大赛Python编程初中组复赛真题+答案解析

2025年7月5日全国青少年信息素养大赛Python编程初中组复赛真题+答案解析

伶俐角少儿编程 466

利用大模型和聚类算法找出 Excel 文件中重复或相似度高的数据,并使用 FastAPI 进行封装的详细方案

tokenizer将输入的文本列表texts转换为 PyTorch 张量,同时进行填充和截断操作,以确保所有输入具有相同的长度。对输入进行推理,得到模型的输出。对模型的最后一层隐藏状态求平均,得到每个文本的向量表示。.numpy()将 PyTorch 张量转换为 NumPy 数组。使用DBSCAN算法对文本向量进行聚类。eps是邻域半径,是形成核心点所需的最小样本数。fit方法对输入的向量进行聚类,并返回每个样本所属的簇标签。try:定义了一个 POST 请求的 API 路由,路径为。

AI的内部世界的博客 1069

深度学习工具包 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")

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

下一篇: XSS学习整理——0ctf和一只皮卡丘的死磕
publicStr
博客等级 码龄9年 40粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值