php中extract()函数存在变量覆盖漏洞,所以讲url后面加上 /?a=&b=,$a和$b变量内容为空字符串造成两个的值相等,或者直接就 /a= ,也行。得到flag。
[pwnthebox] 你给我一个满意的数字,我就给你flag!查看源码,发现index.php.txt.访问得到了源码:
审计后发现,需要满足:
if (isset ( $_POST ['num'] )) { if (@ereg ( "^[1-9]+$", $_POST['num'] ) === FALSE) echo '说好的数å—呢?'; else if (strpos ( $_POST['num'], '#testaasafd' ) !== FALSE) die ( 'Flag: ' . $flag );
ereg函数存在截断漏洞。
采用%00截断来绕过数字检测,同时strpos检测num中的#testaasafd返回true。
hackbar传入:
?num=1%00#testaasafd 得到flag。
eregif (isset ($_GET['password'])) { if (ereg ("^[a-zA-Z0-9]+$", $_GET['password']) === FALSE) { echo 'You password must be alphanumeric
'; } else if (strlen($_GET['password']) < 8 && $_GET['password'] > 9999999) { if (strpos ($_GET['password'], '*-*') !== FALSE) //strpos — 查找字符串首次出现的位置 { die('Flag: ' . $flag);
同上题,ereg函数存在%00截断,这道题多了对password的长度进行了限制,还要满足>9999999.科学计数法绕过。
构造。
?password=1e8%00*-* 即可
变量根据题目和题的提示可知,flag在全局变量中。传入GLOBALS即可。
?hello=`cat flag.php`
在源码中得到flag。
3秒内算出结构并输入,人肯定算不了这么快,用python脚本计算看返回结果,得到flag。
import requests, re url = 'https://1719-8daad556-e60b-4884-8dd3-97644aa066fd.do-not-trust.hacking.run/' # Session():模拟登录操作 s = requests.Session() # 创建一个Session对象:s def getURL(url): con = s.get(url) # 发送请求,使用默认得登录属性 res = con.text # 获取页面text格式转换得字符串:res return res def Calculation(text): #print((re.findall(".* 一道很奇怪的题目查看源码发现一串编码后的字符串:
![]()
形如unicode,解码后得到flag。
奇葩的题目提示查看源码:
![]()
urldecode()之后,得到p1和p2.
拼接起来后得到:
function checkSubmit(){ var a=document.getElementById("password"); if("undefined"!=typeof a){ if("67d709b2b54aa2aa648cf6e87a7114f1"==a.value) return!0; alert("Error"); a.focus(); return!1 } } document.getElementById("levelQuest").onsubmit=checkSubmit;因此这里判断我们输入的是否是67d709b2b54aa2aa648cf6e87a7114f1 。输入即可得到flag