Author Topic: Batch to Exe tool  (Read 1869 times)

0 Members and 1 Guest are viewing this topic.

Online Kulverstukas

  • Administrator
  • 0x13338
  • *
  • Posts: 1928
  • Karma: +113/-10
  • Gender: Male
  • Delphi coder (and proud)
    • View Profile
    • My blog
Batch to Exe tool
« on: October 29, 2011, 03:05:29 AM »
A tool that will convert your Batch file into an executable file. This way the source cannot be viewed. Application also has a "Ghost" option, which means that your Executable will not have a popping window and will be completely silent.

Download: http://upload.evilzone.org/download.php?id=276973&type=rar

Online theellimist

  • Short
  • ***
  • Posts: 222
  • Karma: +10/-0
    • View Profile
    • TheEllimist's Game
Re: Batch to Exe tool
« Reply #1 on: October 29, 2011, 05:37:11 AM »
Interesting, I am looking forward to testing this out. Thanks for the upload.

Online Huntondoom

  • 0x13338
  • ******
  • Posts: 828
  • Karma: +18/-0
  • Gender: Male
  • Visual C# programmer
    • View Profile
Re: Batch to Exe tool
« Reply #2 on: October 29, 2011, 11:49:44 AM »
thanks for the great share!
Aslong as you are connected to the internet, you'll have no privacy

Advanced Internet Search
Clean Up!

Offline iAmLuFFy

  • Long
  • ****
  • Posts: 231
  • Karma: +11/-6
  • i aM MoDiFiEr nOt A cReAtOr
    • View Profile
Re: Batch to Exe tool
« Reply #3 on: October 29, 2011, 12:12:58 PM »
ya i have used this some days ago and one more advantage is that antivirus is also not detecting it as virus.
iAmLuFFy

Online Factionwars

  • Administrator
  • 0x13338
  • *
  • Posts: 1039
  • Karma: +44/-2
    • View Profile
Re: Batch to Exe tool
« Reply #4 on: October 29, 2011, 07:16:27 PM »
Ahhh this stuff remembers me of the old school days, writing a virus in batch :D.

Online ca0s

  • VIP
  • Long
  • *
  • Posts: 263
  • Karma: +28/-1
  • Gender: Male
  • ca0s@ka0labs #
    • View Profile
    • { st4ck~3rr0r }
Re: Batch to Exe tool
« Reply #5 on: October 29, 2011, 08:37:51 PM »
It is like having an embeded batch source code which is copied to %tmp% and then executed?

Offline bubzuru

  • Int
  • **
  • Posts: 147
  • Karma: +6/-0
  • everything is contained in the data
    • View Profile
    • New School Tools
Re: Batch to Exe tool
« Reply #6 on: October 30, 2011, 03:29:20 PM »
It is like having an embeded batch source code which is copied to %tmp% and then executed?

i think so
how else would it work ?

not looked at the tool,
can it dump files with the batch script ? (would be usefull if your script uses external files)
Damm it feels good to be gangsta
http://bubzuru.comule.com

Online Kulverstukas

  • Administrator
  • 0x13338
  • *
  • Posts: 1928
  • Karma: +113/-10
  • Gender: Male
  • Delphi coder (and proud)
    • View Profile
    • My blog
Re: Batch to Exe tool
« Reply #7 on: October 30, 2011, 04:37:21 PM »
i think so
how else would it work ?

not looked at the tool,
can it dump files with the batch script ? (would be usefull if your script uses external files)
Don't think so.

Offline bubzuru

  • Int
  • **
  • Posts: 147
  • Karma: +6/-0
  • everything is contained in the data
    • View Profile
    • New School Tools
Re: Batch to Exe tool
« Reply #8 on: October 30, 2011, 05:35:21 PM »
Don't think so.

looks like it could be easy to code
..... added to ideas file
Damm it feels good to be gangsta
http://bubzuru.comule.com

Offline xzid

  • VIP
  • Long[]
  • *
  • Posts: 304
  • Karma: +37/-4
    • View Profile
Re: Batch to Exe tool
« Reply #9 on: October 30, 2011, 08:15:58 PM »
i think so
how else would it work ?

Would be easiest/reliable method, but not the only one.

You could pipe everything to cmd.exe, although would need to be written in command prompt style, not batch:

Code: [Select]
C:\>TYPE test.bat
@ECHO OFF
FOR /F "tokens=*" %%i IN (test.bat) DO ECHO.-- %%i

C:\>test.bat
-- @ECHO OFF
-- FOR /F "tokens=*" %%i IN (test.bat) DO ECHO.-- %%i

C:\>TYPE test.bat | CMD /K
C:\>@ECHO OFF
FOR /F "tokens=*" %%i IN (test.bat) DO ECHO.-- %%i

C:\>:: doesn't work, edit
C:\>TYPE test.bat
@ECHO OFF
FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i

C:\>test.bat
i was unexpected at this time.

C:\>TYPE test.bat | CMD /K
C:\>@ECHO OFF
FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i
-- @ECHO OFF
-- FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i

Although labels would become tricky, especially use of :EOF. 20 lines of C code could do this.

You could also turn each newline into an & then run it:

Code: [Select]
C:\>CMD /C @ECHO OFF&FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i
C:\>ECHO.-- @ECHO OFF
-- @ECHO OFF
C:\>ECHO.-- FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i
-- FOR /F "tokens=*" %i IN (test.bat) DO ECHO.-- %i

Although a simple rem, label, etc.. would break it. Probably many more methods to do this.

Note about piping, that DEFCON video & powershell:

Code: [Select]
PS C:\> '"HAI"' > my_script.ps1
PS C:\> . .\my_script.ps1
File C:\my_script.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-hel
p about_signing" for more details.
At line:1 char:2
+ . <<<<  .\my_script.ps1
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

--- from cmd prompt ---
C:\>echo Set-ExecutionPolicy UnRestricted | powershell -NonInteractive -NoProfile -C "$input | % { Invoke-Expression $_ }"

--- back to powershell ---
PS C:\> . .\my_script.ps1
HAI

--- back to cmd prompt ---
C:\>powershell -NonInteractive -NoProfile -C ". .\my_script.ps1"
HAI

That seems kinda fucked up.. and makes "Set-ExecutionPolicy" pointless, if not then << $input | % { Invoke-Expression $_ } >> can eval most things.
 
batch just got hella powerful on win7, 08r2

Online Kulverstukas

  • Administrator
  • 0x13338
  • *
  • Posts: 1928
  • Karma: +113/-10
  • Gender: Male
  • Delphi coder (and proud)
    • View Profile
    • My blog
Re: Batch to Exe tool
« Reply #10 on: October 30, 2011, 09:19:38 PM »
Let's make a real batch compiler, that would not wrap around the original batch, but would analyze and compile the instructions in some language. The hardest part would probably be to convert from Batch to some language before compilation.

Online ca0s

  • VIP
  • Long
  • *
  • Posts: 263
  • Karma: +28/-1
  • Gender: Male
  • ca0s@ka0labs #
    • View Profile
    • { st4ck~3rr0r }
Re: Batch to Exe tool
« Reply #11 on: October 30, 2011, 09:22:40 PM »
It hink another option would be this http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx opening cmd.exe

Oh, while posting Kulverstukas posted.
That would be hard. We would have to write a "batch parser" and then generate asm code. Because what you said aboout converting it to another language would require that language's compiler to compile it. Nah, I was thinking in the "in-victim's-machine-pc" exe generation way. What you said is OK.
« Last Edit: October 30, 2011, 09:25:23 PM by ca0s »

Offline bubzuru

  • Int
  • **
  • Posts: 147
  • Karma: +6/-0
  • everything is contained in the data
    • View Profile
    • New School Tools
Re: Batch to Exe tool
« Reply #12 on: October 30, 2011, 09:24:09 PM »
Let's make a real batch compiler, that would not wrap around the original batch, but would analyze and compile the instructions in some language. The hardest part would probably be to convert from Batch to some language before compilation.

read xzids post again
there are a few ways to do it (piping, etc)
no need to convert to new language , that sounds stupid

and xzid did you like that video ?? i thought it was very informative , Set-ExecutionPolicy wernt ment as a securety feture

widows finaly has a decent shell :)
« Last Edit: October 30, 2011, 09:25:51 PM by bubzuru »
Damm it feels good to be gangsta
http://bubzuru.comule.com

Offline xzid

  • VIP
  • Long[]
  • *
  • Posts: 304
  • Karma: +37/-4
    • View Profile
Re: Batch to Exe tool
« Reply #13 on: October 30, 2011, 09:39:44 PM »
@ca0s: what I meant by piping/20 lines of C. He went over that but I always condense as much as possible, maybe 40 lines is more realistic.

@kulv: In sorta relation, not compile but if you were to port/modify the cmd.exe interpreter from the WINE project to windows(that's a weird thought) you may be able to make an exe with it's own built-in batch interpreter(maybe).

@bubz: was interesting, ran on kinda long so only watched about half. I always assumed if they put in a feature like that into powershell, it would actually require some work to bypass. :-\

Online Kulverstukas

  • Administrator
  • 0x13338
  • *
  • Posts: 1928
  • Karma: +113/-10
  • Gender: Male
  • Delphi coder (and proud)
    • View Profile
    • My blog
Re: Batch to Exe tool
« Reply #14 on: October 31, 2011, 09:48:15 AM »
Well I only now noticed the website at the bottom of the program. Seems that there is a newer version now, which has a lot more features, and I think it also can include some files.

http://www.f2ko.de/programs.php?lang=en&pid=b2e

 



Intern0t SoldierX py1337 SecurityOverride programisiai
Want to be here? Contact Ande or Satan911 on the forum or at IRC.