Hack Like an Elite: Batch Scripting for Malicious Purposes: PART 1 (The Basics)

May 17, 2015 07:21 AM
Oct 3, 2015 09:15 AM
Article cover image

Hi there, Crackers,

Welcome to my 7th post (Part-1), this tutorial will explain about the basics of Batch Scripting.

Why Batch?

Batch is a really easy and interesting scripting language, it is used for malicious purposes, i.e. how can you exploit the victim's PC/life, further, after hacking into his PC.(This can also be used for hacking too, I'll explain that later)

Batch or Bash?

It is Batch not Bash, however they are quite similar. But Batch is a lot more easier to understand.

Basics:

Let us make a simple batch script:

----------------------

@echo off

echo Hi there?

echo Everything fine?

pause

exit


---------------------

OUTPUT:

635674167338945938.jpg

Save it as anything.bat (.bat extension is important ) an run it.

Meanings:

1) @echo off: This command should be at the top(/header) of the script, it actually removes the trash/repeated command lines. Try to run the program again without this line and then you will understand.

2) echo: It echos/displays anything written in front of it (In simple words)

3) pause: It inserts a pause in the script (This: Click any key to continue...), If it is not in the script then, The window will exit without you, being able to see anything.

4)exit: Exits the script/Terminates the script/Closes the Command window.

More Basics:

Some more commands:

5) md:Make directory (Make a folder)

EG: md qwerty (this will make a folder named qwerty)

6) cd:Change directory

Another Script:(Copied from somewhere, easy to make)

-----------------------------------

@echo off

:menu

title MenuMaker V0.1

color 06

cls

echo.

echo.

echo Menu Tester...

echo Type 1 for fun!

echo Type 2 for a bun!

set /p choice=

If %choice% EQU 1 goto fun

If %choice% EQU 2 goto bun

:fun

title !!!Fun!!!

color 08

cls

echo !!!FUN!!!

echo NO FUN HERE!

pause

goto :menu

:bun

title !!!Bun!!!

color 08

cls

echo !!!Bun!!!

echo No bun here...

pause

goto :menu


---------------------------- (Save as anything.bat , run it)

OUTPUT:

635674167846133257.jpg
635674168028632552.jpg
635674168202226361.jpg
635674167846133257.jpg
635674168028632552.jpg
635674168202226361.jpg

7) :something: This is used give an address, a location name to a part of the script.

Eg: :A , :abcd , :p , :anything etc

8) goto: This command is used for loops, when we specify a location name after the goto command, the script loops itself to that location.

Eg: In this script, goto :menu tells the running script that return to start of the script where :menu has been used.

9)echo.: Gives a line break (Enter)

10)color: This command is used to give color to the display of the script. A 2 digit code is used, the first digit is for background color and the 2nd digit is for text color. (Use color -y command in cmd for help)

635674169499569738.jpg

11) set /p : It is used to set a variable to accept some values which we input.

Eg: If we set, lets say, a=1, then the value of a will remain 1, until the end of the script.

We can display its value by typing: echo %a%.

(It will display value of a instead of the variable a )

12)If %choice% EQU 1 goto fun:

A complicated one:

What this does is:

If the value of "choice" is 1 then goto the location :fun

If the value of "choice" is 2 then goto the location :bun

("choice" is nothing, it is just a simple variable)

The value depends on what you have entered.

13)title:Just changes the title of the window.

14)cls: Removes trash and clears the screen.

The Advanced Has Yet to Arrive...

These were just basics of Batch Scripting...

You need to have this knowledge to move to the advanced section and create malware and then upload it using kali.

I'll show you each and every step of the exploitation, but for now Goodbye!

And remember to keep coming back for the Next PARTS!

Thank You!

F.E.A.R.

Just updated your iPhone? You'll find new Apple Intelligence capabilities, sudoku puzzles, Camera Control enhancements, volume control limits, layered Voice Memo recordings, and other useful features. Find out what's new and changed on your iPhone with the iOS 18.2 update.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!