题目
!Doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
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('请选择一张图片文件上传!');
}
}
</script>
</head>
<body>
<form enctype='multipart/form-data' id='aa' name='aaa' method='post' action='index.php'>
<input id="upfile" name='upfile' type='file' onchange="check();" />
<input type='submit' id ='submit' value='上传'>
</form>
</body>
</html>
教程
首先咱们就一把梭,直接上传,就头铁
然后访问照片没有问题
这时候我们分析一下源码,
是一个js的一个前端判定,那思路就很简单了,抓包修改后缀,修改文件内容,蚁剑连接即可。