今天返校,坐了半天车,太累了,就做了一道题。
upload1
很明显是文件上传漏洞
Array.prototype.contains = function (obj) {
var i = this.length;
while (i--) {
if (this[i] === obj) {
return true;
}
}
return false;
}
function check(){
upfile = document.getElementById("upfile");
submit = document.getElementById("submit");
name = upfile.value;
ext = name.replace(/^.+\./,'');
if(['jpg','png'].contains(ext)){
submit.disabled = false;
}else{
submit.disabled = true;
alert('请选择一张图片文件上传!');
}
}
这里前端验证必须是图片文件,可以先用png格式上传,然后抓包改成php文件,上传成功得到路径,用菜刀链接,找到flag.php
总结:需要学习一下菜刀的原理,计网知识还是不行。