task-1
task-1
Phishing Attacks
Phishing is a type of cyber-attack where attackers disguise themselves as legitimate entities
(such as trusted organizations, websites, or individuals) to deceive people into providing
sensitive information, such as passwords, credit card details, or personal identification
numbers (PINs). These attacks often occur through email, text messages, or malicious
websites, and can lead to identity theft, financial loss, or unauthorized access to private
systems.
Attack Methods:
1. Email Phishing: Fake emails that look real are sent to trick you into giving personal
information, like passwords or credit card details.
2. Spear Phishing: A personalized phishing attack that targets a specific person or company
using details like their name or job to make it seem more trustworthy.
3. Whaling: A phishing attack aimed at high-level people in a company, like CEOs, to steal
important information or money.
4. Smishing: Fake text messages are sent to your phone to trick you into clicking harmful
links or sharing personal information.
5. Vishing: Phishing over the phone where someone pretends to be from a trusted source,
like a bank, and asks for private information.
6. Clone Phishing: A copy of a real email is sent again, but with a fake link or file that can
harm your device or steal your data.
7. Pharming: You’re redirected from a real website to a fake one without realizing, and
when you enter your information, it gets stolen.
8. Angler Phishing: Fake customer service accounts on social media try to trick you into
sharing personal information or clicking on harmful links.
Mitigations of phishing
1. Be Aware:
- Learn how to spot phishing emails, texts, or calls.
- Don’t click on links or open attachments from unknown sources.
2. Check Links:
- Hover over links to see where they really go before clicking.
- Be cautious of links that look suspicious or unfamiliar.
3. Use Strong Security:
- Enable multi-factor authentication (MFA) to add an extra layer of protection for your
accounts.
- Keep antivirus software and firewalls updated to catch threats.
4. Spam Filters:
- Use spam filters to block suspicious emails from reaching your inbox.
5. Don’t Share Personal Info:
- Avoid sharing personal information (like passwords or credit card details) through email or
text.
- Be careful with what you share on social media.
6. Verify Before Trusting:
- If you get a strange message from a company, call them directly to verify.
- Don’t trust emails that ask for urgent action or financial information.
7. Report Phishing:
- Report phishing emails or texts to your email provider or IT department.
8. Keep Software Updated:
- Regularly update your devices, browsers, and security tools to protect against the latest
threats.
Handling:
Report the phishing attempt to your IT or security team.
Disconnect compromised accounts and initiate password resets.
Monitor for suspicious activity in affected accounts.
2. Malware Attacks
Refers to various types of harmful programs designed to infiltrate or damage systems
without the user's consent. As a SOC Tier 1 Analyst, recognizing different types of
malware, preventing them, and responding effectively is critical to maintaining network
security.
A Denial of Service (DOS) attack aims to make a network service unavailable to its intended
users by overwhelming it with excessive traffic or exploiting vulnerabilities.
A SQL Injection (SQLi) attack involves inserting malicious SQL statements into a database
query through unsanitized user inputs, allowing an attacker to manipulate, retrieve, or delete data.
Types of SQL Injection Attacks
php
Copy code
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = ?');
$stmt->execute([$username]);
o Impact: Prevents the input from being treated as part of the SQL query.
3. Stored Procedures:
o Description: Stored procedures execute predefined SQL code on the database server side,
reducing the risk of SQL injection by not allowing user-supplied SQL commands.
o Example:
sql
Copy code
EXECUTE getUserInfo @username = 'user1';
o Impact: Limits direct interaction with the SQL database through queries.
4. Escape Dangerous Characters:
o Escape Quotes: Use functions like mysqli_real_escape_string() in PHP to escape
special characters such as single quotes (').
o Use Object Relational Mappers (ORM): ORMs like SQLAlchemy or Hibernate
automatically escape potentially dangerous inputs.
5. Least Privilege Principle:
o Database Access Control: Limit database privileges for application users to only what's
necessary. Ensure accounts interacting with the database have limited access.
o Example: Deny DELETE or DROP table privileges to the web application user account.
6. Web Application Firewalls (WAF):
o Deploy WAFs: Use Web Application Firewalls to filter and block common SQL injection
patterns before they reach your application. Solutions like ModSecurity, Cloudflare
WAF, and AWS WAF can block SQLi attempts.
7. Database Error Handling:
o Disable Error Reporting: Do not reveal database error messages to users. Handle errors
gracefully on the server-side and display generic error messages to users.
o Impact: Prevents attackers from gaining insights into database structure and
vulnerabilities through error messages.
Monitor Alerts:
o SIEM Tools: Review alerts from Splunk, QRadar, or Elastic Stack for patterns
indicative of SQLi attempts (e.g., injection strings like ' OR 1=1 or UNION
SELECT).
o WAF Logs: Regularly check your WAF logs for blocked SQL injection attempts
or suspicious query patterns.
Common Indicators:
o Unusual Database Queries: Repeated or unusual queries that indicate someone is
attempting to inject SQL statements.
o Error Logs: Frequent database errors or abnormal error codes related to SQL
queries, such as SQL syntax error.
o Sudden Data Access: Unexplained access to sensitive tables or a spike in read
operations on certain database tables.
Notify Stakeholders:
o Inform database administrators, developers, and management about the attack and
mitigation efforts.
Escalate if Necessary:
o Escalate the incident to Tier 2/3 analysts if the SQL injection attempt is complex,
persistent, or has resulted in significant data loss or compromise.
5. Post-Incident Handling
----------------------------------------------------------------------------------------------------------------------
5. Man-in-the-Middle (MitM) Attacks
The threat actor's primary goal is to intercept and possibly alter communication between two
parties to gain unauthorized access to sensitive information, such as passwords, financial data,
or private messages.
Attack Methods:
Session Hijacking: The attacker intercepts and takes control of a user session, often to steal
sensitive information or impersonate the user.
SSL Stripping: Downgrading a secure HTTPS connection to an unsecure HTTP connection,
allowing the attacker to view and potentially alter the transmitted data.
Packet Sniffing: Capturing network traffic to analyze and extract valuable data, such as
login credentials or personal information.
DNS Spoofing: Manipulating DNS records to redirect users to malicious websites that
appear legitimate, where they may enter sensitive information.
Wi-Fi Eavesdropping: Intercepting data over unsecured or poorly secured Wi-Fi networks
to gather sensitive information.
Email Interception: Intercepting email communications to gain access to confidential
information or to alter the content of the message.
Handling:
-Terminate Malicious Sessions: If a MitM attack is identified, terminate the malicious
session and quarantine the compromised devices.
-Block Malicious IPs: Use firewall rules and iptables to block the attacker’s IP address.
-Implement ARP Spoofing Protection via network equipment or configure Static ARP entries
for critical systems.
-Enforce strict DNS security policies like DNSSEC to prevent DNS spoofing.
-Ensure proper certificate validation using Public Key Pinning (HPKP) or enforcing the use
of trusted Certificate Authorities (CAs).
Prevention:
-Patch and Update Systems: Ensure all systems and applications are patched against
vulnerabilities that could be exploited by MitM attacks (e.g., SSL/TLS vulnerabilities).
-User Awareness: Educate users on the risks of connecting to untrusted Wi-Fi networks, and
encourage the use of VPNs for secure communication.
-Monitor the Network for Further Anomalies: Continue to monitor the network for any
indications of ongoing or residual attacks.
-Encryption: Ensure all sensitive communications are encrypted using SSL/TLS to mitigate
the impact of MitM attacks.
-Multi-factor Authentication (MFA): Implement MFA to protect against session hijacking
during an active MitM attack.
-Network Segmentation: Use VLANs and proper network segmentation to reduce the attack
surface.
-Strong Certificate Management: Ensure robust certificate lifecycle management, including
regular updates and revocation checks.
6. Password Attacks
The threat actor's primary goal is to gain access to credentials, such as passwords and other
sensitive information.
Attack Methods:
1. Brute Force: Repeatedly trying various combinations of passwords until the correct one is
found.
2. Dictionary Attack: Using a predefined list of common passwords or words to guess the
correct password.
3. Phishing: Deceptively tricking individuals into revealing their credentials through
fraudulent emails or websites.
4. Man-in-the-Middle (MITM): Intercepting and potentially altering communication
between two parties to steal passwords or other sensitive data.
5. Rainbow Table Attack: Utilizing precomputed tables of hashed passwords to quickly
reverse cryptographic hash functions and retrieve plain text passwords.
6. Social Engineering: Manipulating individuals into divulging confidential information,
often by exploiting trust.
Handling:
1. Block the IP address involved in the attack.
2. Block the domain (if applicable).
3. Notify affected users and instruct them to reset their passwords.
4. Notify management of the breach.
5. Document and report the incident.
Prevention:
1. Implement rate limiting (e.g., limit the number of password attempts within a set
timeframe).
2. Enable account lockouts after a certain number of failed login attempts.
3. Enforce the use of strong and unique passwords.
4. Implement Multi-Factor Authentication (MFA).
5. Conduct regular penetration testing to identify vulnerabilities.
6. Train employees on security best practices (this is crucial).
7. Monitor user activity for suspicious behavior.
8. Ensure systems are regularly patched and updated to protect against known vulnerabilities
Types of XSS:-
1. Stored XSS (Persistent XSS)
- The attacker’s harmful script is saved (or "stored") on a website, like in a comment or user
profile. When other users visit the page, the script runs in their browser, allowing the attacker to
steal their data or control their actions.
2. Reflected XSS
- The attacker tricks a user into clicking a link that sends their harmful script to a website. The
website “reflects” the script back in its response, and the script runs in the user's browser. This
type usually happens through links in emails or search forms.
3. DOM-based XSS
- The script is injected into the webpage and runs directly in the user's browser by exploiting
how the webpage processes data (Document Object Model or DOM). In this case, the
vulnerability is entirely in the browser and doesn't involve the server.
Mitigations of XSS:-
1. Check and Clean User Input:
- Always check and clean any data users enter (like in forms) so it can’t contain harmful code.
2. Encode Data Before Displaying:
- When showing user-generated content on a webpage, make sure special characters (like < or
>) are displayed as text, not code.
3. Use Security Settings:
- Set up a Content Security Policy (CSP) to control which scripts can run on your site. This
blocks untrusted scripts from running.
- Enable X-XSS-Protection in older browsers to block simple XSS attacks.
4. Avoid Risky JavaScript Functions:
- Don’t use functions like eval() with user data, because they can allow harmful scripts to run.
5. Protect Cookies:
- Set cookies to HttpOnly so they can’t be accessed by JavaScript, making it harder for attackers
to steal user data.
6. Use Safe Frameworks:
- Use web development frameworks like React or Angular that automatically protect against
XSS by handling user input safely.
7. Careful with DOM Changes:
- Avoid inserting untrusted data directly into the webpage using methods like innerHTML.
Instead, use safer methods like textContent.
8. Test for Security:
- Regularly test your website for security issues to find and fix any XSS vulnerabilities