kbnet
Trying to work out a way of executing a .bat file from the registry but it remains hidden. Executes ok but it runs the console window and you can see all the processes getting executed. Ive tried all types of redirection, non of which work.
Using the start command would be fantastic, because of the /B switch which allows the window to remain hidden, but because its a child process of cmd.exe you obviously see the console window.
Also, it cant be a .exe, otherwise we could do it easily, but this program will be built on systems on the fly.

There must be someway of executing the .bat file we've designed and let it remain hidden. Any kind of registry tweak we could do?

Any suggestions at all will be very much appreciated.

Cheers

crackie
You can use the hidden32.exe to hide this little window.
kbnet
we cant use third party tools 4 wot we need to do. cheers anyway
tstngry
- I may just have what you are looking for. Its is a program called Tebic. Tebic takes a .bat file, or any other file and makes it so that it executes hidden. You can make the .bat file into a .exe or you can take a .bat file and make it into a stealth .bat.

-Here is a the code for a .bat that i made that makes a test.txt and then exits.
CODE

MZ
             @                                      !L!This Ps a Winis Win 32 Bit only  
$           PE  L 90            4 0       _        @                                                                                                                                                                           code                            @  text     0     .                 @  .rsrc            0              @  
.shrink0}a@H ^Y8dO| nO:.shrink1>  ve^&)^8..^%}{"/wxeEHgk[in 2002x>  ve#% *+.׾/{-  ^>Դõȶѥ  
ʤG#4`"P”  *   ^  & w+xò fUé u
uwxPИ;Xu7] Åt=Eo3MM@Z .5Wv`@ jaoE  pbUSVW`1ݹEVIuhrS>=rxq;P ̋].}m7"a=?]93Ee_^[]yj}Xn7>}EcuEv݀2ks TB2?O|(lxQlo #Jtb1|#<l cp3dmHh*"
%dY d\ #ۋ
e`x;{Y잋vr؝uD%ƅ@׽6>8)?={#\e9a ` `;l`p|;Z*q1i p@ f~HM Bl#'T ,g=H:  )P.!]0xX"8DžL XXf,A;@vPxe#gKBwXfX- @cuŶJ C#=է隂~rnj4Mb^ZVRM4MNJ:62*4M4"
ifڦiº֦ij71 GL
lS 1fEζa #f -ik1}ؽlȲ%l`۝>I172ٳܼ@8o! @FNd홍<A*d^/1T^%
OrPP@)6} L,eld-K*E:l;{Ktb';1d67lC ]bXdXB@8E(JY83P7dH4>Ɛ!8,W0a~E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z$SR-p5wBt.FL ZHqW0Q0)O.KrM]a`8砱V?CbjaWa1F^%ct F
%/@@k G  .tmp2K MSPERTIC 3Yv W 5{-;kn<d{ 6?S@ج/ d`p q0psf9
r<ql3 M"qc s's0`ini
sM4$2@Pdv6M4s#$:iL\ijͲiu(u{g>Nr g#|UmtTADVA  V? T E B I C*"K f<aCloseHanjdlereateFileAdm7!oDekExit >Gm
rst'ONexlush Buffer;m۷eeEnv2onmentStr1gnGlCommLea(QSize TcypLaEr3r
MlodulQFartupInfo{`skViqbmoalAlc M߾TtiBy7ToWideChanR=lodSdOf
3
tb#juASn~SepTls =u SWaioR<S1=Object撵`„/NamNѤ60gOx/bnKey f[oG+ݡmNi
UO%&Saf[0fayqybLjZ Yl Zk6
opyPE  L 901O  4MgO  *!`@ gm{ ( |g4 3F.p>1_l3.t N w {#`.d}a}u'#R'@.link>p| iTrsrc)lOZ'@loHW8ÐB'Bqu   @     a@ RW FGur   usu s1Ƀr
Fttuuu Ausu s /vBGIucwL^  G,<w?u_f)ٍ   t<_0  P  Gt܉WHU   t  `m                                                                                                                                                                                                                                                                                                                                                93                `      93          8      93          P                  93        x      93                          T E B I C  (       @                                                                                                                                                                                                                                                                                                      @                                                 L                                    "          "           "            "            $                                                                   Z7Zefj$o" n "   n "   n "   n "   ?                          <                I  $              V  ,              `  4                      l  z                          KERNEL32.DLL ADVAPI32.DLL OLE32.DLL OLEAUT32.DLL  LoadLibraryA  GetProcAddress  ExitProcess   RegCloseKey   CoInitialize  VariantCopy          b;                                                                                                                                                                                                                                                                                                                  123.bat*****             (ټEh/.u}؁r
WU9Z)2}E>


-This probably wont work if you copy and paste it as a .bat, but i dont know i havent tried. I have attached tebic and the test.bat that i made. The useage for tebic is:
tebic.exe filetostealth.bat, ,nametoextractas.bat, ,stealthbatname.bat

-For example to make the test batch file i have included called test.bat i used the command.
tebic.exe test.bat, ,stealth.bat, ,123.bat
This will take test.bat and make stealth.bat. When you execute stealth.bat it will extract your original .bat file as 123.bat but hidden. The last file name is not important because it will be extracted and then delted when it is done executing.
-If you dont understand this tell me i will try to explain it better.
-BTW i dont know who made this program or where i got it from. Hope it is still ok to share.
heroin
Put this line in an txtfile, rename it to whatever.vbs

CODE
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


and run your bat with it from the commandline:

CODE
whatever.vbs mynonharmful.bat


your batfile gets "hidden" executed, no window will popup!

-h
Yorn
then, after making the .vbs file, use screnc.exe available from Microsoft to encrypt it, renaming the file to .vbe

That way your virusscan won't complain.

SkullSplitter
@Yorn

VBE decoder

Decode all files encoded with screnc.exe
This script give you a decoded listing from an encoded file.
Supports *,je, ,vbe, .asp, .hta, .htm, .html…
If used under cscript, puts the result to stdout.
The file can be multi-encoded (many scripts in the file, for ex. in an html file)
Used under wscript, pops up the decoded file in a message box.

File Name : decovbe.vbs
Requirement : none
Author : Jean-Luc Antoine
Submitted : 05/09/2001
Updated : 09/12/2001
Category : 4K

CODE

option explicit
Dim oArgs, NomFichier
'Optional argument : the encoded filename
NomFichier=""
Set oArgs = WScript.Arguments
Select Case oArgs.Count
Case 0 'No Arg, popup a dialog box to choose the file
NomFichier=BrowseForFolder("Choose an encoded file", &H4031, &H0011)
Case 1
If Instr(oArgs(0),"?")=0 Then '-? ou /? => aide
NomFichier=oArgs(0)
End If
Case Else
WScript.Echo "Too many parameters"
End Select
Set oArgs = Nothing

If NomFichier<>"" Then
Dim fso
Set fso=WScript.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(NomFichier) Then
Dim fic,contenu
Set fic = fso.OpenTextFile(NomFichier, 1)
Contenu=fic.readAll
fic.close
Set fic=Nothing

Const TagInit="#@~^" '#@~^awQAAA==
Const TagFin="==^#~@" '& chr(0)
Dim DebutCode, FinCode
Do
FinCode=0
DebutCode=Instr(Contenu,TagInit)
If DebutCode>0 Then
If (Instr(DebutCode,Contenu,"==")-DebutCode)=10 Then 'If "==" follows the tag
FinCode=Instr(DebutCode,Contenu,TagFin)
If FinCode>0 Then
Contenu=Left(Contenu,DebutCode-1) & _
Decode(Mid(Contenu,DebutCode+12,FinCode-DebutCode-12-6)) & _
Mid(Contenu,FinCode+6)
End If
End If
End If
Loop Until FinCode=0
WScript.Echo Contenu
Else
WScript.Echo Nomfichier & " not found"
End If
Set fso=Nothing
Else
WScript.Echo "Please give a filename"
WScript.Echo "Usage : " & wscript.fullname & " " & WScript.ScriptFullName & " <filename>"
End If

Function Decode(Chaine)
Dim se,i,c,j,index,ChaineTemp
Dim tDecode(127)
Const Combinaison="1231232332321323132311233213233211323231311231321323112331123132"

Set se=WSCript.CreateObject("Scripting.Encoder")
For i=9 to 127
tDecode(i)="JLA"
Next
For i=9 to 127
ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
For j=1 to 3
c=Asc(Mid(ChaineTemp,j,1))
tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1)
Next
Next
'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
Set se=Nothing

Chaine=Replace(Replace(Chaine,"@&",chr(10)),"@#",chr(13))
Chaine=Replace(Replace(Chaine,"@*",">"),"@!","<")
Chaine=Replace(Chaine,"@$","@")
index=-1
For i=1 to Len(Chaine)
c=asc(Mid(Chaine,i,1))
If c<128 Then index=index+1
If (c=9) or ((c>31) and (c<128)) Then
If (c<>60) and (c<>62) and (c<>64) Then
Chaine=Left(Chaine,i-1) & Mid(tDecode(c),Mid(Combinaison,(index mod 64)+1,1),1) & Mid(Chaine,i+1)
End If
End If
Next
Decode=Chaine
End Function

Function BrowseForFolder(ByVal pstrPrompt, ByVal pintBrowseType, ByVal pintLocation)
Dim ShellObject, pstrTempFolder, x
Set ShellObject=WScript.CreateObject("Shell.Application")
On Error Resume Next
Set pstrTempFolder=ShellObject.BrowseForFolder(&H0,pstrPrompt,pintBrowseType,pintLocation)
BrowseForFolder=pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path
If Err.Number<>0 Then BrowseForFolder=""
Set pstrTempFolder=Nothing
Set ShellObject=Nothing
End Function


Cheers

SkullSplitter

Edit: @Yorn, sorry, missunderstand your reply wink.gif .. but the decoder is fine biggrin.gif
heroin
never noticed a complain by kaspersky about this line in a vbscript. does other av-software identify it as an "harmful script"?

-h
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.