Pwnable-blackjack
游戏源码
http://cboard.cprogramming.com/c-programming/114023-simple-blackjack-program.html
打开之后是一个游戏

你有500本金,赢到一百万才有flag

每次下注不能超过本金,运气好都要很久,更何况还会输,那么我们看看这个游戏的源码,但是

于是我窃了一下其他的博客的源码
int betting() //Asks user amount to bet
{
printf("\n\nEnter Bet: $");
scanf("%d", &bet); if (bet > cash) //If player tries to bet more money than player has
{
printf("\nYou cannot bet more money than you have.");
printf("\nEnter Bet: ");
scanf("%d", &bet);
return bet;
}
else return bet;
} // End Function
可以看到这里,第一次判断如果下注超过本金,则告诉你没有那么多钱,并且让你在输入一次,重点是第二次输入的本金没有进行二次判断是否大于本金,于是我们就可以利用这里逻辑漏洞:第一次故意故意输入大于500,第二次输入一百万,一次一百万获取flag
第一次输入501,第二次1000000

与电脑斗智斗勇,然后暴富

或者可以利用负数


YaY_I_AM_A_MILLIONARE_LOL
Pwnable-blackjack的更多相关文章
- 【pwnable.kr】blackjack
又一道pwnable nc pwnable.kr 9009 读题找到源代码在:http://cboard.cprogramming.com/c-programming/114023-simple-bl ...
- pwnable.kr blackjack之write up
首先我们按提示找到源代码,看这一段: int betting() //Asks user amount to bet { printf("\n\nEnter Bet: $"); s ...
- pwnable.kr-balckjack-Writeup
MarkdownPad Document *:first-child { margin-top: 0 !important; } body>*:last-child { margin-botto ...
- pwnable.kr的passcode
前段时间找到一个练习pwn的网站,pwnable.kr 这里记录其中的passcode的做题过程,给自己加深印象. 废话不多说了,看一下题目, 看到题目,就ssh连接进去,就看到三个文件如下 看了一下 ...
- pwnable echo2
pwnable echo2 linux 32位程序 涉及FSB和UAF漏洞的利用,先%x泄露地址,然后利用UAF漏洞进行利用 code:
- Mini projects #6 ---- Blackjack
课程全名:An Introduction to Interactive Programming in Python,来自 Rice University 授课教授:Joe Warren, Scott ...
- pwnable.kr-bof
.Nana told me that buffer overflow is one of the most common software vulnerability. Is that true? D ...
- pwnable.kr-collision
题目: 链接后登陆 ssh col@pwnable.kr -p2222 查看文件以及权限 Ls –al 查看代码 cat col.c 根据 if(strlen(argv[1]) != 20){ pri ...
- pwnable.kr-fd
题目: 链接登录: ssh fd@pwnable.kr -p2222 查看文件及权限: ls –al 看到flag文件,但是当前用户fd并没有读权限. cat fd.c 分析程序: int argc ...
- BlackJack Strategy
GAME SPEC: 2-deck, 104 cards total. Bellagio has 2-deck and 6-deck games. based on hard 17, dealer h ...
随机推荐
- 【5】Android Service 与 AIDL
前言:本系列仅介绍基本大体的使用步骤,而不对每个步骤进行细致的讲解.读者可作为已经对相关内容有所了解后的快速查阅. 一.单应用内Service的使用 Service组件与Activity以IBinde ...
- June 16th, 2019. Week 25th, Sunday.
I can fly higher than an eagle, for you are the wind beneath my wings. 我之所以能飞得比鹰还高,是因为有你做我羽翼下的风. You ...
- Codeforces Round #600 (Div. 2)
传送门 A. Single Push 直接乱搞即可. Code /* * Author: heyuhhh * Created Time: 2019/11/16 22:36:20 */ #include ...
- python的路径问题
## 文件路径出错问题 """ 如何获取与当前文件相关的地址 """ import os # 当前文件的完整路径 print(__file_ ...
- C++ class内类型重载,operator Type()
#include <iostream> // operator Type() 类型操作符重载 // operator int() // operator double() // ... / ...
- WPF DataGrid 双击行 获得绑定数据
原文:WPF DataGrid 双击行 获得绑定数据 1)增加事件 2)增加对象获取 1)事件代码 Datagrid 增加事件 MouseDoubleClick="dataGrid_Mous ...
- <Design> 359 346
359. Logger Rate Limiter 用map搭建. class Logger { HashMap<String, Integer> map; /** Initialize y ...
- __module__和__class__
目录 一.__module__ 二.__class__ # lib/aa.py class C: def __init__(self): self.name = 'SB' # index.py fro ...
- HTML连载45-浮动元素脱标、排序规则、贴靠现象
一.浮动元素脱标 1.什么是浮动元素脱标 脱标:脱离标准流. 当某一个元素浮动之后,那么这个元素看上去就像被从标准流中删除了一样 2.浮动元素脱标之后有什么影响 如果前面一个元素浮动了,而后面的一个元 ...
- Python连载42-异步协程函数
一. asyncio 1.python3.4开始引入标准库之中,内置对异步io的支持 2.asyncio本身是一个消息循环 3.步骤: (1)创建消息循环 (2)把协程导入 (3)关闭 4.举例: ...