-
-
[原创]2019看雪CTF 团队赛 第三题 影分身之术WP
-
发表于:
2019-3-21 02:38
6593
-
[原创]2019看雪CTF 团队赛 第三题 影分身之术WP
先运行cm,用窗口工具查看主窗体类名,发现是Internet Explorer_Server,从内存中搜索html相关的代码,发现了
<input type=button value="checkMyFlag" onclick="ckpswd();">
尝试在内存中搜索
ckpswd,找到了这段js代码:
尝试在内存中搜索
ckpswd,找到了这段js代码:
1 | function sptWBCallback(spt_wb_id,spt_wb_name,optionstr){url= '#sptWBCallback:id=' ;url=url+spt_wb_id+ ';eventName=' +spt_wb_name; if (optionstr) url=url+ ';params=optionstr' ;location=url;}eval( function (p,a,c,k,e,d){e= function (c){ return (c<a? '' :e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))}; if (! '' .replace(/^/,String)){ while (c--)d[e(c)]=k[c]||e(c);k=[ function (e){ return d[e]}];e= function (){ return '\\w+' };c=1}; while (c--) if (k[c])p=p.replace( new RegExp( '\\b' +e(c)+ '\\b' , 'g' ),k[c]); return p}( 'a 6() { f="n"; 3 = 8.5.l.q; c (3.d(f) ==0) { g=3.h; b=f.h; o(3.p(b,g)); } 9 { 4("r!<" + 3 + "> e j i 2 ;-)"); m "1"; }}a k(){ 4("7!");}' ,62,28, '|1234|GUID|a|alert|all|ckpswd|congratulations|document|else|function|i|if|indexOf|is|key|l|length|my|not|ok|pswd|return|simpower91|sptWBCallback|substring|value|wrong' .split( '|' ),0,{}))
|
可以写个html加载这个脚本,然后用chrome调试得到解密后的代码,解密后的代码为:
1 | function sptWBCallback(spt_wb_id,spt_wb_name,optionstr){url= '#sptWBCallback:id=' ;url=url+spt_wb_id+ ';eventName=' +spt_wb_name; if (optionstr) url=url+ ';params=optionstr' ;location=url;}eval( function (p,a,c,k,e,d){e= function (c){ return (c<a? '' :e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))}; if (! '' .replace(/^/,String)){ while (c--)d[e(c)]=k[c]||e(c);k=[ function (e){ return d[e]}];e= function (){ return '\\w+' };c=1}; while (c--) if (k[c])p=p.replace( new RegExp( '\\b' +e(c)+ '\\b' , 'g' ),k[c]); return p}( 'a 6() { f="n"; 3 = 8.5.l.q; c (3.d(f) ==0) { g=3.h; b=f.h; o(3.p(b,g)); } 9 { 4("r!<" + 3 + "> e j i 2 ;-)"); m "1"; }}a k(){ 4("7!");}' ,62,28, '|1234|GUID|a|alert|all|ckpswd|congratulations|document|else|function|i|if|indexOf|is|key|l|length|my|not|ok|pswd|return|simpower91|sptWBCallback|substring|value|wrong' .split( '|' ),0,{}))
|
可以写个html加载这个脚本,然后用chrome调试得到解密后的代码,解密后的代码为:
1 2 3 4 5 6 7 8 9 10 11 12 13 | function ckpswd() {
key= "simpower91" ;
a = document.all.pswd.value;
if (a.indexOf(key) ==0) {
l=a.length;
i=key.length;
sptWBCallback(a.substring(i,l));
} else {
alert( "wrong!<" + a + "> is not my GUID ;-)" );
return "1234" ; }}
function ok(){ alert( "congratulations!" );}
|
很明显,flag前面的字符串是simpower91,再调用sptWBCallback,
参数是flag的后几位字符。
1 2 3 4 5 6 7 8 9 10 11 12 13 | function ckpswd() {
key= "simpower91" ;
a = document.all.pswd.value;
if (a.indexOf(key) ==0) {
l=a.length;
i=key.length;
sptWBCallback(a.substring(i,l));
} else {
alert( "wrong!<" + a + "> is not my GUID ;-)" );
return "1234" ; }}
function ok(){ alert( "congratulations!" );}
|
很明显,flag前面的字符串是simpower91,再调用sptWBCallback,
参数是flag的后几位字符。
在内存中搜索
sptWBCallback,找到了这段代码:
1 2 3 4 5 6 7 | function sptWBCallback(spt_wb_id, spt_wb_name, optionstr) {
url = '#sptWBCallback:id=' ;
url = url + spt_wb_id + ';eventName=' + spt_wb_name;
if (optionstr)
url = url + ';params=optionstr' ;
location = url;
}
|
应该是回调了某个函数,在OD里搜索#sptWBCallback,定位到004920C1处下断。输入"
simpower91"加上其他的一些字符,按按钮后程序停下。
1 2 3 4 5 6 7 | function sptWBCallback(spt_wb_id, spt_wb_name, optionstr) {
url = '#sptWBCallback:id=' ;
url = url + spt_wb_id + ';eventName=' + spt_wb_name;
if (optionstr)
url = url + ';params=optionstr' ;
location = url;
}
|
应该是回调了某个函数,在OD里搜索#sptWBCallback,定位到004920C1处下断。输入"
simpower91"加上其他的一些字符,按按钮后程序停下。
单步时发现了这个
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
最后于 2019-3-21 02:40
被梦游枪手编辑
,原因: