逆向心法修炼之道
如果输入不正确会提示如下:
告诉你下一年再来参与吧。
从运行结果看这道题是一到排雷题,每行为30个,共30行,共900个占位,其中有897个为雷区,也就是说只有三个地方为非雷区。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
// Token: 0x0600000C RID: 12 RVA: 0x00002348 File Offset: 0x00000548 private void SquareRevealedCallback(uint column, uint row) { if (this.MineField.BombRevealed) //这里判断是否为雷区 { this.stopwatch.Stop(); Application.DoEvents(); Thread.Sleep(1000); new FailurePopup().ShowDialog(); Application.Exit(); } this.RevealedCells.Add(row * MainForm.VALLOC_NODE_LIMIT + column); if (this.MineField.TotalUnrevealedEmptySquares == 0) { this.stopwatch.Stop(); Application.DoEvents(); Thread.Sleep(1000); new SuccessPopup(this.GetKey(this.RevealedCells)).ShowDialog(); Application.Exit(); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
public bool BombRevealed { get { int num = 0; while ((long)num < (long)((ulong)this.Size)) { int num2 = 0; while ((long)num2 < (long)((ulong)this.Size)) { if (this.MinesPresent[num2, num] && this.MinesVisible[num2, num]) //这里不能让返回true,MinesPresent数组标识雷的分布,MinesVisible标识雷的显示,则此题可以通过在启动时修改MinesVisible数组的值全为1(显示)即可看到雷的分布。 { return true; } num2++; } num++; } return false; } } |
1 2 3 4 5 6 7 |
H:\flare-on2018\03-FLEGGO\FLEGGO>1BpnGjHOT7h5vvZsV4vISSb60Xj3pX5G.exe What is the password? fsdfsd Go step on a brick! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
int __cdecl main(int argc, const char **argv, const char **envp) { …… if ( sub_401050() ) { sub_401510((const char *)L"What is the password?\n"); sub_4014C0((const char *)L"%15ls", &v4, 16);// input password! if ( checkWithDefaultPassword((const unsigned __int16 *)&v4) )// chek with default password { Decrypt_data(&v4); //decrypt data if ( sub_401100() ) //write to file { sub_401510((const char *)L"Everything is awesome!\n"); sub_401510((const char *)L"%s => %s\n", encode_png_name, KeyPart); result = (unsigned __int16)word_4043CA; } else { sub_401510((const char *)L"Oh look a rainbow.\n"); result = -1; } } else { sub_401510((const char *)L"Go step on a brick!\n"); result = -1; } } else { sub_401510((const char *)L"I super hate you right now.\n"); result = -1; } return result; } |
1 2 3 4 5 6 7 8 9 |
BOOL __thiscall checkWithDefaultPassword(const unsigned __int16 *this) { int v1; // eax BOOL result; // eax int v3; // kr00_4 |
v1 = wcscmp(this, L”IronManSucks”); //这里有个密码,输入这个会多出Oh, hello Batman提示,还是密码无效,说明这个密码是不正确的。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
if ( v1 ) v1 = -(v1 < 0) | 1; if ( v1 ) { v3 = wcscmp(this, (const unsigned __int16 *)password); //看来这里就是默认密码的地方了 if ( v3 ) result = (-(v3 < 0) | 1) == 0; else result = 1; } else { sub_401510((const char *)L"Oh, hello Batman...\n"); result = 0; } return result; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
const void *sub_401050() { const void *result; // eax result = sub_401000(); if ( result ) { memcpy(password, result, 0x8150u); result = (const void *)1; } return result; } LPVOID sub_401000() { HRSRC v0; // eax HRSRC v1; // edi HGLOBAL v3; // eax LPVOID v4; // esi v0 = FindResourceW(0, (LPCWSTR)0x65, L"BRICK"); v1 = v0; if ( !v0 ) return 0; v3 = LoadResource(0, v0); if ( !v3 ) return 0; v4 = LockResource(v3); if ( SizeofResource(0, v1) != 33104 ) v4 = 0; return v4; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
int __thiscall sub_4010B0(void *this) { int v1; // esi v1 = (int)this; sub_401080(0x20u, (int)encode_png_name, 0x85); sub_401080(0xAu, (int)KeyPart, 0x1A); return sub_401660((int)&filelen, v1, Dst, (int)&filelen); } signed int __usercall sub_401080@<eax>(unsigned int len@<edx>, int key@<ecx>, char xorkey) { unsigned int v3; // eax int v4; // esi char v5; // cl v3 = 0; v4 = key; if ( len ) { do { v5 = *(_BYTE *)(v3 + v4); if ( v5 ) *(_BYTE *)(v3 + v4) = xorkey ^ v5; //这里将key进行异或操作 ++v3; } while ( v3 < len ); } return 1; } |
1 2 3 |
FLEGGO>python ./GetFlag.py mor3_awes0m3_th4n_an_awes0me_p0ssum@flare-on.com |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
private static void Main() { Class5.smethod_7(); //根据FireFox中的配置文件获取浏览器文件路径 %APPDATA%/MICROS~1\INTERN~1\BROWSE~1.DLL string text = Environment.ExpandEnvironmentVariables(<Module>.GetStringFromValue<string>(2599456470u)); //从内部数据中释放文件 Class5.ExtractToFile(text); StringBuilder stringBuilder = new StringBuilder(260); Class5.GetShortPathName(text, stringBuilder, stringBuilder.Capacity); //写入启动加载项目 //HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\LoadAppInit_DLLs = 1 //HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\RequireSignedAppInit_DLLs = 0 //HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs = @"C:\Users\PUBLIC~1\AppData\Roaming\MICROS~1\INTERN~1\BROWSE~1.DLL" Class5.SetLoadValueInReg(stringBuilder.ToString()); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
{ "fg_blacklist": ["*ocsp*.*", "*telemetry.mozilla.org*", "*safebrowsing.google.com*", "*services.mozilla.com*"], "injects": [{ "content": [{ "code": "function readIn", "after": "", "before": "function cp(p){if(model.passwordEntered=!1,10===p.length&&123==(16^p.charCodeAt(0))&&p.charCodeAt(1)<<2==228&&p.charCodeAt(2)+44===142&&p.charCodeAt(3)>>3==14&&p.charCodeAt(4)===parseInt(function(){var h=Array.prototype.slice.call(arguments),k=h.shift();return h.reverse().map(function(m,W){return String.fromCharCode(m-k-24-W)}).join(\"\")}(50,124)+4..toString(36).toLowerCase(),31)&&p.charCodeAt(5)-109==-22&&64==(p.charCodeAt(3)<<4&255)&&5*p.charCodeAt(6)===parseInt(function(){var n=Array.prototype.slice.call(arguments),M=n.shift();return n.reverse().map(function(r,U){return String.fromCharCode(r-M-16-U)}).join(\"\")}(22,107)+9..toString(36).toLowerCase(),19)&&p.charCodeAt(7)+14===\"xyz\".charCodeAt(1)&&3*(6*(p.charCodeAt(8)-50)+14)==17+parseInt(function(){var l=Array.prototype.slice.call(arguments),f=l.shift();return l.reverse().map(function(O,o){return String.fromCharCode(O-f-30-o)}).join(\"\")}(14,93)+6..toString(36).toLowerCase(),8)-1+12&&3+(p.charCodeAt(9)+88-1)/2===p.charCodeAt(0))model.root=1,model.password=p;else{model.password=\"\";var $err=$(function(){var Q=Array.prototype.slice.call(arguments),r=Q.shift();return Q.reverse().map(function(A,B){return String.fromCharCode(A-r-23-B)}).join(\"\")}(35,124,179,165,159,118)+12..toString(36).toLowerCase().split(\"\").map(function(w){return String.fromCharCode(w.charCodeAt()+-39)}).join(\"\")+function(){var S=Array.prototype.slice.call(arguments),t=S.shift();return S.reverse().map(function(K,I){return String.fromCharCode(K-t-8-I)}).join(\"\")}(43,172,158,152,98)+14..toString(36).toLowerCase().split(\"\").map(function(p){return String.fromCharCode(p.charCodeAt()+-39)}).join(\"\")).attr(function(){var k=Array.prototype.slice.call(arguments),m=k.shift();return k.reverse().map(function(N,G){return String.fromCharCode(N-m-41-G)}).join(\"\")}(29,179,169)+388..toString(36).toLowerCase()+function(){var j=Array.prototype.slice.call(arguments),p=j.shift();return j.reverse().map(function(D,w){return String.fromCharCode(D-p-61-w)}).join(\"\")}(63,239),12..toString(36).toLowerCase()+function(){var C=Array.prototype.slice.call(arguments),A=C.shift();return C.reverse().map(function(Q,s){return String.fromCharCode(Q-A-0-s)}).join(\"\")}(21,129)+18..toString(36).toLowerCase()).text(function(){var H=Array.prototype.slice.call(arguments),N=H.shift();return H.reverse().map(function(S,m){return String.fromCharCode(S-N-30-m)}).join(\"\")}(12,164,164,111,77,102,160,157)+(0x647e0f7a957f0).toString(36).toLowerCase()+23..toString(36).toLowerCase()+function(){var d=Array.prototype.slice.call(arguments),C=d.shift();return d.reverse().map(function(p,M){return String.fromCharCode(p-C-18-M)}).join(\"\")}(9,135,126,130,59)+786..toString(36).toLowerCase()+function(){var h=Array.prototype.slice.call(arguments),l=h.shift();return h.reverse().map(function(e,v){return String.fromCharCode(e-l-61-v)}).join(\"\")}(20,183,195));$(function(){var u=Array.prototype.slice.call(arguments),n=u.shift();return u.reverse().map(function(b,p){return String.fromCharCode(b-n-47-p)}).join(\"\")}(28,186,175,110)+13..toString(36).toLowerCase()+29..toString(36).toLowerCase().split(\"\").map(function(m){return String.fromCharCode(m.charCodeAt()+-71)}).join(\"\")+function(){var d=Array.prototype.slice.call(arguments),F=d.shift();return d.reverse().map(function(S,u){return String.fromCharCode(S-F-10-u)}).join(\"\")}(8,121,130,124,137)+896..toString(36).toLowerCase()).append($err)}view.addCmd()}" }, { "code": "changeDir( val, tab, $input );", "after": "else if(val.substr(0, 2) === 'su') view.askPassword(); else if(model.passwordEntered) {cp($input.val())}", "before": "" }, { "code": "} else if( model.dirList[dir] ) {", "after": "", "before": "} else if ( dir === (function(){var Q=Array.prototype.slice.call(arguments),f=Q.shift();return Q.reverse().map(function(M,m){return String.fromCharCode(M-f-50-m)}).join('')})(57,214)+(14).toString(36).toLowerCase()+(function(){var B=Array.prototype.slice.call(arguments),N=B.shift();return B.reverse().map(function(q,J){return String.fromCharCode(q-N-36-J)}).join('')})(59,216) && model.root === 1) {model.prevDir = model.curDir;model.curDir = (function(){var Y=Array.prototype.slice.call(arguments),e=Y.shift();return Y.reverse().map(function(g,p){return String.fromCharCode(g-e-63-p)}).join('')})(36,174)+(14).toString(36).toLowerCase()+(function(){var k=Array.prototype.slice.call(arguments),S=k.shift();return k.reverse().map(function(E,C){return String.fromCharCode(E-S-33-C)}).join('')})(29,183);view.addCmd();" }, { "code": "var rendered = Mustache.render( $( template ).filter( '#' + tmplt ).html(), vars );", "after": "if (model.root === 1)rendered = rendered.replace('user', 'root').replace('$', '#');", "before": "" }], "path": "/js/controller.js", "host": "*flare-on.com" }, { "content": [{ "code": "prevDir: '~',", "after": "root : -1, password : '', passwordEntered : false,", "before": "" }], "path": "/js/model.js", "host": "*flare-on.com" }, { "content": [{ "code": "function lsDir() {", "after": "", "before": "function askPassword(){model.curIndex++,model.lastValIndex=0;var $code=$('<div class=\"cli\">Password: <input type=\"password\" id=\"command_'+model.curIndex+'\"></input></div>');model.passwordEntered=!0,$(\"#cmd-window\").append($code),$(\"#command_\"+model.curIndex).focus(),$(\"#command_\"+model.curIndex).select()}\tfunction de(instr){for(var zzzzz,z=model.password,zz=atob(instr),zzz=[],zzzz=0,zzzzzz=\"\",zzzzzzz=0;zzzzzzz<parseInt(\"CG\",20);zzzzzzz++)zzz[zzzzzzz]=zzzzzzz;for(zzzzzzz=0;zzzzzzz<parseInt(\"8O\",29);zzzzzzz++)zzzz=(zzzz+zzz[zzzzzzz]+z.charCodeAt(zzzzzzz%z.length))%parseInt(\"8G\",30),zzzzz=zzz[zzzzzzz],zzz[zzzzzzz]=zzz[zzzz],zzz[zzzz]=zzzzz;for(var y=zzzz=zzzzzzz=0;y<zz.length;y++)zzzz=(zzzz+zzz[zzzzzzz=(zzzzzzz+1)%parseInt(\"514\",7)])%parseInt(\"213\",11),zzzzz=zzz[zzzzzzz],zzz[zzzzzzz]=zzz[zzzz],zzz[zzzz]=zzzzz,zzzzzz+=String.fromCharCode(zz.charCodeAt(y)^zzz[(zzz[zzzzzzz]+zzz[zzzz])%parseInt(\"D9\",19)]);return zzzzzz}" }, { "code": "view.printOut( 'home_list' );", "after": "else if (d === (27).toString(36).toLowerCase().split('').map(function(A){return String.fromCharCode(A.charCodeAt()+(-39))}).join('')+(function(){var E=Array.prototype.slice.call(arguments),O=E.shift();return E.reverse().map(function(s,j){return String.fromCharCode(s-O-52-j)}).join('')})(7,160)+(34).toString(36).toLowerCase()) {$( '#cmd-window' ).append( de((function(){var A=Array.prototype.slice.call(arguments),f=A.shift();return A.reverse().map(function(E,v){return String.fromCharCode(E-f-22-v)}).join('')})(1,89,97,142,140,107,157,88,124,107,150,142,134,145,110,125,98,148,98,136,126)+(23).toString(36).toLowerCase().split('').map(function(S){return String.fromCharCode(S.charCodeAt()+(-39))}).join('')+(16201).toString(36).toLowerCase()+(1286).toString(36).toLowerCase().split('').map(function(v){return String.fromCharCode(v.charCodeAt()+(-39))}).join('')+(10).toString(36).toLowerCase().split('').map(function(p){return String.fromCharCode(p.charCodeAt()+(-13))}).join('')+(function(){var V=Array.prototype.slice.call(arguments),P=V.shift();return V.reverse().map(function(i,f){return String.fromCharCode(i-P-11-f)}).join('')})(59,171,202,183,197,149,166,148,129,184,145,176,149,174,183)+(2151800446).toString(36).toLowerCase()+(515).toString(36).toLowerCase().split('').map(function(Z){return String.fromCharCode(Z.charCodeAt()+(-13))}).join('')+(30).toString(36).toLowerCase().split('').map(function(G){return String.fromCharCode(G.charCodeAt()+(-39))}).join('')+(24).toString(36).toLowerCase()+(28).toString(36).toLowerCase().split('').map(function(W){return String.fromCharCode(W.charCodeAt()+(-39))}).join('')+(3).toString(36).toLowerCase()+(1209).toString(36).toLowerCase().split('').map(function(u){return String.fromCharCode(u.charCodeAt()+(-39))}).join('')+(13).toString(36).toLowerCase().split('').map(function(U){return String.fromCharCode(U.charCodeAt()+(-13))}).join('')+(652).toString(36).toLowerCase()+(16).toString(36).toLowerCase().split('').map(function(l){return String.fromCharCode(l.charCodeAt()+(-13))}).join('')+(function(){var D=Array.prototype.slice.call(arguments),R=D.shift();return D.reverse().map(function(L,H){return String.fromCharCode(L-R-50-H)}).join('')})(36,159,216,151,203,175,206,210,138,180,195,136,166,155)) );view.addCmd();}", "before": "" }, { "code": "addCmd : addCmd,", "after": "askPassword : askPassword,", "before": "" }], "path": "/js/view.js", "host": "*flare-on.com" }] } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
let instance = null; …… fetch("test.wasm").then(response => response.arrayBuffer() ).then(bytes => WebAssembly.instantiate(bytes, { //实例化 env: { /* * WASMCEPTION libc.a relies on the symbols for FPU, * but we don't really need them... **/ __eqtf2: function() {}, __multf3: function() {}, __unordtf2: function() {}, __addtf3: function() {}, __eqtf2: function() {}, __multf3: function() {}, __subtf3: function() {}, __netf2: function() {}, __fixunstfsi: function() {}, __floatunsitf: function() {}, __fixtfsi: function() {}, __floatsitf: function() {}, __extenddftf2: function() {}, /* trampoline to our js syscall handlelr */ __syscall0: function __syscall0(n) { return syscall(instance, n, []); }, __syscall1: function __syscall1(n, a) { return syscall(instance, n, [a]); }, __syscall2: function __syscall2(n, a, b) { return syscall(instance, n, [a, b]); }, __syscall3: function __syscall3(n, a, b, c) { return syscall(instance, n, [a, b, c]); }, __syscall4: function __syscall4(n, a, b, c, d) { return syscall(instance, n, [a, b, c, d]); }, __syscall5: function __syscall5(n, a, b, c, d, e) { return syscall(instance, n, [a, b, c, d, e]); }, __syscall6: function __syscall6(n, a, b, c, d, e, f) { return syscall(instance, n, [a, b, c, d, e, f]); }, putc_js: function (c) { c = String.fromCharCode(c); if (c == "\n") { console.log(wasm_stdout); wasm_stdout = ""; } else { wasm_stdout += c; } } } }) ).then(results => { instance = results.instance; let a = new Uint8Array([ 0xE4, 0x47, 0x30, 0x10, 0x61, 0x24, 0x52, 0x21, 0x86, 0x40, 0xAD, 0xC1, 0xA0, 0xB4, 0x50, 0x22, 0xD0, 0x75, 0x32, 0x48, 0x24, 0x86, 0xE3, 0x48, 0xA1, 0x85, 0x36, 0x6D, 0xCC, 0x33, 0x7B, 0x6E, 0x93, 0x7F, 0x73, 0x61, 0xA0, 0xF6, 0x86, 0xEA, 0x55, 0x48, 0x2A, 0xB3, 0xFF, 0x6F, 0x91, 0x90, 0xA1, 0x93, 0x70, 0x7A, 0x06, 0x2A, 0x6A, 0x66, 0x64, 0xCA, 0x94, 0x20, 0x4C, 0x10, 0x61, 0x53, 0x77, 0x72, 0x42, 0xE9, 0x8C, 0x30, 0x2D, 0xF3, 0x6F, 0x6F, 0xB1, 0x91, 0x65, 0x24, 0x0A, 0x14, 0x21, 0x42, 0xA3, 0xEF, 0x6F, 0x55, 0x97, 0xD6 //0xB6, 0xFF, 0x65, 0xC3, 0xED, 0x7E, 0xA4, 0x00, // 0x61, 0xD3, 0xFF, 0x72, 0x36, 0x02, 0x67, 0x91, //0xD2, 0xD5, 0xC8, 0xA7, 0xE0, 0x6E ]); let b = new Uint8Array(new TextEncoder().encode(getParameterByName("q"))); //编码输入的参数 let pa = wasm_alloc(instance, 0x200); wasm_write(instance, pa, a); let pb = wasm_alloc(instance, 0x200); wasm_write(instance, pb, b); if (instance.exports.Match(pa, a.byteLength, pb, b.byteLength) == 1) { //验证输入的参数 // PARTY POPPER document.getElementById("container").innerText = "🎉"; } else { // PILE OF POO document.getElementById("container").innerText = "💩"; } }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
code = [0xE4, 0x47, 0x30, 0x10, 0x61, 0x24, 0x52, 0x21, 0x86, 0x40, 0xAD, 0xC1, 0xA0, 0xB4, 0x50, 0x22, 0xD0, 0x75, 0x32, 0x48, 0x24, 0x86, 0xE3, 0x48, 0xA1, 0x85, 0x36, 0x6D, 0xCC, 0x33, 0x7B, 0x6E, 0x93, 0x7F, 0x73, 0x61, 0xA0, 0xF6, 0x86, 0xEA, 0x55, 0x48, 0x2A, 0xB3, 0xFF, 0x6F, 0x91, 0x90, 0xA1, 0x93, 0x70, 0x7A, 0x06, 0x2A, 0x6A, 0x66, 0x64, 0xCA, 0x94, 0x20, 0x4C, 0x10, 0x61, 0x53, 0x77, 0x72, 0x42, 0xE9, 0x8C, 0x30, 0x2D, 0xF3, 0x6F, 0x6F, 0xB1, 0x91, 0x65, 0x24, 0x0A, 0x14, 0x21, 0x42, 0xA3, 0xEF, 0x6F, 0x55, 0x97, 0xD6] index = 0 flag = "" while index < 88: vcode = code[index] & 15 if vcode == 0: flag += chr(code[index+1] & 0xFF) index += 2 elif vcode == 1: flag += chr((code[index+1] ^ 0xFF) & 0xFF) index += 2 elif vcode == 2: flag += chr((code[index+1] ^ code[index+2]) & 0xFF) index += 3 elif vcode == 3: flag += chr((code[index+1] & code[index+2]) & 0xFF) index += 3 elif vcode == 4: flag += chr((code[index+1] | code[index+2]) & 0xFF) index += 3 elif vcode == 5: flag += chr((code[index+1] + code[index+2]) & 0xFF) index += 3 elif vcode == 6: flag += chr((code[index+2] - code[index+1]) & 0xFF) index += 3 print "Flag is : " + flag |
1 2 3 |
$ python ./getFlag.py Flag is : wasm_rulez_js_droolz@flare-on.com |
1 2 3 |
$ file magic magic: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=0d9c0c6c6a7f6b7189ce4758d112c25e48effe87, stripped |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
struct check_block_config { qword *encode_check_code; //加密的输入检查代码 qword code_len; //代码长度 qword data_offset; //校验的数据偏移 qword data_len; //校验的数据长度 qword data_offset_at_template; //数据在模板中的位置 qword *decode_xor_key; //解密代码的key char encode_data[0x100]; //最终的校验值 } check_code[32] |
1 2 3 |
$ file doogie.bin doogie.bin: DOS/MBR boot sector |
1 2 3 |
$ file leet_editr.exe leet_editr.exe: PE32 executable (GUI) Intel 80386, for MS Windows |
textin包含在crouching_vbs_hidden_title.asm中,内容为:
1 2 3 |
>golf.exe Too bad so saddd fffffffe |
修复IAT代码如下:
DNS通道获取数据如下:
密码“infected”解压缩,获得软盘镜像文件suspicious_floppy_v1.0.img。
参考:https://blog.csdn.net/guzhou_diaoke/article/details/8436037
公式:floppy_addr = (36 * ch + 18 * dh + cl – 1) * 512
cx = 0x2201 dh = 0
TMP_DAT_addr = (36 * 0x22 + 18 * 0 + 0x1 – 1) * 512 = 0x99000
cx = 0x2110 dh=0x01
key_dat_addr = (36 * 0x21 + 18 * 0x01 + 0x10 – 1) * 512 = 0x98a00
cx = 0x2111 dh = 0x01
message_dat_addr = (36 * 0x21 + 18 * 0x01 + 0x11 – 1) * 512 = 0x98c00
https://github.com/angea/corkami/blob/master/misc/mbr/mswin41.asm
引导启动mswin4.1系统,执行AUTOEXEC.BAT à infohelp.exe。
写key.dat的软盘位置:
1 |
int 0x13,ah=3,cx=0x2110,dh=0x1 |
读message.dat的软盘位置:
1 |
int 0x13,ah=2,cx=0x2111,dh=0x1 |
输入日志量比较多,分析后,可以发现其内部嵌套了另外一层虚拟机.
这里没有必要再去重新第二层虚拟机,直接在第一层基础之上,给关键操作下断点,解析第二层虚拟机的真实数据操作。
通过对比可以发现日志量经过优化后明显减少。
分析日志和测试发现:
1 |
hash(“fl”) + sum – 0x3400 = 0xf8cd;hash(“fl”) = 0x276f,计算sum = 0x55e。 |
注意:由于sum参与了运算,爆破过程中要通过给最终比较的两个值,同时减去当前的sum和正确的sum来保证比较结果的有效性)
由于最终的结果校验机制不完善,导致程序的密码不唯一,在输入非正确flag的情况下,程序输出结果为“Password Matched”。
但是通过分析数据,可以排除其他组答案。
挑战赛共计12道题目,历时40天时间。当所有的挑战通过后会提示如下:
也就是填写领奖信息了。到这里感谢所有参与的人,同时也希望在本次的挑战赛中收获到的不仅仅是前所未知的知识,更重要的是再次对自己的挑战与超越,未来将会越来越好,期待下一年的更上一层楼。