Skip to content

Instantly share code, notes, and snippets.

@bruce30262
Created September 1, 2018 09:44
Show Gist options
  • Save bruce30262/f46a04ceaf011c90e38b6175bbbd5d06 to your computer and use it in GitHub Desktop.
Save bruce30262/f46a04ceaf011c90e38b6175bbbd5d06 to your computer and use it in GitHub Desktop.
[flareon2018 level9] dump.vbs
' _a,
' _W#m,
' _Wmmmm/
'BmmBmmBmm[ Bmm a#mmmmmB/ BmmBmmBm6a 3BmmBmmBm
'mmm[ mmm j##mmmmmmm6 mmm -4mm[ 3mm[
'mBmLaaaa, Bmm JW#mmP 4mmmmL mmBaaaa#mm' 3Bm6aaaa,
'mmmP!!"?' mmm JWmmmP 4mmmBL Bmm!4X##" 3mmP????'
'Bmm[ Bmmaaaaa jWmmm? 4mmmBL mmm !##L, 3BmLaasaa
'mmm[ mmm##Z#Z _jWmmmmaaaaaa,]mBmm6. mmB "#Bm/ 3mmm#UZ#Z
' _WBmmmmm#Z#Z#! "mmmBm,
' ??!??#mmmm#! "??!??
' .JmmmP'
' _jmmP'
' _JW?'
' "?
Dim Page(118)
Page(0) = "<!doctype html>"
Page(1) = "<html>"
Page(2) = "<head>"
Page(3) = "<title>Crypto-Donkeys' ASCII Art Editor!!1</title>"
Page(4) = "<style>"
Page(5) = " body {"
Page(6) = " background-color: black;"
Page(7) = " color: white;"
Page(8) = " font-family: monospace;"
Page(9) = " }"
Page(10) = " textarea {"
Page(11) = " background-color: black;"
Page(12) = " color: #33ff33;"
Page(13) = " }"
Page(14) = " marquee {"
Page(15) = " background-color: #33ff33;"
Page(16) = " color: black;"
Page(17) = " font-weight: bold;"
Page(18) = " }"
Page(19) = " .hidden {"
Page(20) = " display: none;"
Page(21) = " }"
Page(22) = "</style>"
Page(23) = "<script language='JavaScript'>"
Page(24) = "function hint(s) {"
Page(25) = " document.getElementById('status').innerText = 'You\'re on to something!' + s"
Page(26) = "}"
Page(27) = ""
Page(28) = "function strhash2(s) {"
Page(29) = " // Adapted from:"
Page(30) = " // https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery"
Page(31) = " var hash = 0, i, c;"
Page(32) = " for (i=0; i<s.length; i++) {"
Page(33) = " c = s.charCodeAt(i);"
Page(34) = " hash = ((hash << 5) - hash) + c;"
Page(35) = " hash |= 0;"
Page(36) = " }"
Page(37) = " return hash;"
Page(38) = "}"
Page(39) = ""
Page(40) = "function strhash(s) {"
Page(41) = " // Adapted from:"
Page(42) = " // https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery"
Page(43) = " var hash = 0, i, c;"
Page(44) = " s = s.replace(/\s+/g, '')"
Page(45) = " for (i=0; i<s.length; i++) {"
Page(46) = " c = s.charCodeAt(i);"
Page(47) = " hash = ((hash << 5) - hash) + c;"
Page(48) = " hash |= 0;"
Page(49) = " }"
Page(50) = " return hash;"
Page(51) = "}"
Page(52) = "</script>"
Page(53) = "</head>"
Page(54) = "<body>"
Page(55) = "<center>"
Page(56) = "<!-- When will they really-really retire this?? Well, in the meantime, I'll have my fun... -->"
Page(57) = "<marquee>.-'-.-'-.-=&lt;[ Crypto-Donkeys' ASCII Art Editor ]&gt;=-'-.-'-.-'</marquee>"
Page(58) = "<div>(Note: optimized for IE11)</div>"
Page(59) = "<div id=""status"">Status</div>"
Page(60) = "<!-- Adapted (condensed) from http://textfiles.com/occult/BOB/bobface.txt -->"
Page(61) = "<div><textarea rows='50' cols='80' id='textin'>"
Page(62) = " .$$$$$$$$$$$$$$$$$$$$$$$$. "
Page(63) = " $$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$"
Page(64) = " $$$$$$$$$$$$$$ $$$$$$$ $$ $ $$$$"
Page(65) = " $$$$$$$$$$$ $$ $$$ $$ $ $ $$$$"
Page(66) = " $$$$%$$$ $ $ $$ $$$ $ $ $$ $ $$"
Page(67) = " $$$$%%$$$ $ $ $$ $$$ $ $$ $ $ $$$"
Page(68) = " $$$$$%%$$$$ $ $ $ $$ $ $$$ $ $$ $$$$"
Page(69) = " $$$$$%%%$$$$$ $$$$ $ $ $$ $ $$$$$ $$ $$$$$"
Page(70) = " $$$$$$%%%$$$$$$$$$$$ $$ $ $$$$ $ $$$$$$$$$$$$$$$$"
Page(71) = " $$$$$$%%%$$$$$$$$$$$$$$$ $$$$$$ $$$$$$$$$$$$$$$$$$$"
Page(72) = " $$$$$$%%$$%%%%%%%%%$$$$$$$$$$$$$ $$$$$$$ $$$$%$$$"
Page(73) = " $$$$$$%$$%%%%%%%%%%%$$$$$$$$$$$$$$$$$ $$$$%%$$$"
Page(74) = " $$$$$$$%%% $$$$$$$$ $$$%%$$$"
Page(75) = " $$$$$%%%% % $$$%%$$"
Page(76) = " $$$$$%%%% %% $$$%$$"
Page(77) = " $$$$$%%%% %%% $$$%$$"
Page(78) = " $$$$$%%%% %% $$$%$$"
Page(79) = " $ $$$%%%% $$$$$$$$$ $$$$$$$$$%% $$$$$$$"
Page(80) = " $$$ $$%%% $$$$$$$$$$ $$$$$$$$$$$%% $$$$$$"
Page(81) = " $$$$$$%%% $$$$$ $$$$ $$$$$$$$$$ $%% $$$$$$"
Page(82) = " $$$$ %%% $$$ $$$$$ $$$$$$ $$$ %%% $$$$$"
Page(83) = " $$$$ $$$ $ $$ $$$$ $$$$$$ $ $ $$ $$$$"
Page(84) = " $$$$ $ $$$ %%%$$$ %% $$$ $$$$"
Page(85) = " $$$$ %%% %%%%% $ %%%%%%% $$$$"
Page(86) = " $ $$ $ $ $"
Page(87) = " $ $$ $ %$ $$ $"
Page(88) = " $$$ $$ $ %%% $ $ $$"
Page(89) = " $$ $$ $ %%%% $ $$$ $$ $"
Page(90) = " $ $$$ $$ %%%$$$ $$$$ $$$$ $$$$ $"
Page(91) = " $$$$$$$$$$ $$$$$$$$$$$$$$ $$$$$$$$$ $"
Page(92) = " $$$$$$ %%$$$$$$$$$$$$$$ $$$$$$$$$$$$$$"
Page(93) = " $$$ $$ %$$$$$$$$$$ $$$$$$$$$ $$$$"
Page(94) = " $$ $ %$$$$ $$ $$$$"
Page(95) = " $ $ %%%%$$$ $$$$$$$$$$$$$ $$$"
Page(96) = " $$ $$ %%$$$$ $$$$$$$$$$ $$$"
Page(97) = " $ $ $$$$$%%%%%%%%%% $$$$"
Page(98) = " $ $ $$$$ %%%%%%%%%%%%%% $$$"
Page(99) = " $$$ $ $$$$ $%%%% $$$"
Page(100) = " $$ $$ $$$$$ $$$$ $$$"
Page(101) = " $ $$ $$ $$$$$$ $$$ $$$"
Page(102) = " $ $$$$ $$ $$$$$$ $$$$ $$$"
Page(103) = " $ $$$ _$$$ $$$$$$ $$$$$$$ $$$"
Page(104) = " $ .' $$$$$$$$ $$$$$$$$$$$$$$$ $$$"
Page(105) = " $$$$$ $$$$$$$ $$$$$$$$$$$$$$$$$$"
Page(106) = " $$$$$ $$$$"
Page(107) = " $$$$$$ $$$"
Page(108) = " $$$$$ $$$"
Page(109) = " '$$$$$$'"
Page(110) = ""
Page(111) = " Draw me like one of your French girls :-D"
Page(112) = "</textarea></div>"
Page(113) = "<div><textarea rows='1' cols='80' id='title'>Untitled</textarea></div>"
Page(114) = "<marquee direction='right'>.-'-.-'-.-=&lt;[ Crypto-Donkeys ASCII Art Editor ]&gt;=-'-.-'-.-'</marquee>"
Page(115) = "</center>"
Page(116) = "</body>"
Page(117) = "</html>"
Function hai(base64)'b64decode
Dim dom, el
Const adTypeBinary = 1
Const adTypeText = 2
Set dom = CreateObject("Microsoft.XMLDOM")
Set el = dom.createElement("tmp")
el.dataType = "bin.base64"
el.text = base64
bin = el.nodeTypedValue
Set stream = CreateObject("ADODB.Stream")
stream.Type = adTypeBinary
stream.Open
stream.Write bin
stream.Position = 0
stream.Type = adTypeText
stream.CharSet = "windows-1252"
hai = stream.ReadText
End Function
Function oh(msg, key)' RC4
Dim S(256)
Dim klen
Dim i, j, tmp
Dim n
Dim k
klen = Len(key)
For i = 0 To 255
S(i) = i
Next
j = 0
For i = 0 To 255
j = (j + S(i) + Asc(Mid(key, 1 + (i Mod klen))) ) Mod 256
tmp = S(i)
S(i) = S(j)
S(j) = tmp
Next
i = 0
j = 0
oh = ""
For n = 0 To (Len(msg) - 1)
i = (i + 1) Mod 256
j = (j + S(i)) Mod 256
tmp = S(i)
S(i) = S(j)
S(j) = tmp
k = S((S(i) + S(j)) Mod 256)
oh = oh & Chr(Asc(Mid(msg, n + 1, 1)) Xor k)
Next
End Function
Function SnoopyDoopyDoooooooooo()' sleep
SnoopyDoopyDoooooooooo = fso.GetSpecialFolder(250)
End Function
Function PetMeLikeATurtle()
Call execute(oh(hai(fso.CreateTextFile("WimmyMeBrah", "sn00gle-fl00gle-p00dlekins")), "yummy"))
Call oSh.Run(PetMeLikeATurtle)
End Function
Sub initMe(oIe)
oIe.Visible = True
oIe.Navigate("about:blank")
While oIe.Busy
Call SnoopyDoopyDoooooooooo()' sleep
Wend
For i = 0 To Ubound(Page) - 1
oIe.document.WriteLn(Page(i))
Next
code = "g_interval = setInterval(function(){ if ((textin.value.indexOf('j##mmmmmmm6') != -1) && (strhash(textin.value) == 1164071950)) { hint(' - But did you think of a title for your masterpiece?'); textin.style.color = '#5ccfe6'; clearInterval(g_interval); } }, 2500)"
oIe.document.parentwindow.execScript(code)
Call SnoopyDoopyDoooooooooo()
Set sh = CreateObject("WScript.Shell")
For Each oProc In GetObject("winmgmts:").ExecQuery("SELECT ProcessId FROM Win32_Process WHERE Caption = 'iexplore.exe'")
Call sh.AppActivate(oProc.ProcessId)
Next
Call SnoopyDoopyDoooooooooo()
Active = False
Attempts = 0
While Not Active And Attempts < 3
Active = sh.AppActivate("Crypto-Donkeys")
Call SnoopyDoopyDoooooooooo()
Attempts = Attempts + 1
Wend
End Sub
Function CheckIeStatus(ie)
CheckIeStatus = False
Call Err.Clear()
On Error Resume Next
CheckIeStatus = ie.document.getElementById("status").innerText
If Err.Number <> 0 Then
Call Err.Clear()
End If
On Error Goto 0
End Function
Sub Main()
Dim oIe
happy = PetMeLikeATurtle()
If Not happy Then
Set oIe = CreateObject("InternetExplorer.Application")
initMe(oIe)
ascii = ""
still_running = True
Do While still_running And Not happy
SnoopyDoopyDoooooooooo()
status = CheckIeStatus(oIe)
If status = False Then
still_running = False
ElseIf status <> "Status" Then
code = "g_interval2 = setInterval(function(){ if ((title.value.indexOf('title') != -1) && (title.value.indexOf('FLARE') != -1) && (strhash(title.value) == -1497458761)) { hint(' - That\'s a nice title!'); clearInterval(g_interval2); } }, 2500)"
' BTW, how is this VBScript even executing? Hey! Maybe if you
' knew that, it would give you some inspiration for a really
' neat title!
oIe.document.parentwindow.execScript(code)
ascii = oIe.document.getElementById("textin").value
Exit Do
End If
happy = PetMeLikeATurtle()
Loop
End If
title = ""
still_running = True
Do While still_running And Not happy
SnoopyDoopyDoooooooooo()
status = CheckIeStatus(oIe)
If status = False Then
still_running = False
ElseIf InStr(status, "nice") > 0 Then
title = oIe.document.getElementById("title").value
Exit Do
End If
happy = PetMeLikeATurtle()
Loop
If still_running And Not happy Then
key = ascii + title
oIe.document.body.innerHtml = poo.gimmeThatSweetSweetCrazyLove(key)
End If
End Sub
Main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment