Unit I Notes
Unit I Notes
Ethical hacking refers to the practice of intentionally probing systems, applications, and
networks for security vulnerabilities to enhance their security. Ethical hackers, also known as
white-hat hackers, use the same techniques as malicious hackers but with legal and ethical
intentions to improve cybersecurity. They help organizations identify and fix weaknesses
before cybercriminals can exploit them.
Vulnerability: Think of a vulnerability as a crack in your system's armor. It's a weakness that
can be exploited. Examples include outdated software, misconfigured firewalls, or weak
passwords.
Exploit: An exploit is the tool or technique used to take advantage of a vulnerability. It's like
the key that unlocks the crack in the armor. Exploits can be code, scripts, or even social
engineering tricks.
Threat: A threat is anything that could exploit a vulnerability. It's the potential danger. This
could be a malicious hacker, a virus, or even a natural disaster.
Risk: Risk is the potential for loss or damage if a threat exploits a vulnerability. It's the
combination of the likelihood of an attack and the impact it would have. A high-risk
vulnerability is one that's easy to exploit and would cause significant damage.
Attack: An attack is an attempt to exploit a vulnerability. It's the actual action taken by a
threat actor. An attack might be successful or unsuccessful.
Payload: The payload is the malicious code that's delivered by an exploit. It's what the
attacker wants to achieve, such as stealing data, installing malware, or disrupting services.
The CIA triad is the cornerstone of information security. It represents the three core
principles that should be protected:
Example: A bank encrypts customer transactions so only authorized users can view them.
Integrity: This guarantees that information is accurate and hasn't been tampered with. It's
like ensuring that the information hasn't been altered or corrupted. Techniques used to ensure
integrity include:
o Hashing Algorithms: Creating a unique fingerprint of the data that changes if the data is
modified.
o Digital Signatures: Using cryptography to verify the authenticity of data and its source.
o Version Control: Tracking changes to data and allowing for rollback to previous versions.
Example: A digital signature verifies that an email has not been tampered with.
Availability: This ensures that authorized users can access information and resources when
they need them. It's like making sure the information is always accessible. Techniques used
to ensure availability include:
o Redundancy: Having backup systems and data in case of failure.
o Failover Systems: Automatically switching to a backup system if the primary system fails.
o Disaster Recovery Plans: Procedures for restoring systems and data after a disaster.
Example: Cloud services use backup servers to prevent downtime during a failure.
3. Types of Hackers:
White Hat Hackers (Ethical Hackers): These are the good guys. They use their skills to
find vulnerabilities with permission from the system owner. They report their findings so the
vulnerabilities can be fixed. Ethical hackers play a crucial role in improving cybersecurity.
Black Hat Hackers (Crackers): These are the bad guys. They exploit vulnerabilities for
personal gain or to cause damage. Their motives can include financial gain, revenge, or
simply the thrill of the challenge.
Grey Hat Hackers: These hackers operate in a grey area. They might find vulnerabilities
without permission, but they typically don't have malicious intent. They might publicly
disclose the vulnerability or inform the owner, sometimes demanding a reward.
Script Kiddies: These are novice hackers who use pre-written hacking tools without
understanding how they work. They often lack the skills to develop their own exploits.
1. Reconnaissance (Information Gathering): This is the first step, where the ethical hacker
gathers information about the target system. This can include network topology, operating
systems, applications, and even employee information. This is like a detective gathering
clues.
2. Scanning: In this phase, the ethical hacker uses tools to scan the target system for open ports,
services, and vulnerabilities. This is like checking the doors and windows of a building for
weaknesses.
3. Vulnerability Assessment: The identified vulnerabilities are analyzed to determine their
potential impact. This involves assessing the likelihood of exploitation and the potential
damage. This is like prioritizing the weaknesses found in the scanning phase.
4. Exploitation: The ethical hacker attempts to exploit the vulnerabilities to gain access to the
system. This is done in a controlled environment and with permission from the system owner.
This is like testing if the unlocked doors really lead inside.
5. Post-Exploitation: Once access is gained, the ethical hacker might try to maintain access and
gather further information about the compromised system. This is like exploring the inside of
the building after gaining access.
6. Reporting: The final step is to document all the findings and provide recommendations for
remediation. This report is crucial for the system owner to fix the vulnerabilities and improve
security. This is like the detective presenting their findings and recommendations.
Kali Linux is a specialized Linux distribution designed specifically for penetration testing and
digital forensics. It comes pre-installed with hundreds of security tools, making it a popular
choice for ethical hackers. It's like a complete workshop for cybersecurity professionals.
Kali Linux is a Debian-based operating system designed for penetration testing and ethical
hacking. It includes over 600 pre-installed security tools for:
Pre-installed Security Tools – Comes with Metasploit, Nmap, Burp Suite, and many
more.
Customizable – Allows users to modify and optimize tools for specific needs.
Live Boot and Persistent Mode – Can be run from a USB without installation, with
an option to save data.
Regular Updates – Frequently updated with the latest security patches and tools.
Open Source – Free to use and widely supported by the cybersecurity community.
Commonly Used Kali Linux Tools:
2. User Management
4. Networking Commands
ifconfig / ip a → Show IP address
ping <website> → Check network connectivity
netstat -tulnp → Show active network connections
nmap <IP> → Scan a network for open ports
wget <URL> → Download a file
Network Scanners:
Nmap: A powerful and versatile network scanner used for port discovery, service
identification, OS detection, and vulnerability scanning. It's a foundational tool for
network pentesting.
Masscan: A fast, asynchronous network scanner designed for scanning large networks
quickly.
ZMap: Another fast network scanner optimized for large-scale scans.
Vulnerability Scanners:
Wireshark: A powerful and widely used network protocol analyzer for capturing and
analyzing network traffic. Essential for understanding network communications and
identifying potential issues.
tcpdump: A command-line packet capture utility.
Exploitation Frameworks:
Web applications are a frequent target for attackers because they often handle sensitive data.
Web application penetration testing focuses specifically on identifying vulnerabilities in web
applications, such as websites, web portals, and web-based APIs.
This type of pentest looks for vulnerabilities like SQL injection (where an attacker
can inject malicious SQL code to manipulate a database), cross-site scripting (XSS,
where an attacker can inject malicious scripts into a website), cross-site request
forgery (CSRF, where an attacker can trick a user into performing unwanted actions),
authentication bypasses, and insecure direct object references.
Web application pentests use specialized tools and techniques to analyze the
application's code, functionality, and behavior. They might involve fuzzing (sending
unexpected input to the application), analyzing HTTP requests and responses, and
attempting to exploit known vulnerabilities.
Example: A web application pentest might try to exploit an SQL injection
vulnerability to steal user data from a database. Or, it might try to exploit an XSS
vulnerability to inject malicious code that steals user cookies.
Web Proxies:
o Burp Suite: A comprehensive web application security testing platform. It acts
as a proxy, allowing you to intercept and modify HTTP requests and
responses. Essential for web app pentesting.
o OWASP ZAP (Zed Attack Proxy): An open-source web application security
scanner.
Vulnerability Scanners:
o Acunetix: A commercial web vulnerability scanner.
o Netsparker: Another commercial web vulnerability scanner.
Fuzzers:
o wfuzz: A web fuzzer used to discover vulnerabilities by sending unexpected
input to web applications.
o ffuf: A fast web fuzzer written in Go.
Browser Developer Tools: Built-in browser tools are crucial for inspecting web page
elements, network traffic, and JavaScript execution.
With the increasing use of mobile devices, mobile application penetration testing has become
crucial. This type of pentest focuses on identifying vulnerabilities in mobile applications
running on platforms like Android and iOS.
Mobile app pentests assess the security of the app's code, data storage,
communication protocols, and interactions with other systems. They check for
vulnerabilities like insecure data storage, insecure communication, improper
authorization, and vulnerabilities in third-party libraries.
Mobile app pentests might involve static analysis (examining the app's code without
running it), dynamic analysis (analyzing the app's behavior while it's running), and
reverse engineering (disassembling the app's code to understand how it works).
Example: A mobile app pentest might try to exploit an insecure data storage
vulnerability to access sensitive data stored on the device. Or, it might try to intercept
network traffic to identify insecure communication between the app and a server.
This type of pentest evaluates the effectiveness of security awareness training and the
ability of employees to resist social engineering tactics. It tests how easily employees
can be tricked into giving up passwords, clicking on malicious links, or revealing
confidential information.
Social engineering pentests can involve phishing emails, pretexting (creating a
believable scenario to trick someone), baiting (offering something tempting to lure
someone), and quid pro quo (offering a service in exchange for information).
Example: A social engineering pentest might involve sending phishing emails to
employees to see who clicks on the malicious link. Or, it might involve calling
employees and pretending to be from IT support to try to get their passwords.
Physical penetration testing simulates real-world attempts to gain physical access to a facility
or system. It tests the effectiveness of physical security controls, such as locks, fences,
security cameras, and access control systems.
This type of pentest evaluates the security of physical barriers, access control systems,
surveillance systems, and the ability of security personnel to detect and respond to
unauthorized access attempts.
Physical pentests might involve attempting to bypass physical security controls, such
as picking locks, climbing fences, or impersonating authorized personnel. They might
also involve social engineering tactics to gain access to restricted areas.
Example: A physical pentest might involve trying to bypass a card reader to gain
access to a server room. Or, it might involve trying to tailgate (follow an authorized
person) through a security door.
Lock Picking Tools: Sets of picks and tools for opening various types of locks.
Bump Keys: Special keys designed to open certain types of locks.
Master Keys: Keys that can open multiple locks within a system.
RFID Cloning Tools: Tools for cloning RFID cards and fobs.
Security Camera Jamming Devices: Devices that can disrupt the signals from
security cameras (use with extreme caution and only where legally permissible).
Penetration Testing Kits: Kits containing a variety of tools for physical penetration
testing.
Raspberry Pi/Arduino: Small, programmable devices that can be used for various
physical penetration testing tasks.