Hacking - 101 Hacking Guide 2nd
Hacking - 101 Hacking Guide 2nd
Contents
Introduction
Chapter 1: What is Ethical Hacking?
Chapter 2: Basic Terminology
Chapter 3: Types of Attacks
Chapter 4: Types of Tools
Chapter 5: Hacking Passwords
Chapter 6: Accessing Ports
Chapter 7: Penetration Testing
Chapter 8: Unix
Chapter 9: Where do I Go from Here?
Conclusion
Introduction
I want to thank you for downloading the book, Hacking: A 101 Hacking Guide. This book is for
absolute beginners who want to learn about ethical hacking by starting with a solid foundation.
Written in a down to earth style, this book contains the key terms and concepts you need coupled with
links to online resources that let you build your skills outside the book.
Here is what you will be able to do the end of this book:
Be able explain the difference between an ethical hacker and a non-ethical hacker,
including goals and motivations
Discuss why ethical and non-ethical hackers use the same tools
Know the difference between an attack, a threat, and a vulnerability
Have a solid understanding of the basic terminology you need to study hacking
Understand the different methods used to crack passwords
Be familiar with the different types of attacks
Learn the types of tools used by hackers
Understand how port scanning works
Know the steps involved in penetration testing
Learn why Unix is popular with hackers
Get some tips on how to keep building your skills
Thank you again for downloading this book. I hope you enjoy it!
recognize that it isn t real. When they access it, just like a fish taking the bait, they have just given
their information over to a hacker.
Port scanning involves determining which ports on a system are open and what services are running
on them. Open ports are vulnerable to attack.
Spam means Spiced Ham in the supermarket, but in the cyber universe it means to harass someone (or
something) by sending an onslaught of unwanted messages or requests. A spammer is someone who
practices this annoying art.
To hackers, spoofing refers to pretending to be someone or something else in order to obtain in
formation. One example is email spoofing, for example, where an email is sent out pretending to be
from a credit card company and requesting that you follow the link and enter your credit card number
to access vital information about your account. The goal is to obtain information from targets.
Another type of spoofing is IP spoofing, where a computer appears to other to have one IP address,
when it actually has a different one.
Spyware is a particular devious piece of software whose entire goal is to send someone a continuous
flow of information about their target, without the target being aware. People usually think spyware
is limited to computers, but spyware can be on your cell phone, too.
Another type of attack involves taking advantage of a bug in a program. As a simplistic example,
let s say program A has this one bug that if a certain variable named STARGATE ever exceeds 400
it will erase everything in your My Documents folder. However, when the developers checked out
the bug, they determined that there is no way that STARGATE will ever exceed 400, but they are
working on a patch to fix problem. A black hat hacker learns of this bug before the patch comes out,
and figures out how to convince the program that STARGATE has a value of 501. You can image the
rest! That s why software is continually checking for updates, fixes, patches, etc.
Attacks are often classified as active or passive. A good example of an active attack is denial of
service: you can tell when you are being attacked because your computer or server grinds to a halt.
For passive attacks, packet sniffing and key loggers are excellent examples: something that could be
intercepting your data without you even knowing it. Spyware and port scanning are usually passive
attacks, also.
Firewalls and virus protection software are a first line of defense against many attacks, but require
regular updating to keep up with new threats that appear. Keep in mind that skilled hackers know
how the protection works! Many of the computer security software companies provide up-to-date
information about current threats, which is something any hacker should be knowledgeable about. For
example, McAfee provides statistics, a world map, and region specific virus information.
In the United States as of June 2014, Statista.com reported that the majority of cyber attacks against
US companies took the form of viruses, trojans, and worms, followed by malware and botnets.
Online Resources:
Cyberattacks against US Companies: http://www.statista.com/statistics/293256/cyber-crime-attacksexperienced-by-us-companies/
US Adult Victims to Online Attacks: http://www.statista.com/statistics/294684/online-adult-cyber-
crime-victimization/
McAfree Virus Information: http://home.mcafee.com/virusinfo?ctst=1
Norton Internet Security Information: http://us.norton.com/security_response/
for how much information a packet sniffer can get, I recommend you visit their website listed at the
end of the chapter. Another is called, aptly enough, Snort.
A payload is the program that a hacker runs after successfully gaining access to a system. Keep in
mind that most hackers have a purpose for breaking into a system: it may be download files, add
themselves as a new user, etc. The payload is what accomplished that purpose.
There are other tools, of course, but this list gives you a basic overview of the tools most often used
by hackers. In the online resources below, you will find links to the specific tools discussed in this
chapter.
Online Resources:
NetworkMiner:
http://www.netresec.com/?page=NetworkMiner
Snort:
http://www.snort.org
Shellcoding Tutorial:
http://www.vividmachines.com/shellcode/shellcode.html
Social Engineering:
http://www.social-engineer.org/
Tortilla:
http://www.crowdstrike.com/community-tools/
JonDo:
https://anonymous-proxy-servers.net/en/jondo.html
Guessing
Another method of figuring out someone s password is simply guessing, based on what they can tell
about the person, including items on their desk or in their line of sight, birthdays of family members,
names of pets, etc. That is why we are often burdened with what seems like outrageous password
requirements: to prevent others from simply guessing our password.
Weak Authentication Requirements
Many older operating systems could bypass the login requirements by pressing Escape, and some
newer systems will allow you to login to the physical computer but not the network by pressing a
certain key. Phones and tablets without a password are also wide open to such simple attacks. These
are known are weak authentication requirements. Passwords that are too simple, or contain words
form the dictionary or maybe your username, are also examples of weak authentication.
Password Cracking Software
There are many software tools out there for assistance in cracking passwords, such as Ophcrack or
John the Ripper. There are also websites that list default passwords that come with well-known
software, and dictionaries of words that can be used in cracking a password. That s why some
password requirements insist that you don t use words that can be found in the dictionary!
Online Resources:
Ophcrack: http://ophcrack.sourceforge.net/
Ophcrack Walkthrough: http://pcsupport.about.com/od/toolsofthetrade/ss/ophcracksbs.htm
Default Passwords: https://cirt.net/passwords
Refog Keylogger: http://www.refog.com/
John the Ripper: http://www.openwall.com/john/
Based on what we see, the website www.hackthissite.org has the IP address 198.148.81.139.
To determine if they are online, ping the IP address. If the IP address responds, then it is online. Here
is the command: ping 198.48.81.139
The next task is to scan the ports. If you are working with Unix, you can write a script to accomplish
this. If you are not adept at programming and/or using a Windows system, there is software available
that will do the port scans. For demonstration purposes, this example will use a free online port
scanner at http://mxtoolbox.com/PortScan.aspx
You start by typing in the IP address, then click Port Scan.
You will notice that ports 21 and 80 are open. These are the SSH and HTTP ports.
The next job is to access the open ports. In a Windows environment, you will need to use the
command telnet. You may have to install it as a Windows component from the Control Panel. In
newer versions of Windows you will need to go to Programs and Features Turn Windows Features
On or Off and then check the boxes next to Telnet Server and Telnet Client.
Type in this command at the command prompt: telnet 198.148.81.139 22
You will notice that you type in the IP address followed by the number of the port you are wanting to
access. Normally you will be asked to provide a username and password, which is another
challenge.
You have just learned the basics of running a port scan but what do we use that information for?
On to the next chapter!
Online Resources:
Online Port Scanning Tool: http://mxtoolbox.com/PortScan.aspx
What s My IP Address: http://whatismyipaddress.com/
Just as an example, I am going to type in snopes.com (a well-known website for debunking hoaxes
and investigating internet rumors).
As you can see, www.snopes.com is running Linux.
Once you have finished the reconnaissance stage and have the IP addresses, they feed directly into the
scanning stage, which starts with scanning the ports at the given IP addresses. Once open ports and
the services running on them have been identified, then vulnerability scanning takes place. This was
discussed in the previous chapter on ports, however we will take some time to discuss a few of the
tools available. The first is the Angry IP Scanner, which works on just about any platform you need
and can export the IP scan data to a variety of file formats. NMap is another very powerful scanner,
which comes with most modern Linux system, but is available for Windows also.
Once you know what ports are open and what their vulnerabilities are, you begin the exploitation
stage. The end goal of this step is to obtain administrative access over your target. This can happen
remotely (from a different physical location) or locally.
Now, what exactly does administrative access mean to a hacker? It means the or she can take down
the remaining defenses, install and run their own code, corrupt or delete files, make copies of files,
and more.
After the hacker has administrative access, his or her payload (the program that gives the access to
the command line) is deployed. Image you are a thief, and you found an unsecured window in your
targets home. The payload is the tool you use to get the window open just enough to get in, but to
carry anything out you need a bigger opening. This leads to the phase of maintaining access, where
the hacker would modify security settings, set themselves up as a user, etc. to keep that access open
long enough to accomplish their task.
As a white hat ethical hacker, the only time you do penetration testing is to reveal the weaknesses in
the system so it can be strengthened, not to take advantage of it. As part of strengthening the system,
the ethical hacker will create a detailed report of how they gained access, a discussion of weaknesses
discovered, and recommendations/solutions for eliminating those weaknesses.
Online Resources:
HTTrack: https://www.httrack.com/
Harvester: http://www.edge-security.com/theharvester.php
WhoIs: https://whois.net/
Netcraft: http://www.netcraft.com
Angry IP Scanner: http://angryip.org/
Nmap: https://nmap.org/
Nmap examples: http://www.tecmint.com/nmap-command-examples/
Chapter 8: Unix
Now that you have a good grasp of the concepts and methods behind white hat hacking, you can start
building your hacking skills. If you aren t already familiar with Unix, it s time to learn it. Unlike
Windows, Unix is an open source operating system, which means that you can actually look at and
modify all the code that was written to create it.
Imagine you are a mechanic, or at least a budding mechanic, and you purchase a car. You start
hearing some strange noises from the engine, so you decide to pop the hood to take a look. However,
when you try to pop the hood you find it welded shut! You can t even change the oil without going
through the car manufacturer to have it done. Fortunately, cars aren t like that but some operating
systems are!
Unix is more like a car: you can pop the hood, look around at the source code, find out how it works,
make changes to see what happens, and more.
Unix comes in so many different flavors: Unix, Linux, Kali, Fedora, FreeBSD, Ubuntu the list
keeps growing. Just like ice cream, hackers have their own favorite flavor of Unix. However, Kali
seems to be quite popular because of its support for penetration testing.
Unix operating systems are usually free, too, and have exhaustive documentation available on the
web. Since Unix is open source, many of the tools developed for it are also open source and free.
There is still another reason why you should learn Unix: some of the best hacking tools are open
source and originally written for Unix. Once you learn how to use them, and become familiar with
Unix, you can modify them or start developing your own tools.
When you download Unix, you will probably be downloading it as an .ISO file, which you can burn
to a CD or copy to a flash drive. This is the full image you need for installation.
If you don t have a computer to laptop that you can dedicate to just running Unix, there are other
options. One is VirtualBox, that lets you run Unix through a virtual machine on your computer, or just
from the CD drive or flash drive (you can t make any permanent changes to settings, Unix source
code, etc. this way, but you can experiment).
Another cool option just for learning how to use Unix is one of the online Unix simulators. Coding
Ground offers a Unix shell simulator, as well as just about any other kind of online simulator you need
to learn a programming language.
As a hacker, you will spend a good deal of your time working with the Unix CLI, or Command Line
Interface. With a command line interface you type in your commands and instructions, as opposed to
working with a GUI, or Graphical User Interface.
Using the CLI, you can do everything you do with a GUI, like copying files from one directory to
another, or searching through files and placing copies of only the files that have the
word chapter in them into a new directory.
Once you get the hang of Unix, its time to learn how to write shell scripts. As is typical in Unix, there
are a variety of shells out there, with bash (Bourne Again Shell) being popular among hackers. A
shell script is similar to a program that includes operating system commands, and hackers use them
not just to develop hacking tools, but also to automate boring, repetitive tasks that require interfacing
with the operating system.
There are a tremendous number of sites with tutorials and examples for writing shell scripts, and if
you already know how to program, then you will find it quite easy to work with.
Be sure to check out the online resources for links to some of the popular flavors of Unix, as well as
excellent tools to help you learn how to use Unix effectively.
Online Resources:
Unix: http://www.unix.org/
Linux: https://www.linux.com/
https://www.kali.org/
Fedora: https://getfedora.org/
FreeBSD: https://www.freebsd.org/where.html
Ubuntu: http://www.ubuntu.com/
VirtualBox: https://www.virtualbox.org/wiki/Downloads
Coding Ground: http://www.tutorialspoint.com/codingground.htm
JSLinux: http://bellard.org/jslinux/
How to Write Bash Programs:
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Conclusion
Thank you again for downloading this book!
I trust this book has helped you learn the basics of ethical hacking, and that you enjoyed learning it,
too. You know have a good foundation to build on, and I wish you the very best!
Finally, if you enjoyed this book, then I d like to ask you for a favor. Would you be kind enough to
leave a review for this book on Amazon? It d be greatly appreciated!
Check out my other books on Amazon: