MsgBox "VBScript, often abbreviated as VBS, is an event-driven programming language developed by Microsoft, primarily used for scripting in the Windows environment." MsgBox "It is based on the Visual Basic programming language and is designed to be simple and easy to use, especially for those familiar with the BASIC programming language." MsgBox "And for me, it is the first programming language that I've leart" MsgBox "Hackers! Have fun with this VBS challenge!" flag = InputBox("Enter the FLAG:", "Hack for fun") wefbuwiue = "NalvN3hKExBtALBtInPtNHTnKJ80L3JtqxTboRA/MbF3LnT0L2zHL2SlqnPtJLAnFbIlL2SnFT8lpzFzA2JHrRTiNmT9"
qwfe = 9+2+2+1
Function Base64Decode(base64EncodedString) Dim xml, elem Set xml = CreateObject("MSXML2.DOMDocument") Set elem = xml.createElement("tmp") elem.dataType = "bin.base64" elem.text = base64EncodedString Dim stream Set stream = CreateObject("ADODB.Stream") stream.Type = 1'Binary stream.Open stream.Write elem.nodeTypedValue stream.Position = 0 stream.Type = 2'Text stream.Charset = "utf-8" Base64Decode = stream.ReadText stream.Close End Function Function Caesar(str,offset) Dim length,char,i Caesar = "" length = Len(str) For i = 1To length char = Mid(str,i,1) If char >= "A"And char <= "Z"Then char = Asc("A") + (Asc(char) - Asc("A") + offset) Mod26 Caesar = Caesar & Chr(char) ElseIf char >= "a"And char <= "z"Then char = Asc("a") + (Asc(char) - Asc("a") + offset) Mod26 Caesar = Caesar & Chr(char) Else Caesar = Caesar & char EndIf Next End Function
If flag = Base64Decode(Caesar(wefbuwiue, 26-qwfe)) Then MsgBox "Congratulations! Correct FLAG!" Else MsgBox "Wrong flag." EndIf
import base64 data = base64.b64decode(r"""ZXhlYyhiYXNlNjQuYjg1ZGVjb2RlKHIiIiJXcTQme0N9THJBV2l...""").decode() while"exec"in data: data = eval(data.replace('exec','')).decode() withopen('exec_source.py','wb') as f: f.write(data.encode())
a=True d=len G=list g=range s=next R=bytes o=input Y=print defl(S): i=0 j=0 while a: i=(i+1)%256 j=(j+S[i])%256 S[i],S[j]=S[j],S[i] K=S[(S[i]+S[j])%256] yield K defN(key,O): I=d(key) S=G(g(256)) j=0 for i in g(256): j=(j+S[i]+key[i%I])%256 S[i],S[j]=S[j],S[i] z=l(S) n=[] for k in O: n.append(k^s(z)+2) return R(n) defE(s,parts_num): Q=d(s.decode()) S=Q//parts_num u=Q%parts_num W=[] j=0 for i in g(parts_num): T=j+S if u>0: T+=1 u-=1 W.append(s[j:T]) j=T return W if __name__=='__main__': L=o('input the flag: >>> ').encode() assert d(L)%2==0,'flag length should be even' t=b'v3ry_s3cr3t_p@ssw0rd' O=E(L,2) U=[] for i in O: U.append(N(t,i).hex()) if U==['1796972c348bc4fe7a1930b833ff10a80ab281627731ab705dacacfef2e2804d74ab6bc19f60',2ea999141a8cc9e47975269340c177c726a8aa732953a66a6af183bcd9cec8464a']: Y('Congratulations! You got the flag!') else: Y('Wrong flag!')
a=True d=len G=list g=range s=next R=bytes o=input Y=print defl(S): i=0 j=0 while a: i=(i+1)%256 j=(j+S[i])%256 S[i],S[j]=S[j],S[i] K=S[(S[i]+S[j])%256] yield K defN(key,O): I=d(key) S=G(g(256)) j=0 for i in g(256): j=(j+S[i]+key[i%I])%256 S[i],S[j]=S[j],S[i] z=l(S) n=[] for k in O: n.append(k^s(z)+2) return R(n) defE(s,parts_num): Q=d(s.decode()) S=Q//parts_num u=Q%parts_num W=[] j=0 for i in g(parts_num): T=j+S if u>0: T+=1 u-=1 W.append(s[j:T]) j=T return W
defdecrypt(enc): key = b'v3ry_s3cr3t_p@ssw0rd' dec = N(key, enc) return dec if __name__=='__main__': enc1 = '1796972c348bc4fe7a1930b833ff10a80ab281627731ab705dacacfef2e2804d74ab6bc19f60' enc2 = '2ea999141a8cc9e47975269340c177c726a8aa732953a66a6af183bcd9cec8464a' flag1 = decrypt(bytes.fromhex(enc1)) flag2 = decrypt(bytes.fromhex(enc2)) flag = flag1 + flag2 Y(flag) #b'flag{thEn_I_Ca5_BE_YoUR_Onl7_ExeCUti6n_So_Use_m3_t0_R0n_tH17_Ex3Cuti0n}'