Ethical
Ethical
B. Risk: Risk is defined as the possibility or chance that a danger may materialize or
occur. It consists of three main components: threats, vulnerabilities, and assets.
2. Threat: A threat is any agent, circumstance, or situation that has the potential to
cause harm or loss to an IT asset. Threats can be many different things, and they are
not always easy to identify. A threat in cyber security is any potential danger that
can harm a computer system, network, or data. It can come from different sources,
including hackers, malicious software, system vulnerabilities, or even human
mistakes.
2. Integrity: Integrity ensures that data remains accurate, consistent, and unaltered by
unauthorized individuals. This means that information should not be changed, modified, or
deleted in an unauthorized or accidental manner. To maintain integrity, organizations use:
Checksums & Hashing, Digital Signatures, Data Backups
3. Availability: Availability ensures that data, applications, and IT resources are accessible
when needed by authorized users. If systems go down due to cyber-attacks, hardware
failures, or natural disasters, it can disrupt business operations and cause financial losses. To
ensure availability, organizations implement: Redundant Systems & Backups, Disaster
Recovery Plans, Load Balancing, DDoS Protection.
1. Phishing Attacks: A phishing attack is one of the most common ways hackers
trick people. It works by pretending to be a trusted source, like a bank, social media
platform, or well-known company, to steal personal information. The theory behind
phishing is based on social engineering, which means manipulating people into revealing
confidential details. For example, if you receive an email that looks like it's from your
bank, saying your account has been locked and you need to click a link to unlock it, you
might panic and enter your login details. However, the website is fake, and the hacker
now has your password. Prevention: Be cautious of suspicious emails, verify the
sender, and avoid clicking on unknown links.
5. SQL Injection (SQLi): A SQL Injection attack is a method hackers use to break
into websites by inserting malicious code into a database query. The theory behind this
attack is that websites with weak security don’t properly check user inputs, allowing
hackers to manipulate the database and access sensitive information. For example, if a
website has a login form, a hacker can enter a special code instead of a username and
password, tricking the website into granting access to all user data. This type of attack is
dangerous because it can expose personal information, such as usernames, passwords,
and even financial records. Prevention: Use input validation, parameterized queries,
and secure coding practices.
6. Brute Force attack: A Brute Force attack is when hackers try to guess passwords
by testing different combinations until they find the correct one. The theory behind this
attack is that many people use weak or common passwords, making it possible to guess
them using automated tools that try thousands of passwords per second. Imagine trying
every possible combination to unlock a suitcase with a number lock—eventually, you will
find the right one. Hackers use this method to break into online accounts, especially
when people use simple passwords like "123456" or "password."
4. Maintaining Access: An ethical hacker tries to hold onto access to the target
until they have finished the tasks they intend to finish in that target. If a hacker gains
access, they choose to keep it for future exploitation and attack. They also choose to
use the organization's Rootkits and Trojans to carry out more network attacks.
5. Clearing Tracks: After gaining access, the hacker leaves no trace in order to
evade detection by the security team. They accomplish this by erasing all traces of
their activity, including cookies and cache, tampering with log files, and blocking all
open ports. This includes some of the methods an ethical hacker uses to hide and
remove their evidence, such as erasing or corrupting all logs, altering the values of
logs or registries, removing all of the folders they created, and uninstalling all of the
applications.
Q.4 Hacktivism
Hacktivism is a combination of the words "hacking" and "activism." It refers to the
use of hacking techniques to promote political or social causes. Hacktivists are
individuals or groups who use their technical skills to break into computer systems,
websites, or networks to send a message, raise awareness, or disrupt services in
support of their cause.
A. Hacker Classes:
Hacking refers to gaining unauthorized access to a system, network, or device.
However, not all hacking is illegal or harmful. Some hacking is done to improve
security, while others are done for criminal purposes. Below are the different types of
hacking explained in an easy-to-understand way.
Computer networking: Ethical hackers need to understand how data moves across
networks, how computers communicate, and how attackers exploit vulnerabilities in
network protocols. Learning about IP addresses, ports, firewalls, VPNs, and wireless
security is crucial because hackers often target networks to gain access to sensitive
data.
Programming and scripting: Programming and scripting skills are also important
Hackers often exploit software vulnerabilities, so ethical hackers need to understand
how software works. Learning languages like Python, C, C++, and JavaScript helps in
writing hacking scripts, automating security tasks, and analysing malicious code. SQL
is also useful because databases are a common target for attacks, such as SQL
injection.
Security tools and hacking techniques: To test and strengthen security, ethical
hackers use various security tools and hacking techniques. Tools like Nmap help in
scanning networks, Metasploit is used for testing exploits, and Wires hark allows
analysing network traffic. These tools help ethical hackers identify weaknesses and
suggest fixes before cybercriminals take advantage of them.
1. Foot printing: The initial stage of ethical hacking, also referred to as the foot
printing and information gathering phase is called reconnaissance. Here, a hacker
tries collecting various kinds of data, such as employee information, IP addresses,
network topology, and domain names, using active and passive approaches. The
purpose is to create a diagram of the target’s digital and physical assets. There are
two primary types of foot printing:
Search Engine Information Gathering – Hackers use Google, Bing, or other search
engines to find company details, employee names, leaked credentials, and sensitive
files.
Social Media Profiling – Information from LinkedIn, Twitter, Facebook, and other
platforms can reveal employees, job roles, and company operations.
WHOIS Lookup – Used to find details about domain registrations, such as the owner’s
name, contact information, and IP addresses.
2. Active Footprinting : Active footprinting is the process of directly engaging with the
target system, network, or organization to collect detailed information. This information
can include: IP addresses, Open ports, Running services, Network topology, Operating
systems, Vulnerabilities.
Ping Commands – Used to check if a system is online and measure response time,
which helps in network mapping.
Port Scanning – Identifies open ports and active services on a target system, using
tools like Nmap.
Traceroute (Tracing Network Path) – Determines the path data packets take from
the hacker’s computer to the target, revealing network infrastructure and security
devices.
Email Tracking – Extracting information from email headers to find IP addresses, mail
servers, and recipient locations.
2. Scanning
After gathering information through foot printing, the next step in hacking is scanning. Scanning is the
process of examining a target system, network, or website to find security weaknesses that can be
exploited. Scanning is used by both ethical hackers (to strengthen security) and black-hat hackers (to
find ways to attack).
1. Network Scanning – Checking networks for live hosts, open ports, and connected devices.
2. Port Scanning – Identifying open ports and active services running on a target system.
3. Vulnerability Scanning – Looking for known weaknesses in systems, software, or networks.
How it works? Attackers send packets (small data requests) to different devices
and wait for a response. If a device responds, it means it is online and can be
explored further.
Tools for network scanning include Wireshark, Advanced IP Scanner, and Angry IP Scanner.
2. Port Scanning
🔹 how it works? Hackers send requests to different ports on a target system. If the
port responds, it means it is open and can be attacked.
🔹 Tools Used: Nmap – Identifies open ports and running services., Netcat – Helps hackers test open
ports.
3. Vulnerability Scanning
Tools Used: Nessus – One of the best vulnerability scanners., OpenVAS – Open-
source vulnerability scanning tool.
Techniques of Enumeration
1. DNS Enumeration: This technique focuses on gathering information about a
target's Domain Name System (DNS) records. By querying a target’s DNS records, an
attacker can get information like IP addresses, mail servers, subdomains, and other
network infrastructure details. This information helps to map out the target’s
infrastructure and find entry points for further attacks.
Email tracking is a technique used to monitor if and when someone opens an email, clicks on links inside
it, or interacts with attachments. It is commonly used in marketing, customer service, and cyber security
to understand how recipients engage with emails. However, hackers and cybercriminals also use email
tracking for phishing, spying, and malicious activities.
There are several ways email tracking works. One common method is embedding a tracking pixel, which
is a tiny, invisible image inside an email. When the recipient opens the email, the pixel loads from a remote
server, and the sender receives a notification that the email was read. Another method involves tracking
unique links in the email. If a recipient clicks on a link, the sender can track their activity and sometimes
even get access to their browsing behaviour.
To protect against email tracking, people often disable automatic image loading in their email settings,
use email privacy tools, or open emails in plain text mode. Some security-conscious users also use
temporary or anonymous email addresses to avoid being tracked.
A ping is a network tool that sends a message (ICMP Echo Request) to another computer or device on a
network to see if it's reachable. The device that receives the ping responds back with an ICMP Echo Reply
if it’s online and active. A ping sweep is when you send ping requests to multiple IP addresses within a
network (or a range of IP addresses) to check which devices respond back. This helps you figure out which
devices are active on the network.
For example: If you're working with a local network that has the IP range 192.168.1.1 to 192.168.1.255, a
ping sweep would send pings to all IP addresses in that range and wait for responses to determine which
addresses are currently active (which devices are online).
This command will send pings to all IP addresses in the range 192.168.1.1 to
192.168.1.254.
In IP spoofing, attackers modify the source IP address in the packet header, so it looks like
the packet is coming from a different source. How Does IP Spoofing Work?
1. Every device on the internet has an IP address, kind of like a phone number or home
address.
2. When data is sent (in a packet), it includes the sender’s IP address (called the source
IP).
3. In IP spoofing, the attacker changes the source IP address in the packet to make it
look like it's coming from a trusted source.
Before performing SNMP enumeration, you need to identify which devices on the
network support SNMP. These could be routers, switches, servers, printers, or other
networked devices that have SNMP agents running. Tools like Nmap can help
identify devices running SNMP by scanning for open SNMP ports (typically port 161).
Example Nmap command to check SNMP: nmap -p 161 192.168.1.1
SNMP has different versions (e.g., SNMPv1, SNMPv2c, SNMPv3). The version you use
will affect how you send requests and what features are available. The most common
versions are:
SNMPv1 and SNMPv2c: These are older and less secure because they transmit
data without encryption or authentication.
SNMPv3: More secure, supporting authentication and encryption.
How to Identify the SNMP Version: You can use Nmap or a tool like
Snmpwalk to try different versions.
In SNMP, a community string is like a password that controls access to the SNMP
data on a device. There are two types of community strings:
By default, many devices have weak community strings like public for read-only and
private for read-write. If an attacker can guess these community strings, they can get
access to sensitive information.
Once you've identified the SNMP version and community string, the next step is to
perform an SNMP walk. An SNMP walk is a process where you query the SNMP
device to get all of its available information by asking for the entire MIB
(Management Information Base) tree or specific pieces of information.
MIB (Management Information Base): The MIB is like a dictionary that defines
what data the SNMP agent can provide (e.g., CPU usage, memory stats, device
name).
Once the SNMP walk is successful, you can begin collecting valuable information
from the responses. Here are some common types of information you can gather
during SNMP enumeration:
1. System Information: This includes the device name, description, uptime, and
contact details.
2. Network Configuration: Includes IP addresses, routing tables, network
interfaces, etc.
3. Device Performance Data: Metrics like CPU load, memory usage, network
traffic, and disk usage.
4. Users and Services: Information about users, passwords (if they are
exposed), running services, and more.
5. MIB Data: Information from the device's MIB, which could include anything
from hardware details to running software versions.
After performing the SNMP enumeration and collecting the data, you analyse it to
identify weaknesses or sensitive information.
For network administrators, after completing SNMP enumeration, you may decide to
take action to secure the devices.
UNIT-2
Chapter-5 System Hacking
Q.1Five Common Password Cracking Techniques or Web-Based Password
Cracking Technique
1. Brute Force Attack: A brute force attack is one of the simplest but most time-
consuming methods of cracking passwords. It involves trying every possible
combination of characters until the correct password is found. This technique does
not rely on any prior knowledge of the password and works best against weak or
short passwords. Modern brute force attacks use automated tools that can attempt
thousands or even millions of combinations per second. However, longer and more
complex passwords significantly increase the time required to crack them.
5. Rainbow Table Attack: A rainbow table attack is a more advanced method used
to crack encrypted passwords stored as hashes. Instead of trying to guess a
password directly, hackers use a precomputed table of hashed passwords and
compare them against the stored password hashes. If a match is found, the original
password is revealed. Rainbow table attacks are effective against systems that use
weak or unsalted hashing algorithms.
Q.2Types of Passwords
Passwords are essential for securing digital accounts and systems. Different types of
passwords are used based on security requirements and ease of use. Below are the main
types of passwords:
4. One-Time Passwords (OTP): OTPs are temporary passwords that can be used only
once. They are typically sent via SMS, email, or generated by authentication apps like
Google Authenticator. They expire after a short time, making them highly secure against
reuse attacks.
5. Time-Based One-Time Passwords (TOTP): These passwords are generated based on
time and change every 30 to 60 seconds. Used in two-factor authentication (2FA), TOTP-
based passwords prevent unauthorized access even if a previous password was stolen.
Q.3 KEYLOGGERS
Types of Keyloggers
1. Installation: A hacker installs the keylogger on a victim’s device, often through phishing
emails, fake software downloads, or malicious websites.
2. Recording Keystrokes: The keylogger captures everything typed, including usernames,
passwords, messages, and credit card details.
3. Sending Data: If it's a software keylogger, it secretly sends the recorded keystrokes to the
hacker over the internet.
4. Data Theft: The hacker uses the stolen information for identity theft, financial fraud, or other
cybercrimes.
Use an Antivirus: Keep your antivirus software updated to detect and remove keyloggers.
Enable Two-Factor Authentication (2FA): Even if your password is stolen, an extra security step can
prevent unauthorized access.
Avoid Suspicious Links & Emails: Don’t click on unknown links or download attachments from untrusted
sources.
Use a Virtual Keyboard: Some online banking sites offer virtual keyboards to prevent keyloggers from
recording typed passwords.
Check for Unusual Devices: If using a public or shared computer, inspect USB ports for any suspicious
hardware keyloggers.
Keep Your Software Updated: Regular updates fix security vulnerabilities that keyloggers may exploit.
a) Key loggers: Capture and record keystrokes made by the user, potentially
capturing sensitive information like login credentials, credit card numbers, or other
personal data.
d) Webcam and Microphone Monitoring: Activate and record video or audio from the
device's webcam or microphone without the user's knowledge.
e) Location Tracking: Track the physical location of a device, often using GPS or Wi-Fi
signals, to monitor the user's movements.
j) System and Network Monitoring: Monitor system processes, network traffic, and
other system activities to gather information about the user's behaviour and usage
patterns.
Q.5Escalating Privileges
Privilege escalation is a hacking technique where an attacker gains higher access
permissions than they are supposed to have. This means the attacker starts with
low-level access (like a normal user) and escalates their privileges to gain higher
control, such as an administrator or root user. Once they get higher privileges,
they can modify system settings, access restricted data, or even take complete
control of the system.
Horizontal privilege escalation occurs when a user remains at the same privilege
level but gains access to another user’s data or account. This can happen if session
tokens are stolen, credentials are guessed, or security flaws in web applications allow
unauthorized access. Instead of aiming for administrative control, the attacker
focuses on accessing restricted user information, emails, or confidential files of other
users at the same level.
How Attackers Escalate Privileges
Q.6 Rootkits
A rootkit is a type of malware that hides deep inside a computer or phone to avoid
detection. It allows hackers to secretly control a device, steal data, or install more
malware without the user knowing. Types of Rootkits
Kernel Mode Rootkits – Hide deep in the operating system, giving hackers full control.
Boot loader Rootkits – Infect the start-up process, making them very hard to remove.
Application Rootkits – Infect programs like web browsers or word processors.
Firmware Rootkits – Hide in hardware like your motherboard or network devices.
Hypervisor Rootkits – Trick the system into running a fake version of the operating
system controlled by the hacker.
Hides Deep in the System – Rootkits are designed to stay invisible by disguising
themselves as normal files or processes.
Difficult to Detect – They disable antivirus software and system monitoring tools,
making them hard to find.
Grants Full Control – Once installed, a rootkit allows hackers to do anything on your
device, including stealing data or installing more malware.
Persists Even After Reboots – Some rootkits infect system files or hardware (like
firmware), meaning they stay active even after restarting your device.
Can Be Installed in Different Ways – They can infect a system through phishing
emails, fake software downloads, or even USB drives.
Q.7Sniffing
Sniffing is a technique used to intercept and monitor data being sent over a
network. It can be used for good (like network troubleshooting) or bad (like stealing
passwords and personal data).Think of it like eavesdropping on a conversation, but
instead of listening to voices, hackers "listen" to digital information traveling across a
network.
When you browse the internet, send emails, or enter passwords, your data travels
through a network. Hackers use special tools (called sniffers) to capture and read this
data without you knowing. If the data is not encrypted, they can easily see your
personal information. Sniffing is broadly classified into two types: Passive Sniffing and Active Sniffing.
1. Passive Sniffing: The attacker silently monitors network traffic without affecting
the system. Used in Wi-Fi hacking and spying on open networks.
2. Active Sniffing: The attacker injects malicious packets or alters network traffic to
steal information. Often used in corporate attacks.
Use HTTPS Websites – Always check for the lock symbol in the browser before entering
sensitive data.
Avoid Public Wi-Fi – Hackers often target unsecured networks. Use a VPN if necessary.
Use a VPN (Virtual Private Network) – Encrypts your data so sniffers can’t read it.
Keep Your Devices Updated – Software updates fix security holes that sniffers exploit.
ARP Poisoning (also called ARP Spoofing) is a hacking technique used to trick
computers into sending data to the wrong device. It allows attackers to steal
sensitive information, spy on network activity, or even modify data.
Think of it like this: Imagine you want to send a letter to your friend, but a thief
secretly replaces your friend’s address with their own. Now, your letter goes to the thief
instead, and they can read or change the message before forwarding it. That’s exactly
what happens in an ARP poisoning attack, but in a computer network!
In an ARP poisoning attack, a hacker sends fake ARP messages to a network. These
messages falsely associate the hacker’s MAC address with the IP address of another
device (such as a router or a target computer).
Your computer needs to communicate with the Wi-Fi router to access the
internet.
The hacker sends fake ARP messages, making your computer believe their MAC
address is the router’s MAC address.
Your computer sends all your internet traffic to the hacker instead of the router.
The hacker can now read your emails, steal login credentials, or capture
credit card details.
1. Data Theft: Hackers can steal sensitive data, such as usernames, passwords,
credit card details, and emails.
2. Session Hijacking: Attackers can take over online sessions, such as banking or
social media accounts.
3. Denial of Service (DoS) Attacks: By manipulating ARP tables, a hacker can
disrupt network communication and block internet access for users.
4. Malware Injection: Hackers can modify traffic to inject malware, ransom ware, or
spyware into a victim’s device.
DNS spoofing (also called DNS cache poisoning) is a cyber-attack where hackers corrupt the DNS
(Domain Name System) to redirect users to fake websites.
Instead of reaching the real website, users unknowingly enter their sensitive information (like passwords or
credit card details) into a fraudulent website controlled by the hacker.
When you enter a website like www.bank.com, your computer does not understand domain names. It needs
the IP address of the website.
In a DNS spoofing attack, the hacker tricks your computer into visiting the wrong website. This happens
in two main ways:
The hacker intercepts your DNS request and modifies the response.
Instead of connecting to the real website, you are redirected to a malicious site.
1. Phishing Attacks: Users are tricked into entering sensitive data on fake
websites.
4. Ransom ware Attacks: Redirecting users to malicious sites can lead to ransom
ware infections.
1. Check the Website Certificate (HTTPS): Fake websites often lack HTTPS or
show an invalid certificate warning.
1. Use Secure DNS Services: Use Google Public DNS (8.8.8.8, 8.8.4.4) or
Cloud flare DNS (1.1.1.1) for better security.
2. Enable DNSSEC (DNS Security Extensions): DNSSEC helps verify that the
DNS responses are authentic.
3. Use a VPN (Virtual Private Network): A VPN encrypts your DNS requests,
preventing MITM attacks.
Think of it like this: Imagine a restaurant where too many fake customers enter,
take up all the tables, and never order food. Real customers can’t get in, and the
restaurant can't function properly. A DoS attack does the same thing to websites
and networks—it floods them with too much traffic so real users can't access
them.
1. Volumetric Attacks: In this type, hackers send a massive amount of fake traffic to a website or network, making
it impossible for real users to access it. It’s like filling up a highway with so many fake cars that real drivers can't
move.
2. Protocol Attacks: These attacks target the communication rules (protocols) that networks and devices follow,
making them confused and unresponsive.
3. Application-Layer Attacks: These attacks don’t flood the entire network, but instead target specific functions of
a website to slow it down or crash it.
4. Distributed Denial of Service (DDoS): A DDoS attack is the most dangerous type because it comes from multiple
infected computers (botnet), making it harder to stop.
5. Teardrop Attack: A Teardrop attack confuses a computer by sending broken (fragmented) data
packets that the system struggles to reassemble. This can cause older or weak systems to crash.
The hacker chooses a website, server, or network they want to attack. The target could
be a company website, an online game, a bank, or any service that people rely on.
The hacker studies the target system to find vulnerabilities. Some websites may have
limited resources, meaning they can only handle a certain number of visitors before
slowing down. Others might have weak security settings that make them easy to
overload.
Once a weakness is found, the hacker launches the attack. There are different ways to do
this:
The server or website can’t handle the flood of fake traffic or requests. It becomes
too slow or completely stops working, making it impossible for real users to access it.
Because the system is overwhelmed, real customers, employees, or users can't access
it. This can cause huge losses for businesses, disrupt important services, and even cause
panic if critical systems (like hospitals or banks) are attacked.
Bots and botnets are tools used in cyber-attacks, often without people realizing it.
Hackers use them to steal data, spread viruses, or launch massive attacks on
websites and networks.
Bot: A bot is a computer program that can automate tasks on the internet. Some bots
are useful (like search engine bots that help Google find websites), but others are
dangerous when controlled by hackers.
Example of a Good Bot: Google uses bots to scan websites so they show up in
search results.
Example of a Bad Bot: A hacker creates a bot to steal passwords or send spam
emails.
Botnet: A botnet is a network of infected computers, phones, or IoT devices
controlled by a hacker. The hacker (called a botmaster) can use these devices
to perform cyber-attacks on a large scale.
1. Malware Infection – The hacker tricks people into downloading a virus (through fake emails, malicious websites,
or software).
2. Silent Takeover – Once infected, the device becomes part of the hacker’s botnet without the user knowing.
3. Hacker Gives Commands – The hacker controls all infected devices remotely to launch attacks, steal data, or
send spam.
In IP Spoofing, a hacker hides their real IP address (the unique number of a device on the
internet) by pretending to be a trusted device. This is often used in cyber-attacks like DDoS
attacks to make it look like the attack is coming from multiple sources. Example: Imagine
sending a letter but writing a fake return address so no one knows where it really came from.
Hackers send fake emails that look real, pretending to be from banks, companies, or even
friends. These emails trick people into clicking malicious links or giving away personal
information. Example: You receive an email that looks like it’s from PayPal, asking you to
reset your password. But when you click the link, it takes you to a fake PayPal website that
steals your login details.
3. Caller ID Spoofing
Scammers use special software to change their phone number so it looks like a call is coming
from a real company, government agency, or even someone you know. Example: You get a
call that looks like it’s from your bank, saying there’s a problem with your account. But it’s
actually a scammer trying to steal your money.
In ARP Spoofing, a hacker tricks a network into thinking they are a trusted device, allowing
them to intercept or modify internet traffic. This is often used in Man-in-the-Middle (MitM)
attacks, where the hacker secretly listens to communications. Example: A hacker sits in a
coffee shop and spies on your internet activity, stealing your login details when you connect
to public Wi-Fi.
Hackers tamper with the internet’s address book (DNS) to redirect users to fake websites
without them knowing. Example: You type "www.google.com", but instead of going to
Google, your browser takes you to a fake website controlled by hackers.
Hijacking is when a hacker takes control of something that doesn’t belong to them—like a website, an online
account, or an internet connection. This allows them to steal data, spread malware, or manipulate information
without the user knowing.
Hackers steal your session ID (a unique number assigned when you log into a website)
and use it to take over your account without needing your password. Example: You log
into your bank account, and a hacker hijacks your session. Now, they can make
transactions as if they were you. Effect: Can lead to stolen bank details, hacked emails,
or unauthorized transactions.
A hacker or malicious software changes your browser’s settings, forcing you to visit
unwanted websites, showing too many ads, or even spying on your activity. Example: You
open Google, but it automatically redirects you to a fake search engine filled with ads
and scams. Effect: Can lead to annoying pop-ups, stolen personal data, and even
malware infections.
Hackers hide dangerous buttons under real ones, so when you think you're clicking on
something safe; you're actually clicking on something malicious. Example: You try to "Play
Video", but instead, you accidentally "Allow Access to Your Camera" because the hacker
hid a permission request under the play button. Effect: Can be used to steal information,
control webcams, or install malware.
Hackers alter your internet’s address book (DNS) so that when you try to visit a real
website, you’re redirected to a fake one that looks identical. Example: You type
"www.facebook.com", but instead of going to Facebook, you land on a fake site that steals
your password. Effect: Can lead to stolen passwords, identity theft, and malware
infections.
Hackers gain access to email accounts (especially bank or business emails) and pretend
to be the real owner to scam people. Example: A hacker hijacks your company’s email
account and sends fake invoices to clients, making them transfer money to the hacker’s
account. Effect: Can lead to financial fraud and loss of sensitive business data.
Hackers create fake Wi-Fi networks in public places, tricking people into connecting. Once
connected, the hacker can steal passwords, banking details, and private messages.
Example: You connect to "Free Airport Wi-Fi," but it's actually controlled by a hacker who
can see everything you type. Effect: Can lead to stolen banking info, hacked social
media accounts, and identity theft.
1. SQL Injection
Hackers insert malicious code into a website’s database to steal, delete, or modify
sensitive information like passwords and credit card details.
Example: A hacker types special SQL commands into a login form instead of a
username and password, tricking the server into giving access. Effect: Can lead to data
leaks, hacked accounts, and financial fraud.
Hackers insert malicious JavaScript into web pages, which then runs on visitors'
browsers. This can steal user data, spread malware, or redirect users to fake sites.
Example: A hacker injects a script into a comment section on a blog. When someone
reads the comment, the script steals their cookies and login session. Effect: Can be
used to steal login credentials or spread malware.
If a web server allows users to upload or include files without proper security, hackers
can upload dangerous scripts that give them control over the server. Example: A
hacker uploads a malicious PHP file, and then runs it to steal files or take over the
website. Effect: Can lead to website defacement, server hijacking, and data
theft.
Hackers flood a web server with too many fake requests, making the website slow or
completely unavailable. Example: A hacker uses a botnet (thousands of infected
computers) to send millions of requests to a website, crashing it.Effect: Can cause
downtime, loss of business, and reputation damage.
If a web server has weak or default passwords, hackers can guess them using brute
force attacks (trying many passwords until one works). Example: A hacker guesses
"admin123" as the website administrator’s password and gains full control. Effect: Can
lead to complete website takeover and data breaches.
If a server is not properly secured, it can leak sensitive data or allow unauthorized
users to access critical files. Example: A website has directory listing enabled,
allowing hackers to browse and download hidden files from the server. Effect: Can
expose private files, database credentials, or backup data.
Patch management is the process of updating software, apps, and systems to fix
security vulnerabilities, improve performance, and add new features. Example: Imagine
your smartphone gets a security update from Apple or Android. This update (patch) fixes
bugs and protects your phone from hackers. Similarly, computers and servers also
need updates to stay secure.
1. Automatic Updates
Some systems automatically download and install updates without user intervention. This ensures that the latest
security patches are applied immediately. Example: Windows and macOS often update automatically, fixing
security flaws without you having to do anything.
2. Manual Updates
In some cases, patches are manually downloaded and installed. IT teams test patches before applying them to
avoid compatibility issues. Example: A company manually tests updates on a few computers before rolling them
out to all employees.
3. Scheduled Patching
Organizations schedule updates during off-hours (like midnight) to avoid downtime during work hours. Example: A
hospital updates its computer systems at night to prevent disruptions during the day.
4. Patch Prioritization
Not all patches are equally important. Some fix small bugs, while others close dangerous
security holes. Organizations prioritize critical patches that protect against major cyber
threats. Example: A company immediately installs a patch fixing a critical security flaw
but waits to install a minor design update.
Some updates may cause software crashes or compatibility issues. Companies test
patches in a safe environment before applying them to all systems. Example: An IT team
tests an update on a few devices to make sure it doesn’t break any software.
6. Rollback Plans
Sometimes, a patch introduces new problems instead of fixing old ones. A rollback plan
allows companies to undo a bad update and restore the previous version. Example: A
bank installs a security update, but it crashes their app. They roll back to the previous
version while they investigate.
Web server hardening is the process of securing a web server to reduce its
vulnerabilities and minimize the risk of cyber-attacks. It involves implementing
security best practices, configuring settings, and applying necessary patches to
enhance the server’s resilience against threats like unauthorized access, data
breaches, and malware infections. Key Steps for Web Server Hardening
Regularly update the web server software (Apache, Nginx, IIS, etc.), operating system, and
dependencies. Apply security patches to fix vulnerabilities.
Remove or disable unused services, ports, and modules to minimize attack surfaces. Only
enable features that are essential for the server’s functionality.
Install an SSL/TLS certificate to encrypt traffic (use TLS 1.2 or 1.3). Disable weak ciphers and
older protocols like SSL 2.0, SSL 3.0, and TLS 1.0/1.1.
4. Restrict Directory & File Permissions
Set the correct file and directory permissions to prevent unauthorized access. Restrict public
access to sensitive directories such as /var/www/html/config/.
Use strong, unique passwords and multi-factor authentication (MFA). Restrict admin panel
access based on IP whitelisting.
Disable server signatures and banners to prevent attackers from identifying server versions.
Restrict database access to authorized applications and IPs. Use encrypted database
connections (SSL/TLS).
Automate regular backups of server configurations and website data. Store backups securely
and test recovery procedures.
Hashing and salting passwords make it much harder for attackers to reverse-
engineer the original passwords even if they gain access to the hashed password
database.
Password expiry and rotation involve setting policies that require users to change
their passwords periodically. This reduces the window of time during which a cracked
password can be used.
7. Monitoring and Logging Failed Login Attempts
Monitoring and logging login attempts can help detect and respond to suspicious
activities, such as brute force or credential stuffing attacks, in real time.
Imagine you have a login page where users enter a username and password. A
hacker might enter special SQL commands instead of normal credentials to trick
the system and gain unauthorized access.
A website or application stores data (like usernames, passwords, and credit card
details) in a database. To retrieve this data, it uses SQL queries.
For example, when a user logs in, the website might run this SQL query:
A hacker enters the following in the username field and leaves the password field
empty.
SELECT * FROM users WHERE username = '' OR '1'='1' AND password = '';
The attacker uses the UNION SQL operator to combine results from multiple queries,
allowing them to retrieve sensitive data.
Example:
If a search box uses this query: SELECT name, email FROM users WHERE name =
'John';
The attacker injects conditions (OR, AND, etc.) and observes how the website
responds.
Example: SELECT * FROM users WHERE username = 'admin' AND password = '123'
OR '1'='1';
The attacker forces the database to display error messages that reveal
database details.
Might return an error like: You have an error in your SQL syntax near '1=1 --'
The hacker can analyse this message to learn about the database structure.
The attacker does not see error messages but can still extract data by asking
yes/no questions.
If the page loads normally, the hacker knows the password is 8 characters
long.
They repeat the process to guess the entire password character by
character.
5. Time-Based SQL Injection
The attacker delays database responses using the SLEEP () function to determine
if an injection is successful.
Example: SELECT * FROM users WHERE username='admin' AND IF (1=1, SLEEP (5),
0);
If the website takes 5 seconds to respond, the hacker knows the injection
worked.
This helps when error messages are hidden.
SQL Server is a popular database system used to store and manage data for web applications. However, if not
secured properly, it can become a target for hackers. Attackers exploit vulnerabilities in SQL Server to steal data,
modify records, or even take control of the entire database. Let’s go through the most common SQL Server
vulnerabilities in a simple and easy-to-understand way.
There are different types of buffer overflow attacks, depending on where the extra
data is stored.
3. Logical Operator Replacement: Logical operators (e.g., &&, II) are replaced with
other logical operators or constants to create mutants. This helps assess the ability
of the test suite to catch faults in logical conditions.
5. Unary Operator Replacement: Unary operators (e.g., ++, -,!) are replaced with
other operators or constants to create mutants. This checks if the test suite can find
faults related to incorrect unary operations.
6. Statement Deletion: Mutants are created by removing entire statements from the
code. This assesses whether the test suite can detect missing or incomplete code.
7. Statement Insertion: New statements are inserted into the code to create mutants.
This helps evaluate if the test suite can identify unwanted or incorrect additions to
the code.
This assesses the ability of the test suite to identify faults related to incorrect control
flow.
9. Loop Boundary Modification: The boundaries of loops (e.g., changing loop counters
or loop conditions) are modified to create mutants. This checks if the test suite can
detect faults related to incorrect loop behaviour.
WEP encrypts the data that is sent between devices (such as laptops, smartphones,
and routers) using an encryption key. This key is shared between the router (Wi-Fi
access point) and the connected devices. The goal of WEP is to prevent hackers
from eavesdropping on wireless communications and stealing information.
WEP uses the RC4 (Rivest Cipher 4) encryption algorithm to scramble data so
that only devices with the correct key can decode and read it. It uses a combination
of a pre-shared key (PSK) and an Initialization Vector (IV) to encrypt data.
How It Works
WPA-Personal (also known as WPA-PSK) is the most common authentication method
used in homes and small businesses. In this method, all users connect to the Wi-Fi
network using the same password, known as the Pre-Shared Key (PSK).
The router stores this shared password and uses it to authenticate devices
when they try to connect.
The password is also used to generate an encryption key that encrypts all
the data sent between the router and connected devices.
When a user enters the correct password, their device can join the network and
communicate securely. If the password is incorrect, the connection is denied.
2. WPA-Enterprise (WPA-EAP – Extensible Authentication
Protocol)
Before starting the test, both the company and the security team need to decide
what will be tested and how. This includes defining the scope, meaning which
systems, applications, or parts of the network will be tested.The testers also need to
get proper permission to avoid legal issues. Additionally, both parties set the rules of
engagement, such as whether testing can be done during business hours and
whether aggressive attacks like Denial-of-Service (DoS) are allowed.
Once the rules are set, the penetration testers begin gathering as much information
as possible about the target system. There are two main ways to gather information:
passive reconnaissance and active reconnaissance. Passive reconnaissance means
collecting publicly available information without directly interacting with the system.
This includes searching for company details on Google, looking at social media
profiles, and checking domain registration information. Active reconnaissance
involves directly scanning the target system to discover details such as open ports,
running services, and technologies in use. Tools like Nmap help identify which parts
of a system might be vulnerable.
After gathering information, the next step is identifying weaknesses in the system.
The testers use automated tools to scan for known vulnerabilities, such as out-dated
software or weak passwords. They also manually test for security flaws that
automated scanners might miss.
Now comes the most exciting part—actually trying to hack into the system. Testers
use the weaknesses they identified in the previous step to attempt real attacks. If
they found an out-dated software version, they might use a known exploit to take
control of the system. If they found weak passwords, they might try to crack those
using automated tools. Web applications are tested for vulnerabilities like SQL
Injection, which allows attackers to steal data from databases, and Cross-Site
Scripting (XSS), which can inject malicious code into web pages. The goal of this step
is not to cause harm but to prove that the vulnerabilities are real and need to be
fixed.
Step 5: Post-Exploitation (Evaluating the Impact)
After testing is complete, the penetration testers document everything they found.
This report is one of the most important parts of the process because it helps the
company understand the risks and how to fix them.
After receiving the report, the company’s IT team works on fixing the vulnerabilities.
They update software, change security settings, and improve password policies.
Once the fixes are applied, penetration testers conduct a retest to make sure the
vulnerabilities are no longer exploitable. This step ensures that all issues have been
properly resolved and that the system is now secure.
Penetration testing can be done manually or with the help of automated tools.
Automated tools make the process faster and more efficient by scanning systems,
identifying vulnerabilities, and even performing basic exploitation. These tools are
widely used by security professionals because they save time and provide a detailed
analysis of potential security risks.
Network Scanners: One of the most commonly used automated tools is Nmap
(Network Mapper). This tool helps penetration testers discover devices on a
network, check for open ports, and identify what services are running.
Vulnerability Scanners: Another popular tool is Nessus, which is used for vulnerability
scanning. It checks systems for known security weaknesses, such as out-dated
software, weak passwords, and misconfigured security settings. Nessus provides a
report with a list of vulnerabilities, their severity levels, and recommendations on
how to fix them.
Another useful tool is Wireshark, which captures and analyzes network traffic. It
allows testers to see what data is being transmitted over a network, helping them
detect security issues like unencrypted sensitive information. If a company is
transmitting login credentials over an unsecured connection, Wireshark can capture
this data, demonstrating a serious security risk.