Hacking Techniques
Hacking Techniques
by UnKnOwN
courtsey: eworld.0fees.net
________________________________________________________________________________
________________________________________
Hacking is obtaining illegal access to information on your computer, or another
persons computer. Password cracking, spoofing, and sniffing are the main techniq
ues that hackers use. A typical network hacking could involve all three methods
simultaneously. For example:
* A hacker could first trick a user to visit the hacker's site and enter som
e personal data in it. This is called spoofing.
* While the user is entering the information, the hacker could sniff the net
work traffic emerging from the user's computer and obtain a list of passwords an
d logins. This is called sniffing.
* If the passwords are encrypted, the hacker could use a password-cracking t
ool to decrypt them.
After this, the hacker can access the user's machine with this information. If t
his hacking attempt takes place over a corporate network or even a website, the
result could bring down the entire network or site, or the hacker might access c
onfidential information for industrial espionage.
In this article, I'll cover common hacking techniques such as password cracking,
spoofing, sniffing, and, if space permits, the man-in-the-middle attack. Of cou
rse, this is not an article on how to hack so I will explain how to protect your
self against these type of attacks.
Using passwords is the most common method of authenticating and securing data. P
asswords are used in network logins, securing documents, ATM PINs, and other sen
sitive areas. I know, I am talking to you like a three year old, but just in cas
e there any absolute newbies out there I want to be thorough.
A password works as a data encryption key or as an authentication key. When a pa
ssword is used as a data encryption key, the data to be protected gets encrypted
. Without the encryption key, this data would appear as a garbled output. I will
do a detailed article on encryption one of these days.
For example, to see the effect of not password-protecting a simple Microsoft Wor
d document:
1. Create a new Word file.
2. Enter some text in it.
3. Save and close the file.
4. Open Notepad or any other text editor.
5. Open the Word file in a Hex editor. There are a lot of junk characters in thi
s unencrypted file, but the text you entered is still clearly visible, as shown
in Figure 1:
This type of attack uses a file that contains an extremely large number of words
and tries each password from this file for entering the target resource continu
ously. The dictionary file, called the wordlist, is a simple text file containin
g one word per line.
The principle of this attack is that most people use simple words or combination
of words as their passwords. The larger the wordlist, the better are the chance
s of cracking the password. Most modern password-hacking tools use the dictionar
y method as their first and fastest method of guessing a password.
Hackers also use permutations of each word in different cases. For example, if "
that" is the word chosen from the wordlist for trying out, the hacker tool would
try all possible combinations of the alphabets, as listed in Table 1:
In this method, the hacker uses combinations of words and numbers as well as som
e other attributes, such as file names and dates.
The logic behind this attack is that many users simply rotate their passwords. U
sers simply add a number to the end of the file name and use that as the passwor
d. For example, for the July Sales Report.xls file, a user could choose a passwo
rd such as SAL1 and the next month alternate it to SAL2.
Parts of the file name, the date the file was created on, and any words that hav
e a special meaning, such as in July being the 7th month, could signify a passwo
rd such as SAL7, SAL07, 7SAL, or 07SAL.
Hybrid attacks are logic-based and can even detect non-word passwords. The stren
gth of this attack depends on how well written the guessing engine of the tool i
s and how many different hybrid attacks it can predict.
This method enables hackers to determine a password by trying every possible com
bination of characters including lowercase letters, uppercase letters, numbers,
punctuation, and special and reglar ASCII characters.
The brute force attack starts with a length of one character. It tries all chara
cters alone once and then a combination of two, three, and so on. A set of possi
ble combinations using the lowercase and uppercase alphabets and the digits are
listed in Table 2:
A brute force attack in progress is shown in Figure 8. The figure shows the pass
word cracked using the brute force attack after the dictionary and hybrid method
s failed. I'll make this picture a bit bigger so you can see some details of thi
s attack in progress:
The following simple rules protect passwords from hackers, I would follow them:
* Select passwords at least eight characters in length.
* Do not use names, words, and common abbreviations for a password.
* Use a combination of uppercase and lowercase letters, numbers, and special
characters.
* Do not write down the password anywhere.
* Change your password regularly and do not repeat your passwords.
Sniffing is the act of eavesdropping on the network. It works pretty much the sa
me as a phone tap. In most cases, sniffing does not require any specialized equi
pment; any computer on the network can do the task.
The packet sniffer tool used for sniffing captures and logs all network traffic.
While running on any computer on the network, the tool works, captures, and ana
lyzes every network packet that travels through that machine. This mode is known
as the promiscuous mode. The default mode uses a filter that simply passes on a
ny packets not meant for that machine back to the Ethernet. Packet sniffers turn
this filter off so that all packets are accepted by the network card and passed
to the system running the sniffer, where it can be captured.
Because most of the traffic in the network is binary data, the captured log is s
ent to a protocol analyzer tool, which:
* Analyzes the packets captured
* Figures out the protocol type
* Opens each packet according to the rules of that protocol in order to get
to the data in the packet
* Other stuff?
The data can include sensitive information, such as logins and passwords. A skil
led hacker can scan the data for such information quickly and possibly get a few
passwords transmitted on the network.
Ethernet uses shared media. Every computer on the network can see all the traffi
c being generated on the network. The Ethernet card installed in each machine co
ntains a filter that rejects any packet that does not have its own Media Access
Control (MAC) address. The MAC address is a global 48-bit number that is unique
to each piece of Ethernet hardware.
Parts of a Sniffer
A sniffer tool consists of:
* Hardware: Is usually a standard Ethernet card in a machine. Advanced netwo
rk sniffers, such as tools for checking cyclic redundancy checks, voltage errors
, or jitter correction are used for network fault detection and use specialized
hardware such as network analyzers. A bit too complex for this article.
* Capture driver: Turns "promiscuous" mode on and captures the traffic that
flows past.
* Buffer: Stores the captured data. The buffer could be either disk- or memo
ry-based.
* Protocol analyzer: Reads the captured data, seperates it into different pr
otocols, and then opens it to show the hacker the information that the packet co
ntains.
* Packet editor and transmitter: Enable the hacker to change certain values
in the packet and to resend the packet on the network with the modified informat
ion, thereby enabling the hacker to spoof values in the network. This is an opti
onal add-on tool on the sniffer I am testing.
Many network protocols send login names and passwords in clear text over the net
work. Hackers usually try to get these logins and passwords by sniffing the netw
ork and analyzing the packets.
Modern packet sniffers can even be configured to watch for a specific protocol,
such as Telnet, and to automatically open each new packet and look for the login
information in the decoded data.
There are two common ways of packet sniffing in a network:
1. Sniffing by internal users: Hackers can run packet sniffers on their machine,
looking for admin-level passwords being passed on the network. This allows them
to log in as users with high levels of access and gain admission into areas, wh
ere they have no authorization. They can alter important information about thems
elves or others, such as payroll information and performance reviews. Screw with
someone's salary? Hackers can most likely do it! (the Bastards)
2. Sniffing by external hackers: If a system is connected to the Internet, a hac
ker who gains access to it can install a packet sniffer on that computer. In a b
usiness or other organization, a computer connected to the Internet is most like
ly to be connected to an internal network. By gaining entry into this computer,
the hacker can view the traffic in the internal network by running a sniffer. Af
ter getting a dump of passwords, the hacker can use the compromised system to ho
p onto a system in the network and so on. If he gets this far it will be disaste
rous.
You need to be concerned about sniffers from both inside and outside of the netw
ork. To prevent sniffer attacks on the network, you can use:
1. A switched network rather than a shared one. Use switches instead of hubs. Th
is prevents casual sniffing of your network because the data is well segregated
and each computer does not see all the traffic.
2. Secure protocols. Avoid protocols that send their sensitive information in cl
ear text over the wire. Use protocols that encrypt data at the sender's end and
decrypt it at the receiver's end.
3.Use Kerberos on Windows 2000 or later. This, as well as many variations of UNI
X, has implementations of this secure authentication method. Kerberos is a netwo
rk security protocol that uses encrypted packets to exchange information as well
as giving user authentication rights.
4. Smart Cards and one-time pads. Each smart card contains millions of combinati
ons of digital one-time codes that are used for authentication and as encrypting
keys. I really want to do an article on Smart cards, but at this time I am not
familiar enough with them. Look for it soon, however.
There are two types of spoofing, non-blind and blind. Non-blind spoofing is carr
ied out when a hacker is connected, such as by being on the same Ethernet, to a
target machine as well as to the machine the hacker wishes to spoof. Being on th
e same network, the hacker can predict the responses from the computer under att
ack. Makes sense.
In non-blind spoofing, the hacker has the advantage of knowing whether or not th
e machine under attack is online and whether it needs to be removed from the net
work while spoofing. Inside information is always helpful when hacking, I suppos
e.
In blind spoofing, the hacker is not connected to the target machine.
A TCP connection is made after a three-way handshake. For example, suppose that
X, T, and A are respectively, the target machine, the trusted machine (a machine
on the same network), and the attacker. When a TCP connection is being establis
hed between X and T, a handshake occurs, as shown in Table 3:
Table 3: The 3 way handshake
Don't be alarmed if this looks complex, it is not.
SYN and ACK are the TCP flags set by the machines. Seq#. C1 is a random sequence
number generated by the client T and sent to X. While replying to the network m
essage, X sends back this number increased by 1 as C1 + 1 and another sequence n
umber S1 that the server itself generates. The client then sends back C1 + 1 as
well as S1 + 1. This allows both the client and the server to ensure that the ma
chines are familiar with each other's numbers.
Suppose the attacking machine A spoofs machine T and sends the first packet. Whe
n the second return packet is sent by the server, A cannot view the sequence num
ber because the packet is sent to the real machine T. The hacker needs to guess
S1 and sends an ACK packet back to X with the correct sequence number.
There is one more problem associated with this scenario. When T receives a SYN+A
CK packet for a connection it did not initiate, T sends a reset signal back to X
instructing it to close the connection. In this case, the hacker first has to s
poof T and send a broadcast message to all the machines on the network, promptin
g a response. After this happens, T gets flooded with responses terminating anym
ore incoming connections. It will not see the SYN, ACK packet coming to it from
X.
When T is off the network, the hacker can start predicting the sequence numbers
that the server will send. The hacker can do this by performing a few legitimate
connections from A to X, without spoofing to check the pattern of the numbers b
eing generated and then spoof T and start sending the packets.
Hope I didn't screw up any letters in that scenerio! Ugh...Maybe a diagram will
help.
This type of spoofing is carried out either on an internal network or on the Web
itself.
For example, while browsing chat rooms or forums on the Web, you come across pos
ts that inform you of a highly recommended Windows security patch that you shoul
d apply immediately to secure your systems from attacks. If you click the link,
you are taken to http://www.micr0sOft.com/technet/security/q874787.asp. The tric
k in this case is that the URL points not to the actual Microsoft Corporation's
Website but to a cleverly disguised site run by the spoofer. Note that the lette
r O in Microsoft in the above URL is actually zero and you are taken to a differ
ent site.
When you are at this site, which has been made to look exactly like the Microsof
t site, you may be tempted to download the security patch offered. This patch wo
uld most probably be a Trojan horse that would install like a normal security pa
tch. It might install some hidden programs on your computer to monitor it and oc
casionally send out sensitive information to the hacker such as passwords, machi
ne information, and other data.
You can be fooled into all sorts of stuff if you are not careful!
Figure 24 depicts server spoofing, which involves pointing the victim to the hac
ker's own server instead of a real one:
Damn, some of my papers in school were not this long. I really enjoyed writing t
his one, as always, I learned a lot. And I hope you did, too. My intention here,
I will say it again, was not to educate you on how to hack, but to promote safe
networking habits.
Until the next one...
________________________________________________________________________________
____________________________________________
I've been working on this article for over 4 days now. I have compiled a number
of resources that you may want to reference (as I did).
Books:
Special OPS: Host and Network Security for Microsoft, UNIX, and Oracle
Microsoft Windows 2000 Server Deployment Planning Guide
Computer Security Handbook, Fourth Edition
Network Perimeter Security: Building Defense In-Depth
Network+ Certification Training Kit
Internet Security and Firewalls