# Override Commands With Batch Files



## cyberia.in (Jun 13, 2005)

In one of my earliest articles, Batch File Tricks, i described a trick using batch files that enables you to override commands.

The basics of it's functioning are simple,  since .COM , .BAT and .EXE files can be executed (run) without the need for extensions. During some trials, i noticed that batch files (.BAT) were given preference to .COM and .EXE files in [strong]MS-DOS 6.0 and below, and also in the ms-dos prompt in windows 98 and before[/strong], so i thought if using this in other ways was possible. I was right. Few minutes later, i created my first "maliicious" code ever, altough it was more funny than malicious now that i look back on it. So i created a file called [strong]edit.bat[/strong] . 

For those of you who know these computing basics, the edit command is used in DOS to create or change files in a simple text editor, and the edit command's default file is [strong]edit.com[/strong] but as i've mentioned, i had noticed earlier, .BAT files we're executed before .COM files, i created a file edit.bat and inserted into it the following code -


@ECHO OFF
ECHO DOS HAS ENCOUNTERED A SERIOUS ERROR AND WILL NOW SHUT DOWN, PRESS ANY KEY TO TERMINATE...
PAUSE
EXIT

Explaining this line by line, Line 1 and 2 are irrelevant, they are used only to display messages. Line 3 (PAUSE) causes everthing to wait until a user pushes any button and when he pushes it, Line 4 (EXIT) is executed and DOS is shut down and you're returned to windows. Similarly, i created other files as well, like cls.bat , del.bat , deltree.bat , and format.bat .Also, you can program these files to do other things than just exit DOS, more malicious stuff like formatting the computer, etc...

This only works in the directory in which you put the batch files. For best effect, put it in as many directories as possible.

Source - (My own so if you've read this, don't call it a rip-off), and yes, if the mods deem this as advertising please inform me and i will no longer post the source.

*www.cyberia.in/?p=93


----------



## cyberia.in (Jun 13, 2005)

the format.bat implementation proves that this can be used for good purposes also by blocking the format code.

Of course, you can also block the delete command


----------



## cheetah (Jun 13, 2005)

I still remember Ankit Fadi's Batch file tutorial......Frm his Ethical Hacking book and online version is also available on astalavista...it ws pretty gud..


----------



## cyberia.in (Jun 13, 2005)

I've read ankit fadia's batch file tutorial, and i'll assure you it's not from there. I found this myself as i've mentioned above, altough it was soething sitting there waiting to be discovered, so the chances of somebody having found this before me are actually quite high but i don't know...


----------



## cyberia.in (Jun 21, 2005)

Article Compiled and Extended. Features of Version 1.0

- Functioning Explained
- How to Apply Trick to all Directories (Including Windows XP) (NEW)
-PDF Format

Download NOW

*rapidshare.de/files/2518775/Batch_File_Tricks.pdf.html


----------



## cyberia.in (Jun 21, 2005)

Version 1.1 with direct registry integration for system variables included

*www.archive.org/download/Batch_Fil...h_Files_Version_1.1/Batch_File_Tricks_1.1.pdf


----------

