Thursday, November 7, 2013

How To Hack: Execute BAT File in the Background Invisibly

What happens when you double-click on a BAT file? Or, you run the BAT file from your commandeered cmd prompt? It pops up and runs! Now, we can’t be having the user see this, can we? A hacker also sometimes need to hide their script in the background, because they don’t want the victim become suspicious if something popped out in their window, since any command prompt window will be visible until the .BAT/.CMD file execution is complete.
Requirement:

Notepad or any other text editor

How to Invisibly Execute BAT File in the Background:
  1. Let’s say that I want to ping google.com by utilizing the batch file.
    ping www.google.com
    and then save as ping.bat
  2. When we double click the ping.bat we’ve just created, a command prompt window will pop up and start pinging google.com.InvisiBAT-1and the window will automatically close after the execution is complete.
  3. We will utilize Windows Script Host RUN method to invisibly execute the BAT file in the background. This is the script:
    Set WshShell = CreateObject(“WScript.Shell”)WshShell.Run chr(34) & “C:\ping.bat” & Chr(34), 0Set WshShell = Nothing
    Save the script as hidden.vbs with the .vbs extension.
    InvisiBAT-2
  4. I’ve modified the BAT script a little bit, because we need to check whether the script was successfully executed or not.
    ipconfig > result.txt
    all IP configuration result will be saved into result.txt file.
  5. When we execute the hidden.vbs, no window popped out and if our script was successfully executed in the background, in our folder location should have a new file result.txt contained with information about windows ip configuration.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.