1. Malware (Malicious Software)
Malware means “malicious software.” It’s any software designed to harm your computer or steal information.
Types of Malware:
a) Virus
A virus attaches itself to a legitimate file and spreads when that file is opened.
Example: You download a free game. When you open it, it infects your computer and spreads to other files.
b) Worm
A worm spreads automatically across networks without needing you to click anything.
Example: It infects one computer and then spreads to others on the same Wi-Fi.
c) Trojan Horse
A Trojan pretends to be something useful but contains hidden malware.
Example: A fake “Free Antivirus” app that secretly steals your passwords.
d) Ransomware
Ransomware locks your files and demands money to unlock them.
Famous example:
e) Spyware
Spyware secretly monitors what you do on your computer.
Example: Recording your keystrokes to steal passwords.
2. Phishing
Phishing is when attackers trick you into giving sensitive information (like passwords or credit card numbers).
They usually pretend to be trusted organizations like:
Example Phishing Email:
Subject: Urgent! Your Account Has Been Suspended Dear User, We detected suspicious activity. Click the link below to verify your account immediately: http://fake-login-page.com Failure to verify will result in permanent suspension.
⚠️ The link looks official but leads to a fake website.
3. Denial-of-Service (DoS) Attacks
A DoS attack floods a website with too much traffic so it crashes.
When many computers are used together, it’s called a DDoS (Distributed Denial-of-Service) attack.
Example: Thousands of fake users try to open a website at once, making it unavailable.
4. Man-in-the-Middle (MITM) Attack
In a MITM attack, a hacker secretly intercepts communication between two parties.
Example:
You connect to free public Wi-Fi at a café.
A hacker intercepts your login information while you check your bank account.
5. SQL Injection
This attack targets websites that use databases.
Attackers insert malicious SQL code into a login or search form.
Example of Vulnerable Code:
$username = $_POST['username']; $password = $_POST['password']; $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
⚠️ Problem: The code directly inserts user input into the SQL query.
An attacker could enter:
' OR '1'='1
This could allow them to log in without a password.
6. Cross-Site Scripting (XSS)
XSS happens when attackers inject malicious JavaScript into a website.
Example:
<input type="text" name="comment">
If not protected, someone could enter:
<script>alert("Hacked!");</script>
When others visit the page, the script runs in their browser.
7. Zero-Day Exploit
A Zero-Day exploit attacks a software vulnerability that developers don’t know about yet.
Because there is no patch available, it’s very dangerous.
8. Insider Threat
An insider threat comes from someone inside the organization:
They may:
9. Password Attacks
Attackers try to guess or steal passwords.
Types:
10. Advanced Persistent Threat (APT)
An APT is a long-term targeted attack.
Attackers:
These are often carried out by highly skilled groups.
How to Protect Yourself
Here are basic security practices:
Use strong passwords
Enable two-factor authentication
Keep software updated
Don’t click suspicious links
Use antivirus software
Avoid public Wi-Fi for sensitive tasks
Compilation of All Code Blocks (Combined)
Below is all the example code combined into one single block as requested:
// ------------------------
// Example 1: Phishing Email (Text Example)
// ------------------------
Subject: Urgent! Your Account Has Been Suspended
Dear User,
We detected suspicious activity. Click the link below to verify your account immediately:
http://fake-login-page.com
Failure to verify will result in permanent suspension.
// ------------------------
// Example 2: Vulnerable PHP Code (SQL Injection)
// ------------------------
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
// ------------------------
// Example 3: XSS Example
// ------------------------
<input type="text" name="comment">
<script>alert("Hacked!");</script>
<br />
<b>Deprecated</b>: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/home/voksinst/tutorials.voksinstitute.com/admin/topics.php</b> on line <b>265</b><br />