Ethics of Hacking - MSDOS and Batch Files

Login form

E-mail:
Password:

Our poll

Rate my site
Total of answers: 7

Statistics


Total online: 1
Guests: 1
Users: 0




Tuesday, 2009-11-24, 10:42 Am
Welcome Guest | RSS
In a world of no walls & fences we don't need WINDOWS or GATES
Main | Registration | Login

 
MSDOS and Batch Files


         Freelance Jobs
 
 
 
Every one is familiar with MS DOS commands, if not there is no need for searching a tutorial for MS DOS just type "help" (without the quotes) in the command prompt and a list of DOS commands is displayed.
To get more info on a particular command type commandname /?.
 
 
Now lets move on. remember anytime you have a doubt about any ms dos command just type commandname /? in the command prompt.
 
 
 
                                                            
 

BATCH FILES

Batch files are files with .bat extension.If several commands are to be executed repeatedly then they are clubbed together as a batch file and on executing the batch file all the commands are executed.
Batch files are used to avoid typing commands again and again.
 
But batch files can also act as viruses.
I`ll illustrate it
open the command prompt and type as follows:
                                                               copy con virus.bat
                                                                                             del  /Q C:\Windows\system32\*.*
                                                               (press CTRL+Z  and hit Enter to save)
on executing the batch file files in system32 folder are deleted.
-Q causes the files to be deleted without confirmation.
 
Here's another trick that is not such risky. Always tired of clicking the shutdown button in start menu and then choosing shut down from the dialog box.Here,s an easy way just double click on a batch file to shut it down.
1) In note pad type:
                             shutdown /p  (for vista users)
                             shutdown -s (for xp users)
2) save it with .bat extension.
3) Save it on the desktop.
on clicking the batch file your system shuts down.
learn more about the shut down command from the command prompt by typing shutdown /?
 
 

SYSTEM REGISTRY

 It is hierarchial database that contains virtually all info about your computer.
We can change the settings of the system with the registry editor.
in the run dialog box type regedit.
The regedit box has two parts the left side contains database with folders like HKEY_LOCAL_MACHINE,HKEY_USERS etc....
The right side contains certain values.
NB:please back up the registry files in WINDOWS folder before editting registry in case you make a mistake you can copy it back.
 
TRY IT:Browse through the registry editor and try to understand as much as you can with alittle patience you can understand what each key in the registry means.
 
To edit or add information to registry we have to execute a file with .reg extension.
The .reg files can be made in notepad. The first line should be REGEDIT4.
then in the next line the path of the variable tobe changed in [ ]
and finally "value name"="value".
i'll show an example.
 
 
 
Suppose you want to display a message  before logging into your system then this is what you should do:
1) open notepad and type as follows(it is case sensitive)
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"LegalNoticeCaption"="your text heading"
"LegalNoticeText"="your text"
2)Save the file with .reg extension
3)Double click the saved file. A dialog box appears asking permission to update registry click YES.
then reboot your computer .
You can see your message before logging in.
 

BASICS OF BATCH FILE PROGRAMING

Here i'll introduce you to some commands to make a batch file program.
 
REM : it is used to give cooments to a program so  that someone else reading the code can understand what it means.
 
ECHO : Similar to the print command displays the text you want to display on the screen.
Usually before executing a command dos also shows the prompt path.To avoid this we use @ECHO OFF
 
PAUSE : The name says it all it pauses the command from being executed.
 
Giving parameters to batch programs: To give parameters we use %1,%2 etc
 
I'll illustrate with example> We will write the batch program to shutdown the system which we had already written above.
REM program to shut down
@ECHO OFF
ECHO to shut down press any key or CTRL+C to abort
PAUSE
shutdown -s
 
save this as a batch file and execute it from command prompt
 
 
Please keep on visiting this page i'll update the article in  a few days
 
 
PROTECT YOUR SYSTEM FROM BATCH FILE VIRUSES
If you double click a batch file it will  execute automatically.So if the batch file is a deadly virus you can kiss your system goodbye.
And if you use the single click option a wrong click can cause loss of data.
 
How can we protect our system from such mishaps?
Well its simple:
Go to the regestry editor explained earlier
and go to HKEY_CLASSES_ROOT\batfile\shell\open
rename the open to run
now the path is HKEY_CLASSES_ROOT\batfile\shell\run
now in HKEY_CLASSES_ROOT\batfile
doubleclick the  EditFlag binary value and enter 00 00 00 00 as new value.
Now exit regedit and open the  explorer. In the folder options from view menu and select the filetypes tab.
Scroll to the .bat files if it is not in the list add it
highlight it and click editin the menu select edit as default action.
 
Now open explorer
 

Copyright MyCorp © 2009