Pages

Tuesday, February 15, 2011

Java sniffer using JPcap

Java is a application programming. So we can't control any hardware directly with Java. But it can be done with C, C++ like system programmes. So network sniffers can be created with system programming but not with Java.

But here comes a Java utility Jpcap, that enables us to do this. It uses C base files that uses operating system specific native functions to control the network. Using this you can capture all the packets received by a computer through a Java program. And it enables filtering packets. It supports most of the common packets used in networks.

Just search Jpcap in Google. You can get more about it.

Sunday, February 13, 2011

Google dictionary add-on for Firefox

A really nice add-on for Firefox browser. When you are reading something in Firefox you may not know the meaning of some words, then probably you will open another tab and search Internet for the meaning of that word. Also me do the same till know about this add-on.

But if you install this add-on, you no need to search anywhere. Just double over the word and a small tip box will appear and show the meaning. It is a wonder full add-on. You can download it here.

Saturday, February 12, 2011

Google = Calculator

You know Google is a calculator. You may wonder how a search engine will be. But its true. Just type the expression in the Google search bar. And you will get the answer as result. For example to adding 3 and 9, type 3+9 in the search bar, you will get the answer as in the picture.


Not only arithmetic calculations. You can also do advanced calculations like trigonometry, logarithm, etc., with Google. for example, type sin(84)+log(34) and get the answer 2.26466924 as in the figure following, 


If you want to know more about Google calculator, you can read here.

Friday, February 11, 2011

SQL injection

Sql stands for Structured Query Language. Its a language used for querying database. In most of the websites, this is been used. In websites it is used for store and retrieve user information from databases. For example, the login username and password will be compared with the data retrieved for the user information database. So Sql is used in a wide range of websites.

But the websites using sql as back-end are facing a vulnerability known as sql injection. It is very critical one, which should be eliminated from any websites. Because using this vulnerability, anyone can spoof other users who are registered in that website. 
Here in this post, first we will see how sql is been used and then we are going to see how to perform sql injection.

In any website that asks user to login will prompt to enter the username and the password. Those information will be used to frame a query that will be sent to the database. For example in an ordinary login page, you are providing your username as arun and the password as arunasks as int this figure, 
 
those data will be placed in a query like this
select * from user_info where username='arun' and password='arunasks'
consider in this website, user_info is the database table that stores the user information. So this query will return details of a user whose username is arun and the password is arunasks. If no user having this username and the password, you will be returned an error message as login failed. This is what actually happens.

See here in the query, the data that entered in the username field and the password field will be inserted in the appropriate position. So if you insert username as 
x' or '1'='1' -- and enter whatever(blank now) in the password. 
 
Then the query will be framed as,
select * from user_info where username='x' or '1'='1'-- and password =''
so now even the username is wrong, the or condition one equal one is true. and in sql '--' is the comment line. so anything after '--' won't be considered. So you will be logged in.

Not only this method. There are millions of methods in Sql injection. As much as you are creative, you will get more and more.

Thursday, February 10, 2011

Write in your blog through email

In my college blogger.com is blocked. But I have a habit that whatever I like, I think, I know, I will write in my blog kumaran127.blogspot.com. So now I need an alternative to write to my blog. Then I found that blogger provides an option to post through mail. First we need to create a secret email id for blog posting (this must be secret. Because only you should be able to write in your blog). After that you can send your writing to that email, that will be published in your blog.

For that option, do the following,
  • In blogger dashboard, select settings
  • then select the tab email & mobile
  • in the email posting address create the secret email
  • there will be some options as, 1.publish emails directly, 2.save emails as draft posts, 3.disabled. Among them select your required option and save the settings.
Thats all. now you can write in your blog through mails. One important thing here is, the subject of your email will be the heading for your post.

Make computer as a router

I'm doing my final year project now. For that I need to connect two different network through a router. But in my college there was no router. But I can have as many computers I need to work. So I planned to make a computer as a router. Here I used Ubuntu, a debian based linux destro to make the system to route.

First I have connected two NIC (Network Interface Card) to a computer. And I had a default NIC. That totally three NICs I had in my computer. So I can connect three different network segments together. Now connect three network segments with the computer and assign IP address for three NICs. Now enable IP forwarding in the Ubuntu machine. Restart networking. Thats all the system became router.

I just gave the outline. Now I'm going to tell what I have done in my college. I have four systems totally. One of them is added two more NICs. That system(Ub) is installed Ubuntu 10.10. And the other three have been installed with Windows XP operating system (Xp1,Xp2,Xp3). I decided three XP systems as separate network segments. I have assigned the following IP for those machines
  • Xp1 - 192.168.1.105
  • Xp2 - 10.10.3.101
  • Xp3 - 10.10.2.101
And for those three NICs in the Ubuntu system as follows
  • eth0 - 192.168.1.100
  • eth1 - 10.10.3.100
  • eth2 - 10.10.2.100
I don't have any switch or router as I have told already. So I connected systems directly. But to connect two computers, the cable should be cross connected (search in Internet for cross cable). And I have connected the systems as follows
  • Xp1 - Ub eth0
  • Xp2 - Ub eth1
  • Xp3 - Ub eth2
In the Ubuntu machine I given the IP address in GUI mode. But it didn't worked for me. I don't know why. So I have assigned the IP directly in the interfaces (/etc/network/interfaces) as above. And restarted the network using the following comment
  • $ /etc/init.d/networking stop
  • $ service networking start
Alas! I made my computer into router. Now you can ping any system from any other system.

Wednesday, January 26, 2011

Forgot Firefox password (Reset firefox password)

some days b4 i have set master password for my firefox. But the next day I forgot that password. I was struct. I dono what to do next. I posted in Buzz for help. But no use :-(. So sad of me na. After I Googled about reseting firefox password. And finally I got it.
  • just type the following line in the address bar of your firefox browser without cotes "chrome://pippki/content/resetpassword.xul"
  • It will ask for confirmation. 
  • If you give ok, your password will be simply reseted.
Note: Remember one thing, if you reset your master password, all your stuffs saved in your browser using that master password will be lost.

Saturday, January 8, 2011

basic-10

yeah very simple one. the page that is being linked at the challenge page will respond you if ur ip is in a specified range. so first you have to find the range. then change ur ip to the one in the range. then open that page. the challenge over.

Ans:
click the link. if ur ip is in the range, u will be automatically finish the level. but if not, u will end up with a page saying page not found error. view its source. the comment line will say the ip and the port range. one good news here is the port 80 is allowed. its over. now the work is to find a proxy that present inside the range. i found one here. login to ur account through the proxy and click visit the page. thats all. the game is over.ur point will be incremented to 40.

www.hellboundhackers.org

Thursday, January 6, 2011

basic-9

this is not tough as previous levels. but little bit tricky. it consists of two steps. first you need to find the file that to be searched. then you have to open in a different way. then next step will be automatically start. there you have to find the username and the password(please use firefox. won't appear in chrome). then you have to enter the username an the password in the right place.

as the search.php is only to search inside the file directory, have a look into the file directory. just type file/ after basic9 in the url. u will be taken to a directory listing. there u will find the file need to be opened. if u enter the file directly, it will run the file. but you have to open it to read, not run. so open in a different (just read about null byte poisoning) here. now u will be asked to enter the second level. if you enter the second, level a php file will be saved as html file. so u can read the source(use firefox). now save the username and the password. then sumbit them in the right place to login. u will be added 30 points.

Ans:
  • open the location,  http://www.hellboundhackers.org/challenges/basic9/files/
  • now enter the file need to be open(login.php) in the search box in the search.php page. but it will run. now u have some knowledge about null byte poisoning.
  • enter following without cotes in the search box of the search.php. "login.php"
  • the first level is over. a link will appear, that asks u for enter the second level. just click it
  • ones.html file will be opened. view the source of the file with firefox. because, chrome won't show the password. in the source, u can find the username and password.
  • copy it and enter it at the starting page of this challenge, www.hellboundhackers.org/challenges/basic9
  • ur points will be added with 30.
www.hellboundhackers.org

Wednesday, January 5, 2011

basic-8

you need to do some real sql injection. remember this things while doing this.
  • the variable that holds the sql query is $sql_query
  • that sql_query variable can be set using get method
  • simply try to view the entire database
  • use upper case letters for the query words like SELECT, FROM, etc
first give some random value in the password box, you will end up with wrong sql query in the next page. but u will find that the script is weak. so u will find the name of the password database.
now its very simple to view the database. 

Ans:
the password database is family_db
in the address bar, add the following arguements without coates
"?sql_query=SELECT * FROM family_db"
now the password will be shown to you. and also there will be a text box requesting u for the password
just see and type the password(the password is KingKond) in the text box. you will be given 30 points

Tuesday, January 4, 2011

basic-7

Actually two cookies are been set in your browser. But only one of them is usefull for this challenge. you can see the cookie value by viewing the source of the page and also as it is been set as cookie, you can view it among the cookies in your browser. as this page requires the username, find the username value from that cookie. you have to encrypt it to ascii encryption code, as ascii encryption mode is eabled. thus the value entered in the given textbox will be decrypted with ascii encryption method and the decrypted value will be compared with the value reside at your cookie. so you have to encrypt the username using ascii encryption and enter it. but each time, the ascii encryption gives different value, you may end up with error. so the real hack is, edit the cookie to its ascii value. use some ascii editor. I used cookie editor add-on for firefox. you can download it here. now convert the username into ascii code and replace the cookie value. conver any string into ascii here (remove all spaces). now enter the username itself without any encryption. you will be authenticated.

And the next is a sql injection hack. its very simple and basic. google about sql injection and you will end up with the answer.

Ans:
the username is sam
its ascii value is 011100110110000101101101
using any cookie editor, replace the username cookie content with the ascii value mentioned above.
now give sam in the textbox.

first step is over. now sql injection. many ways are present, i used this way. just copy and paste the next line without cotes.
"one' OR 1=1--"

www.hellboundhackers.org

Monday, January 3, 2011

basic-6

You should know about some basic unix commands. The assignment here is, 
  • you have to find the log file and the other file which tracks user activities
  • then you have to change the chmod of the log file (first command)
  • then you should delete both files (last two command) 
those two files are not in the same folder the basic6/index.php present but in an inner folder. so look around for those files. then simply form the commands. enter them in the text boxes finish the level. but one thing to remember is, every command should start with a '$' symbol and there should be a space between the '$' symbol and the command.

Ans:
$ chmod a+x logs/logs.txt
$ rm logs/logs.txt
$ rm logs/track_users.php

www.hellboundhackers.org