Wednesday, June 8, 2011

Find them all (nmap usage)

Nmap is a useful port scanner for networking stuff. You can download Nmap from their official site. click here

For linux users, you can directly use your mirror sites to download.

ex: In debian type

# apt-get install nmap

Wanna do something crazy ?



check your current public IP. click here

and type this in your terminal. ( If you are using Windows cmd, type in cmd )



you have to change 192.168.1.0 to your subnetwork address (you can get it from your public IP) and give the range as 255.

If there is no error, the scan should start.

It will show all the public IPs within the range which are up.

PS: This is Nmap Ping Scan - go no further than determining if host is online

Tuesday, May 31, 2011

Using Google Map API.


     Google code is the Google's official developer site. Featuring APIs, developer tools and technical resources. google code. If you visit APIs & Tools you will see a lot of APIs which can be useful for web development, in other words for web applications. From this post I'm going to show how to use a well known google API called Google Map API. There are lot of categories under Map API Family.

1. Click on Map API.

2. Then click on Static Maps API



3. Now you will see a page which contains all the information to use this API.

4. If you feel it is too hard, just use this link.



5. You can give different values to center, zoom, size. (you can give the city name as center value.)
ex:
http://maps.google.com/maps/api/staticmap?center=Tokyo&zoom=12&size=300x300&maptype=roadmap&sensor=false

6. You can also change map type by changing maptype value to roadmap, satellite, terrain and hybrid.

7. For further changes, always go through the Map API info page which I have mentioned above.

Ok, this is a simple registration form which I have created by using php and javascript. I have added Google Map API link to generate maps. Check this out.

http://shankcode.appspot.com/samplereg.php

PS: There can be many bugs in that registration form.

Thursday, May 19, 2011

Fire Bug

Q : What is Fire Bug?
A : It's a real time web development tool.


Q : How to get that? what are the requirements ?
A : Read this post.

1. You need to install Firefox 3+ (If you use another browser, you will find some difficulties)

2. Go to this site firebug and hit on Install Firebug or click on this.



3. Select the suitable version and click Add to Firefox.

4. Then it will starts to install and your browser will restart.

5. To use the firebug tool:

              Tools  -> Firebug -> Open Firebug

6. Click on this picture and you will firebug tool working on the bottom of the page.

Wednesday, May 4, 2011

Java with MySQL

Java is a popular language or may be the most popular language now. From this post I'm going to show how to connect MySQL database to java program. (this is a simple program with simple db)

1. You need to create a data base in MySQL and create a table. Then you can insert values to the table. If you are not familiar then use following lines. ( red color : not syntax )

                         mysql> CREATE DATABASE myData;
                         mysql> GRANT ALL ON myData.* TO name@localhost IDENTIFIED BY 'password';
                         mysql> use myData
                         mysql>  create table student(name varchar(30), city varchar(30));
                         mysql> insert into student values("Amy","Texas");

         
2. Now you need to download MySQL java connector. click
    for Windows download ZIP Archive and for Linux download TAR Archive

3. Extract the downloaded file and check the mysql-connector-java-5.1.16-bin.jar file is available or not.    If not then you need to check again.....

4. Open NetBeans IDE and create a new project. download NetBeans


  5. In the project window right click on the Libraries (which placed under your          created project name) and select Add Jar/Folder.


6.  After adding the Jar file it will display like this.


7. Now the rest of the coding is simple.



 line 1 : you need to import java.sql package.
 
 line 8 : defining Driver class. You can find these things in project window. (you need to expand the .jar file)

 line 10 - 12 : passing parameters to open the connection. angmar is the user name which I have created earlier and  angmar123 is the password. myData is the DB and localhost:3306 is explained at the end of this post.
 
 line 14 : This line is to prepare a statement (a Query) and it creates in statement object.

 line 16 : To execute the prepared query this line can be use.    The result is stored as result object which has been create by using ResultSet class.

 line 18 : Return a boolean type value (true or false)

 line 20 : To get the the result as a String  .getString() method can be use. 1 will gives the 1st value.
       


  •  localhost:3306 -> MySQL is using port 3306. To get that you can run following commands in CMD or Terminal.
        Windows: 
          :> netstat -ano
           you will get the pid, use task manager to get the correct application or service to that pid.

        Linux:
          # nmap -sS localhost
        you need to install nmap to execute this command.

Saturday, April 2, 2011

The Matrix has you

            Do you remember a movie called The Matrix (a science fiction-action film) which has been written and directed by Larry and Andy Wachowski in 1999? If not, then you haven’t watch this movie yet.  The reason is no one will ever forget this movie, even they don’t understand.  I’m not going to tell about that movie, I’m going to tell about the reality of the movie. The basic theme of this movie is a virtual world called matrix. Is this world can be implement in the real world? Now that sounds interesting.
       In most of the movies, we can see computing stuff like hacking, login remotely, accessing the internet, chatting via the internet and, blah blah blah....The fact is most of them are not using real systems, and they just control the system by using unknown commands and methods. Somehow in The Matrix movie, there is a scene that an infamous female hacker called Trinity is trying to login a system remotely.  Check this out.

 In this picture she uses a Linux system and NMAP (a network mapping program). Not only NMAP but also she uses SSHnuke (the real tool is SSH - Secure Shell) to login to the remote system as root (Admin). That's really cool. Still you may think is it possible to build a virtual world (which has everything like the real world) in side a computer or a server.  There are little evidences we can think of it. I’ll show them from my next post.

Wednesday, March 23, 2011

Forgetting Root

What happen if you forgot your GNU/Linux root password? 

Worry? ah.... 

Ok. I'm going to describe a method which can be helpful to you. I have tested this method in my Linux OS (debian 6.0 ). 
Here what you need to do, first of all, make sure what is the boot loader you are using. You can check it easily by reading the name when your PC boots. If your boot loader is LILO then this method is not for you. If your boot loader is GRUB .............
 Follow these easy steps. Unfortunately, I don't have any screen shot. Because of that I have used one screen shot from the internet.


  Examine the screen shot at the end of this post. 
 1. Reboot the PC and press arrow keys when the boot loader appear.

 2. Select the OS and press 'e'
 3. Select the kernel mode. 
              You can find this in the top of the list. I can give a phrase. "linux /boot/vmlinuz ". Try to find that line.
FYI :  vmlinuz is the name of the Linux kernel executable.

 4. To edit that line, press 'e' again. For Grub V1.9+, you don't need to do that.

 5. Now go to the end of the line by hitting 'End' key. Type the following path to initialization after a space.
      init=/bin/bash
 6. Now exit from the edit mode and press 'b' to boot. For Grub V1.9+ use Ctrl+x
 7. After the system boots type following in the command prompt.
                #mount -o remount, rw /
                    #passwd
           
      Enter your new password.

              #sync
                  #mount -o remount, ro /
                  #reboot

 8. Thatz it. Hopefully, this method will work for your system. However, I can't grantee.