File Transfer using UDP- Java code


Client side:

import java.io.*;
import java.net.*;
class UDPClient
{
public static void main(String args[]) throws Exception
{
BufferedReader inFromUser =
new BufferedReader(new InputStreamReader(System.in));
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress = InetAddress.getByName(“localhost”);
byte[] sendData = new byte[1024];
byte[] receiveData = new byte[1024];
String sentence = inFromUser.readLine();
sendData = sentence.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
clientSocket.send(sendPacket);
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
clientSocket.receive(receivePacket);
String modifiedSentence = new String(receivePacket.getData());
System.out.println(“FROM SERVER:” + modifiedSentence);
clientSocket.close();
}
}

Server Side:

import java.io.*;
import java.net.*;

class UDPServer
{
public static void main(String args[]) throws Exception
{
DatagramSocket serverSocket = new DatagramSocket(9876);
byte[] receiveData = new byte[1024];
byte[] sendData = new byte[1024];
while(true)
{
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
serverSocket.receive(receivePacket);
String sentence = new String( receivePacket.getData());
System.out.println(“RECEIVED: ” + sentence);
InetAddress IPAddress = receivePacket.getAddress();
int port = receivePacket.getPort();
String capitalizedSentence = sentence;
sendData = capitalizedSentence.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, port);
serverSocket.send(sendPacket);
}
}
}

Chat using TCP/IP – Java code


Server side:
import java.awt.*;
import java.io.*;
import java.net.*;
class server implements Runnable
{
BufferedReader br1,br2;
PrintWriter pw1;
Thread t1,t2;
String st1,st2;
ServerSocket ss;
Socket s;
public server()
{
try {
t1=new Thread(this);
t2=new Thread(this);
ss=new ServerSocket(110);
s=ss.accept();
br1=new BufferedReader(new InputStreamReader(System.in));
br2=new BufferedReader(new InputStreamReader(s.getInputStream()));
pw1=new PrintWriter(s.getOutputStream(),true);
t1.start();
t2.start();
}
catch(Exception ee)
{
System.out.println(ee);
}
}
public void run()
{
try {
if(Thread.currentThread()==t1)
{
do {
st2=br2.readLine();
System.out.println(“Client:”+st2);
}while(!st2.equals(“exit”));
}
else
{
while(true)
{
st1=br1.readLine();
pw1.println(st1);
Thread.sleep(10);
}
}
}
catch(Exception ee)
{
System.out.println(ee);
}
}

public static void main(String arg[])
{
new server();
}
}

Client side :
import java.awt.*;
import java.io.*;
import java.net.*;
class client implements Runnable
{
BufferedReader br1,br2;
PrintWriter pw1;
Thread t1,t2;
String st1,st2;
Socket s;
public client()
{
try {
t1=new Thread(this);
t2=new Thread(this);
s=new Socket(“localhost”,8000);
br1=new BufferedReader(new InputStreamReader(System.in));
br2=new BufferedReader(new InputStreamReader(s.getInputStream()));
pw1=new PrintWriter(s.getOutputStream(),true);
t1.start();
t2.start();
}
catch(Exception ee)
{
System.out.println(ee);
}
}
public void run()
{
try {
if(Thread.currentThread()==t1)
{
do {
st2=br2.readLine();
System.out.println(“Server:”+st2);
}while(!st2.equals(“exit”));
}
else
{
while(true)
{
st1=br1.readLine();
pw1.println(st1);
Thread.sleep(10);
}
}
}
catch(Exception ee)
{
System.out.println(ee);
}
}
public static void main(String arg[])
{
new client();
}
}

C Code of Red Black Tree


#include <stdio.h>
int succ[30],i;
struct node
{
int data;
char clr;
struct node *lft,*rgt,*prnt;
}*root,*b;
void lft_rot(struct node * x)
{ int a;
printf(“left”);
scanf(“%d”,&a);
struct node *y;
y=x->rgt;
x->rgt=y->lft;
if(y->lft!=NULL)
y->lft->prnt=x;
y->prnt=x->prnt;
if(x->prnt==NULL)
{
root=y;
}
else if(x==x->prnt->lft)
{
x->prnt->lft=y;
}
else
{
x->prnt->rgt=y;
}
y->lft=x;
x->prnt=y;
}
void rgt_rot(struct node *x)
{ int a;
printf(“rgt”);
scanf(“%d”,&a);
struct node *y;
y=x->lft;
x->lft=y->rgt;
if(y->lft!=NULL)
y->lft->prnt=x;
y->prnt=x->prnt;
if(x->prnt==NULL)
{
root=y;
}
else if(x==x->prnt->rgt)
{
x->prnt->rgt=y;
}
else
{
x->prnt->lft=y;
}
y->rgt=x;
x->prnt=y;

}
struct node * insert_fix_up(struct node *z)
{ struct node *y;
int a,f=1;
//printf(“hloooo100001”);
// scanf(“%d”,&a);
while((z->prnt!=NULL)&&(z->prnt->clr==’r’)&&(f==1))
{ f=0;
if((z->prnt->prnt!=NULL)&&(z->prnt==z->prnt->prnt->lft))
{
y=z->prnt->prnt->rgt;
if((y!=NULL)&&(y->clr==’r’))
{
z->prnt->clr=’b’;
y->clr=’b’;
z->prnt->prnt->clr=’r’;
z=z->prnt->prnt;
f=1;
}
else if(z==z->prnt->rgt)
{
z=z->prnt;
printf(“hloooo100001”);
scanf(“%d”,&a);
lft_rot(z);
z->prnt->clr=’b’;
z->prnt->prnt->clr=’r’;
rgt_rot(z->prnt->prnt);
f=1;
}
}
else
{
if(z->prnt->prnt!=NULL)
{
y=z->prnt->prnt->lft;
if((y!=NULL)&&(y->clr==’r’))
{
z->prnt->clr=’b’;
y->clr=’b’;
z->prnt->prnt->clr=’r’;
z=z->prnt->prnt;
f=1;
}
else if(z==z->prnt->lft)
{
z=z->prnt;
rgt_rot(z);
z->prnt->clr=’b’;
z->prnt->prnt->clr=’r’;
lft_rot(z->prnt->prnt);
f=1;
}

}
}

}
root->clr=’b’;
return(root);
}
struct node * search(int val)
{ int flg=0;
struct node *temp,*temp1;
temp=root;
while(temp!=NULL)
{
if(valdata)
{
temp1=temp;
temp=temp->lft;
}
else if(val>temp->data)
{
temp1=temp;
temp=temp->rgt;
}
else if(val==temp->data)
{
flg=1;
break;
}
}
if(flg==0)
{
printf(“\ndata not found”);
return(NULL);
}
else
{
return(temp);
}
}
void print(struct node *p_node)
{
if(p_node!=NULL)
{
print(p_node->lft);
printf(“\n %d”,p_node->data);
if(p_node->clr==’r’)
{
printf(“\t RED \n”);
}
else
{
printf(“\t BLACK \n”);
}
print(p_node->rgt);
}
}
void insert(int val)
{
struct node *newnode,*y,*x;
int fl=0,n;
newnode=(struct node *)malloc(sizeof(struct node));
newnode->data=val;
newnode->prnt=NULL;
newnode->lft=NULL;
newnode->rgt=NULL;
y=NULL;
x=root;
while(x!=NULL)
{
y=x;
if(newnode->datadata)
{
x=x->lft;
}
else
x=x->rgt;
}
newnode->prnt=y;
if(y==NULL)
{
root=newnode;
}
else if(newnode->datadata)
{
y->lft=newnode;
}
else if(newnode->data==y->data)
{
printf(“\n\t\t !!!!! alrdy exist\n”);
fl=1;
}
else
{
y->rgt=newnode;
}
newnode->clr=’r’;
// printf(“hlooooooooooo”);
// scanf(“%d”,&n);
if(fl!=1)
root=insert_fix_up(newnode);
printf(“\n \t \t root: %d”,root->data);
print(root);

}
void inordr(struct node *x)
{
if(x!=NULL)
{
inordr(x->lft);
printf(“\t %d”,x->data);
succ[i]=x->data;
i++;
inordr(x->rgt);
}
}
void dlt_fx_up(struct node *x)
{ struct node *w;
while((x!=root)&&(x->clr==’b’))
{
if((x->prnt!=NULL)&&(x==x->prnt->lft))
{
w=x->prnt->rgt;
if((w!=NULL)&&(w->clr==’r’))
{
w->clr=’b’;
x->prnt->clr=’r’;
lft_rot(x->prnt);
w=x->prnt->rgt;
}
if((w!=NULL)&&(w->rgt!=NULL)&&(w->lft!=NULL)&&(w->lft->clr==’b’)&&(w->rgt->clr==’b’))
{
w->clr=’r’;
x=x->prnt;
}
else if((w!=NULL)&&(w->rgt->clr=’b’))
{
w->lft->clr=’b’;
w->clr=’r’;
rgt_rot(w);
w=x->prnt->rgt;
}
if(w!=NULL)
{
w->clr=x->prnt->clr;
x->prnt->clr=’b’;
w->rgt->clr=’b’;
lft_rot(x->prnt);
x=root;
}

}
else if(x->prnt!=NULL)
{
w=x->prnt->lft;
if((w!=NULL)&&(w->clr==’r’))
{
w->clr=’b’;
x->prnt->clr=’r’;
rgt_rot(x->prnt);
w=x->prnt->lft;
}
if((w!=NULL)&&(w->lft!=NULL)&&(w->rgt!=NULL)&&(w->rgt->clr==’b’)&&(w->lft->clr==’b’))
{
w->clr=’r’;
x=x->prnt;
}
else if((w!=NULL)&&(w->lft!=NULL)&&(w->rgt!=NULL)&&(w->lft->clr==’b’))
{
w->rgt->clr=’b’;
w->clr=’r’;
lft_rot(w);
w=x->prnt->lft;
}
if(w!=NULL)
{
w->clr=x->prnt->clr;
x->prnt->clr=’b’;
w->lft->clr=’b’;
rgt_rot(x->prnt);
x=root;
}
}
x->clr=’b’;
}
}
void delete_dat(int val)
{ int j,a;
struct node *z,*y,*x;
z=search(val);
if(z!=NULL)
{
printf(“haaaaaai”);
scanf(“%d”,&a);
if((z->lft==NULL)||(z->rgt==NULL))
{
y=z;
}
else
{
inordr(root);
for(j=0;jdata)
{
break;
}
}
y=search(succ[j+1]);

}
if(z->lft!=NULL)
{
x=y->lft;
}
else
{
x=y->rgt;
}
if((x!=NULL)&&(y!=NULL))
x->prnt=y->prnt;
if((y!=NULL)&&(y->prnt==NULL))
{
root=x;
}
if((y!=NULL)&&(y->prnt!=NULL)&&(y==y->prnt->lft))
{
y->prnt->lft=x;
}
else if((y!=NULL)&&(y->prnt!=NULL))
y->prnt->rgt=x;
if((z!=NULL)&&(y!=NULL)&&(y!=z))
{
z->data=y->data;
}
scanf(“%d”,&a);
if((y!=NULL)&&(y->clr=’b’))
{
dlt_fx_up(x);
}
}
printf(“\n deleted element is :%d”,y->data);
}
main()
{
int fl=0,c,val;
/* b=NULL;
b->clr=NULL;
b->prnt=NULL;*/
while(1)
{
printf(“\nenter ur option\n\t1.insert\n\t2.delete\n\t3.print\n\t4.exit\n”);
scanf(“%d”,&c);
switch(c)
{
case 1:
printf(“\nenter data to be inserted : “);
scanf(“%d”,&val);
insert(val);
break;
case 2:
printf(“\nenter data:”);
scanf(“%d”,&val);
delete_dat(val);
break;
case 3:
printf(“\nroot data:%d”,root->data);
print(root);
break;
case 4:
fl=1;
break;
default:
break;
}
if(fl==1)
{
break;
}
}
}

C Code of Leftist Tree


#include <stdio.h>
struct node
{
int data,dist;
struct node *right,*left,*prnt;

}*root,*temp,*root3,*root4;
void print(struct node *p)
{
if(p!=NULL)
{
print(p->left);
printf("\t%d",p->data);
print(p->right);
}
}

int distance(struct node *m)
{
if(m==NULL)
{
return(-1);
}
else
{
return(m->dist);
}
}
struct node * merg(struct node *a,struct node *b)
{
if(a==NULL)
return b;
if(b==NULL)
return a;
if(b->data>a->data)
{
temp=b;
b=a;
a=temp;
}
a->right=merg(a->right,b);
if(distance(a->right)>distance(a->left))
{
temp=a->right;
a->right=a->left;
a->left=temp;

}
if(a->right==NULL)
a->dist=0;
else
a->dist=1+(a->right->dist);
return(a);
}
struct node * deletion(struct node * root)
{
printf("deleted element is %d",root->data);
root=merg(root->right,root->left);
}
struct node * insert(struct node *root1)
{ int val;
struct node *newnode,*x;
newnode=(struct node *)malloc(sizeof(struct node));
newnode->right=NULL;
newnode->left=NULL;
newnode->dist=0;
newnode->prnt=NULL;
printf("\n enter value");
scanf("%d",&val);
newnode->data=val;
root1=merg(root1,newnode);
printf("root element is %d\n \n inorder traversal of tree is:",root->data);
print(root1);
return(root1);
}
void meld()
{
int val;
printf("\n1st tree:");
root3=(struct node *)malloc(sizeof(struct node));
root3->right=NULL;
root3->left=NULL;
root3->dist=0;
printf("\nenter 1st data");
scanf("%d",&val);
root3->data=val;
while(1)
{
printf("\ndo u waana insert element to 1st tree(0/1)");
scanf("%d",&val);
if(val)
{
root3=insert(root3);
}
else
break;
}

printf("\n2nd tree:");
root4=(struct node *)malloc(sizeof(struct node));
root4->right=NULL;
root4->left=NULL;
root4->dist=0;
printf("\nenter 1st data");
scanf("%d",&val);
root4->data=val;
while(1)
{
printf("\ndo u waana insert element to 1st tree(0/1)");
scanf("%d",&val);
if(val)
{
root4=insert(root4);
}
else
break;
}
printf("\n 1st tree");
print(root3);
printf("\n 2nd tree");
print(root4);
root3=merg(root3,root4);
printf("\nroot element is: %d\n",root3->data);
print(root3);
}
int main()
{ int fl=0,val;
printf("\n enter root node");
scanf("%d",&val);
root=(struct node *)malloc(sizeof(struct node));
root->right=NULL;
root->left=NULL;
root->dist=0;
root->data=val;
root->prnt=NULL;
while(1)
{
printf("\n enter ur option \n 1.insert 2.print 3.delete 4.meld 5.exit\n");
scanf("%d",&val);
switch(val)
{
case 1:
root=insert(root);
break;
case 2:
printf("\n");
print(root);
break;
case 3:
root=deletion(root);
break;
case 4:
meld();
break;
case 5:
fl=1;
break;
default:
break;

}
if(fl==1)
{
break;
}
}
}

When the balloons blast…..


Today is May 21…. The earth is still revolving the sun without any problems… you are breathing well and reading this post here…., But as per the prediction of Harold camping, the dooms day was this day, May 21, 2011. He is the owner of the worldwide missionary organization namely “family radio network”.

Just see his prediction.
http://www.youtube.com/watch?v=KF24k0dfAXE

But we are still alive today! Thanks God!!

I have seen the flex boards showing this message of “family radio network” in Malayalam in Kerala. This belief was so spread over the continents. His argument was that this prediction was made based on long complex calculation for years based on the Bible. Now I am sure that he and his followers might have found out some arguments for the “postponing of the final day” based on cheap numerologies! According to him, the process of the dooms day was to begin today and last till October 12. Many people have resigned their jobs for sacrificing their lives only to the God for getting salvation after today, May 21, 2011!

Now, God has given us an opportunity to smile at his comic numerological prediction.

“Sai Baba”- the pseudo God

I think that a discussion about the pseudo Gods like Sai Baba is relevant today. He was definitely a good magician! He claimed divinity by taking watches, ornaments, etc from the air. But the great magicians were able to break his arguments within no time. Still the people were ready to believe him. Once, a magician challenged him to take out pumpkin from the air. But you know, it is not easy to hide pumpkin in the body. So he was never able to do it till his DEATH!!

The saddest thing is that many of our leaders in almost all fields like politics, sports, film, law etc were believers of him. The former Supreme Court chief justice, Sri. V.R.Krishnayyar has once told that Sai Baba had an impact even in his judgments. Manmohan Singh, Sachin Tendulker etc were believers of him. No one raised any questions about his revenue of crores! I think that social service was a very good mask to hide the unlawful activities.

Saying about his DEATH, most of the media was not ready to write that he has passed away fearing the circulation and sponsors. They found out beautiful words to describe it like “MAHA SAMADHI”. The media competed each other to bringout colourful stories and experiences about his divinity. But the have forgot or masked one thing, it is the duty of the media to guide the people right! The prediction of Baba was that he will leave the body only in the age of 96, but the eternal God called him 10 years back!

The people believed that he can cure diseases, but they didn’t think why he couldn’t to cure himself when he was in the ICU for months! They believed that he was able to make people escape from death, but he couldn’t do it himself! I was thinking all these when I read the experiences of the devotees in news papers about curing their diseases. Recently, we have witnessed a comedy in the media. The “mathrubhumi” newspaper was the one which gave maximum colourful stories when Baba passed away. But the same newspaper published a series about the tricks of pseudo Gods and “Sidhas”. They might have forgotten these things when they wrote about Baba!! The big fish is always out of the net!!

You just search in Youtube for details about the secret Swamy.

“Shaare Mubarak”- the new “salvation” business


“Salvation”, “moksha”, “santhi” etc are the top selling goods in the market today. One more product is added in this category recently, “Shaare Mubarak”. One of the muslim organizations in Kerala has decided to build a masjid(I am not sure whether it can be called a masjid) in Calicut. They are claiming that they have got the hair of prophet Muhammed(pbuh) and they will show it there. (But it is never the hair of him and even though if we admit that it is, the Islamic belief is that nothing except the eternal God has any metaphysical powers to cure diseases or anything like that) Anyone can come there for salvation and peace. Religion and cast are no bar! The businesses are always like this. Just think of such centres you know. The expense is estimated around 42 crores! That will be collected from the poor people. But they can easily make 420 crores once the business in ON! A big shopping complex will also be attatched with it!

So , we have to raise our voice.
“If you don’t stand for something, you will fall for anyting”
-Malcom X

Is your browsing safe?


Friends…..
You people might be crazy to browse all over the internet. But have you ever taken care of your privacy and security? You have to!

Bcoz…badwares are there spying everywhere to break into your computer. A badware is a software which uses the users’ computer and network without his knowledge or permission.

They are mainly targetted at

1. Stealing personal and confidential information (e.g. passwords, credit card numbers)
2. Attacking other networks.
3. Redistributing to other domains and computers from the site it has attacked earlier.
4. Tricking in e commerce.
5. sending junk emails(spam).

This types of badware is often referred as malware. In general, badwares include malwares, trojans, worms etc.

Now, an interesting thing…. Google provides you a way to identify sites containing badware.
Just type the following in the address bar.

http://www.google.com/safebrowsing/diagnostic?site=

Here, the most intersting thing is that this will detect evenif the badware is present in the inner links.
Check for Google itself.

http://www.google.com/safebrowsing/diagnostic?site=google.com

For facebook

http://www.google.com/safebrowsing/diagnostic?site=facebook.com

Wanna test whether I am propagating malware! 🙂

http://www.google.com/safebrowsing/diagnostic?site=technothoughts.wordpress.com

Just see the screen shot for google. (Just click on the first link)
Screen shot for Google

OK! Mozilla Firefox has a facility for safe browsing. It will alert for attack sites and other malwares.

Tools –> Options –> Security.

Then you can set these options.

All badwares are not harmful. Some of them just installs a tool bar with your permission. But they may send your browsing history and cookies to a third party! Wow!!

Some others will prompt you to install a useful software. But some spy software also will be installed along with that! How is it?

And the most harmful badwares will collect all your confidential data and crack all of your accounts! Beware badwares!!

Also…once your computer or website is attacked..then it will also as attack site! So be careful!!

Once google lists a site as attack site, then browsers such as firefox and chrome will generate warnings.(if we set options).

To know about how to stop badware, visit

http://www.stopbadware.org

Wanna trace Email location?


Hello…
I am back after a short gap. I think that u might have wondered a lot how to recognize the location of an email if someone tricks you with a fake email or something like that. I too have astonished at some point of time. now let me share my experience with you.

Every email will have a header. To see the header of a mail in gmail.

1. Click on the arrow near the “Reply”button.
2. Click on “Show Original”.

Now, the header will tell you whether the email is fake or not!
Wanna know how?

Normally, gmail is providing their private ip address in the email headers for users’ privacy.
Now I will provide you two samples of parts of email headers.

1.Original
Delivered-To: muneermunnar@gmail.com
Received: by 10.151.38.3 with SMTP id q3cs109286ybj;
Sun, 6 Mar 2011 06:10:14 -0800 (PST)
Return-Path:
Received-SPF: pass (google.com: domain of midhunmunnar@gmail.com designates 10.52.70.200 as permitted sender) client-ip=10.52.70.200;
Authentication-Results: mr.google.com; spf=pass (google.com: domain of midhunmunnar@gmail.com designates 10.52.70.200 as permitted sender) smtp.mail=midhunmunnar@gmail.com; dkim=pass header.i=midhunmunnar@gmail.com
Received: from mr.google.com ([10.52.70.200])
by 10.52.70.200 with SMTP id o8mr3937865vdu.84.1299420613251 (num_hops = 1);
Sun, 06 Mar 2011 06:10:13 -0800 (PST)

2.Spoofed email

Delivered-To: muneermunnar@gmail.com
Received: by 10.220.61.76 with SMTP id s12cs87164vch;
Sat, 5 Feb 2011 08:23:55 -0800 (PST)
Received: by 10.204.116.74 with SMTP id l10mr7804628bkq.77.1296923034539;
Sat, 05 Feb 2011 08:23:54 -0800 (PST)
Return-Path:
Received: from xxxx.xx ([77.78.xx.xx])
by mx.google.com with ESMTP id rc7si5651453bkb.68.2011.02.05.08.23.54;
Sat, 05 Feb 2011 08:23:54 -0800 (PST)
Received-SPF: neutral (google.com: 77.78.105.15 is neither permitted nor denied by best guess record for domain of www-data@xxxx.xx) client-ip=77.78.xx.xx;
Authentication-Results: mx.google.com; spf=neutral (google.com: 77.78.xx.xx is neither permitted nor denied by best guess record for domain of www-data@xxxx.xx) smtp.mail=www-data@xxxx.xx
Received: by xxxx.xx (Postfix, from userid 33)
id 3887F81A6F0; Sat, 5 Feb 2011 18:05:36 +0100 (CET)

Now let’s analyse both.
The ip starting with 10 is the private ip of google. We can never trace the location of a private ip.
(For tracing pulic ip addresses, use network-tools.com)
In the header of the spoofed email, I have hided the details regarding the name and ip of the web site used here to spoof the email. Bcoz, I don’t want you to trick your friends in that way! Instead I want help you if someone tricks you!

Notice the “Received: from” field.

In original email, it is shown as mr.google.com and the private ip.
In the spoofed mail, the website used for spoofing is shown first and then mx.google.com. Note mx..not mr..
Also, the protocol used differs. In original it is SMTP. In spoofed, it is ESMTP.

Now, please have a look at the Authentication-Results: field. Observe and note the differences.
Especially spf. It is “pass” for real and “neutral” for fake.

Now, I think that u might have got an idea about how to identify fake emails. Now about tracing the location of the mail back to the sender……
Unfortunately, it is hard to trace the location of mails with private ip. (But u can contact cyber police). But you can know the location and details of the website used to send you the fake email. The ip and site URL will be there in the “Recieved from” field. Then goto domaintools.com or to
whatismyip.com.
There are a lot more details about tracing (whois lookup, reverse lookup etc), you yourself explore them. These sites can be used for tracing any public ip.

If the header is having a field as “X-Originated ip”, it will give the exact ip address of the computer from which the mail was sent. This field is present in mails from Hotmail.

Now…………explore more and share with all…..

TIP: The range of private ip
10.0.0.0 – 10.255.255.255(class A)
172.16.0.0 – 172.31.255.255(class B)
192.168.0.0 – 192.168.255.255(class C).

Use of private ip can protect from many types of network attacks and gain privacy.
To know more
http://kb.iu.edu/data/aijr.htm

Hack with Google!


Friends..

In this post…let’s discuss how to hack using google!

Many files in websites will be password protected! So how to access it? Google provides a way…(i.e. we find a way by exploiting the vulnerability!)

You just type

parent directory /mp3 in google.

parent directory /wav

Then a lot of results will appear. Just click on them and enjoy freedom! You have gained access to the server.

The same method can be used for any type of files.

parent directory /<file extension>

Also,

put the following string in Google.

?intitle:index.of? mp3

You only need to type the name of the song/artist/singer.

Example: ?intitle:index.of? mp3 jackson

Notice that we are changing only the name after parent directory. Change it to whatever you want! OK..

Now, I am ready to share a secret with you…, but promise me that you won’t misuse it.OK!

Google can be used to access many confidential data items like passwords, financial details, security cameras etc.

Type

inurl:password.xls

Now you will get a lot of sites in which usernames and passwords are listed in excel sheet.

“index of/”  “ws_ftp.ini”  “parent directory”

ws_ftp.ini is a configuration file for win32 FTP clients. It stores usernames and weakly encoded passwords . Quotation marks(” “) are used to find web pages containing the exact phrase given there.

Now, one more trick. Suppose you need to get a .iso file of windows7 professional. Can you afford its price? If not, you have methods like this!

Just open Google and type

inurl:windows filetype:iso

You will get a lot of links from where you can download the files. Replace the term in inurl field and file extension in filetype field. OK ……Go..!

TIP: Really how can we call this as hacking? We have used the information just provided by Google.(But they shouldn’t!)

Hack admin password of websites


You might be interested if you can hack administrator passwords of websites! So here’s a way….

You can use this method for cracking admin passwords of websites written in ASP.

First, you type “asp admin login” in Google. Then select any of the websites.

1. Type         admin in username field.

2. Type             ‘or’1’=’1 in the password field. (You may use the same string in the username field also.)

Are you logged in now? Sometimes, you may not be. But you don’t worry. Try for webpages in the second and later pages of google results. Defenitely, you can crack!

Now do you want to know the anatomy of this hack? We have used the technique of SQL injection here. i.e, we have (mis)used the security vulnerability(Remember Deepa miss’s class) in the database layer of an application.

I think that you remember the basic SQL commands. Normally, we write the sql command for validation of input form in the following way.

SELECT  * FROM ‘users’ WHERE  ‘name’ = ‘ “+userName +” ‘  AND  ‘password’  = ‘ “+password + ” ‘;


When we type as username and password as shown above, the query will become like

SELECT * FROM ‘users’ WHERE  ‘name’ = ‘admin’ AND ‘password’ = ” OR  ‘1’=’1′;


Look in the password validation carefully!

password=” or ‘1’=’1′

Either password is null or 1=1. String will be always validated!

Don’t misuse this trick! Think positively…………!

 

 

Make your own trojan!


I think that you might like to have fun at your friends with your own virus. It is so simple. If you want to work the virus when the
icon of Mozilla Firefox is clicked, then right click on the icon. Under the ‘short cut’ tab, you can see a field ‘Target’. Just type the following line

shutdown -s -t 10 -c “Virus detected! Your system has failed!”

Now click “OK”.
If you want to make fun at your friend, then wait untill he/she clicks on Mozilla. Now see the fun. The system will shutdown within 10 seconds displaying the message written.

Do you want to know the details behind this trick.
These are just system commands.
Shutdown -s : to shutdown the system surely
-t : specifies the time in seconds before shutdown
-c : for displaying message on shutdown

if you type shutdown -l instead of shutdown -s, the system will log off only.

If you want to make more fun, just open notepad and type the command which we have written for the icon.
Then save it as name.bat. Before saving it to .bat, changetype of files to “All files”. Now a batch file is created.
Then the system will shutdown if the file  is clicked. If you save the file in startup folder, then this program will work on the
system startup. Then the system will shutdown each time it is turned on!
If you are crazy to know more about batch files and its tricks, just wait for the next post.
TIP: Programs in startup will not work if the ‘shift’ key is kept pressed during startup.