Tutorial / Cram Notes

Common Attacks and Threats

Injection Flaws

Injection attacks occur when an attacker sends untrusted data to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing unauthorized data. SQL injection is a common example where attackers can manipulate a database query.

Broken Authentication

Applications that improperly manage session handling could allow attackers to compromise passwords, tokens, or keys. They could also exploit other implementation flaws to assume other users’ identities.

Sensitive Data Exposure

Many web applications don’t properly protect sensitive data such as financial information and passwords, leaving it exposed to attackers. This could result in data theft or data breaches.

XML External Entities (XXE)

Poorly configured XML processors evaluate external entity references within XML documents. Attackers can exploit this to access internal files, conduct SSRF (Server Side Request Forgery) attacks, and execute remote code.

Broken Access Control

Restrictions on what authenticated users are allowed to do are often not properly enforced. Attackers can exploit these flaws to access unauthorized functionality or data, such as accessing other users’ accounts, viewing sensitive files, etc.

Security Misconfiguration

Security misconfiguration can happen at any level of an application stack, including the network services, platform, web server, application server, database, frameworks, custom code, and pre-installed virtual machines, containers, or storage. Misconfigured permissions on cloud services, unnecessary services running, and default credentials left unchanged are typical examples.

Cross-Site Scripting (XSS)

XSS flaws occur when an application includes untrusted data in a new web page without proper validation or escaping, allowing an attacker to execute scripts in the victim’s browser, which can hijack user sessions, deface web sites, or redirect the user to malicious sites.

Insecure Deserialization

This vulnerability occurs when untrusted data is used to abuse the logic of an application, inflict a denial of service, or even execute arbitrary code upon deserialization.

Using Components with Known Vulnerabilities

Components, such as libraries, frameworks, and other software modules, run with the same privileges as the application. If a vulnerable component is exploited, such an attack could facilitate serious data loss or server takeover.

Insufficient Logging & Monitoring

Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems, and tamper, extract, or destroy data.

DDoS Attacks

DDoS (Distributed Denial of Service) attacks are not listed on the OWASP Top 10 but remain a significant threat to AWS-hosted services. In a DDoS attack, multiple compromised computer systems attack a target, such as a server, website, or other network resources, and cause a denial of service for users of the targeted resource.

AWS provides services such as AWS Shield and AWS WAF (Web Application Firewall) to protect against DDoS attacks. AWS Shield offers automatic inline mitigation that minimizes application downtime and latency, while AWS WAF provides control over HTTP and HTTPS requests that are forwarded to an Amazon CloudFront distribution, an Amazon API Gateway API, or an Application Load Balancer.

Defense Strategies on AWS

To defend against these threats in AWS environments, one should:

  • Use parameterized queries or prepared statements to prevent SQL injection.
  • Implement multi-factor authentication and session management controls.
  • Encrypt sensitive data in transit and at rest, and manage encryption keys properly.
  • Disable XML external entity processing and implement proper input validation.
  • Strictly enforce the principle of least privilege and ensure proper access controls.
  • Regularly audit configurations and use tools like AWS Config for monitoring resource changes.
  • Sanitize input to prevent XSS attacks and use Content Security Policy.
  • Avoid deserialization of untrusted data, or use secure serialization libraries.
  • Keep all software and dependencies up to date, leveraging Dependabot on GitHub for automatic pull requests.
  • Maintain robust logging and real-time monitoring, using Amazon CloudWatch and AWS CloudTrail, and practice effective incident response.

By understanding these common threats and applying best practices in AWS security, candidates for the AWS Certified Security – Specialty (SCS-C02) exam can equip themselves to face the challenges of securing AWS infrastructure and applications.

Practice Test with Explanation

Which of the following is an injection attack that can be found in the OWASP Top 10?

  • A) Phishing
  • B) Cross-site Scripting (XSS)
  • C) SQL Injection
  • D) DDoS

Answer: C) SQL Injection

Explanation: SQL Injection is an attack technique that allows attackers to execute arbitrary SQL code on a database.

True or False: Cross-Site Request Forgery (CSRF) is an attack where a malicious website causes a user’s web browser to perform an unwanted action on a trusted site.

  • A) True
  • B) False

Answer: A) True

Explanation: CSRF exploits the trust that a site has in a user’s browser and can cause actions to be taken without the user’s consent.

A Distributed Denial of Service (DDoS) attack is designed to:

  • A) Steal user data
  • B) Gain unauthorized access to systems
  • C) Disrupt service by overwhelming resources
  • D) Encrypt files and demand a ransom

Answer: C) Disrupt service by overwhelming resources

Explanation: The main purpose of a DDoS attack is to make an online service unavailable by flooding it with traffic from multiple sources.

Which of the following is considered a “man-in-the-middle” attack?

  • A) Phishing
  • B) Session Hijacking
  • C) SQL Injection
  • D) Cross-Site Scripting (XSS)

Answer: B) Session Hijacking

Explanation: Session Hijacking is where an attacker takes control of a user session after successfully obtaining or generating an authentic session token.

True or False: Implementing HTTPS is a good practice to prevent cross-site scripting (XSS) attacks.

  • A) True
  • B) False

Answer: B) False

Explanation: While HTTPS is important for security, it does not prevent XSS attacks. XSS requires input sanitization and other specific protections.

What type of attack is characterized by the unauthorized disclosure of information due to an application not properly sanitizing user input?

  • A) DDoS
  • B) Buffer Overflow
  • C) Information Disclosure
  • D) Insecure Deserialization

Answer: C) Information Disclosure

Explanation: Information disclosure occurs when an application inadvertently reveals sensitive data.

Which of the following best describes a “buffer overflow” attack?

  • A) Sending more traffic to a network service than it is designed to handle
  • B) Injecting code into a program by exceeding the buffer’s storage capacity
  • C) Stealing credentials through a phishing campaign
  • D) Intercepting data transmitted across a network

Answer: B) Injecting code into a program by exceeding the buffer’s storage capacity

Explanation: Buffer overflow attacks write data beyond the buffer’s boundaries, potentially allowing attackers to execute malicious code.

True or False: Security misconfiguration is one of the vulnerabilities listed in the OWASP Top

  • A) True
  • B) False

Answer: A) True

Explanation: Security misconfiguration is indeed part of the OWASP Top 10 and can lead to a wide variety of security issues.

Which attack exploits the trust that a site has in the user’s browser?

  • A) XSS
  • B) DDoS
  • C) CSRF
  • D) Phishing

Answer: C) CSRF

Explanation: CSRF exploits the trust a site has in the user’s browser to perform actions without the user’s consent or knowledge.

True or False: Insecure deserialization can lead to remote code execution.

  • A) True
  • B) False

Answer: A) True

Explanation: Insecure deserialization flaws can be exploited to perform remote code execution, among other attacks.

Which technique is recommended to protect against injection vulnerabilities?

  • A) Captcha implementation
  • B) Using least privilege accounts
  • C) Input validation and parameterized queries
  • D) Deploying antivirus software

Answer: C) Input validation and parameterized queries

Explanation: Input validation is essential to prevent injection attacks, and using parameterized queries ensures that the code and data are strictly separated.

What type of attack is commonly identified with the acronym “MITM”?

  • A) Man-In-The-Mountain
  • B) Main-Internet-Traffic-Monitoring
  • C) Man-In-The-Middle
  • D) Malware-In-Terminated-Memory

Answer: C) Man-In-The-Middle

Explanation: “MITM” stands for Man-In-The-Middle, which is a type of attack where the attacker intercepts communications between two parties to either eavesdrop or impersonate one of the parties, making it appear as a normal exchange.

Interview Questions

Can you describe what a Distributed Denial of Service (DDoS) attack is and explain the most common types of DDoS attacks you might need to safeguard against in an AWS environment?

A Distributed Denial of Service (DDoS) attack is a malicious attempt to disrupt the normal traffic of a targeted server, service, or network by overwhelming the target or its surrounding infrastructure with a flood of internet traffic. In an AWS environment, the most common types of DDoS attacks include volumetric attacks that saturate the bandwidth, protocol attacks that exhaust resources, and application layer attacks that target web application servers. AWS provides services like AWS Shield and AWS WAF to help protect against such attacks.

What is SQL Injection, and how can it be prevented in an AWS-hosted application?

SQL Injection is a code injection technique where an attacker can execute malicious SQL statements that control a web application’s database server. To prevent this in an AWS-hosted application, one should use prepared statements with parameterized queries, employ ORM frameworks which abstract SQL queries, implement input validation, and utilize services like Amazon RDS which offers various layers of security, including network isolation using Amazon VPC, encryption, and SQL firewall capabilities.

How does Cross-Site Scripting (XSS) differ from Cross-Site Request Forgery (CSRF), and what AWS services can help mitigate these threats?

Cross-Site Scripting (XSS) occurs when an attacker injects malicious scripts into content from a trusted website, whereas Cross-Site Request Forgery (CSRF) tricks a user’s browser into executing an unwanted action on a trusted site where the user is authenticated. AWS WAF can help mitigate both XSS and CSRF attacks by providing custom rulesets to filter out malicious requests and inputs.

In the context of AWS, what strategies can be applied to protect against Man-in-the-Middle (MitM) attacks?

To protect against MitM attacks in AWS, one should enforce the use of TLS to encrypt data in transit, employ strict SSL/TLS protocols and ciphers, use AWS Key Management Service (KMS) for key storage and management, implement private connections such as AWS Direct Connect, and enforce proper IAM roles and policies to ensure only authorized access to AWS resources.

Can you explain the impact of Security Misconfiguration, and how should an AWS user address this issue?

Security Misconfiguration can lead to unauthorized access and data breaches. To address this issue in AWS, users should follow best practices like minimizing the attack surface by disabling unused features and services, regularly updating and patching systems, employing least privilege access, implementing secure server images (AMIs), automating security processes with tools like AWS Config, and continually auditing configurations with AWS Inspector.

How can System Patch Management help in securing AWS environments against exploits?

System Patch Management helps in securing AWS environments by ensuring that all operating system and software applications are up-to-date with the latest security patches, which fix vulnerabilities that could be exploited by attackers. AWS offers services like AWS Systems Manager to automate the patching process and maintain the security of EC2 instances and on-premises servers.

What is a Credential Stuffing attack and what AWS service can specifically help mitigate this type of attack?

Credential Stuffing is an attack where compromised user credentials (usernames/passwords obtained from other breaches) are used to gain unauthorized access to accounts. AWS recommends the use of multi-factor authentication (MFA) and AWS Cognito that can provide adaptive authentication features to help mitigate credential stuffing attacks.

Describe how an Insecure Direct Object References (IDOR) vulnerability could be present in a web application and what measures can be taken to prevent it in the AWS ecosystem.

An Insecure Direct Object References (IDOR) vulnerability occurs when an application exposes a reference to an internal implementation object, such as a file or directory, allowing attackers to manipulate these references to access unauthorized data. Prevention measures include utilizing access control checks or adopting an indirect reference map to validate that users are authorized for the direct reference they are requesting. AWS Identity and Access Management (IAM), along with resource-based policies, can be used to define and control access permissions.

What role does AWS Shield play in protection against common attacks?

AWS Shield is a managed Distributed Denial of Service (DDoS) protection service that safeguards applications on AWS. AWS Shield provides automatic inline mitigations that minimize application downtime and latency, offering two levels of protection: AWS Shield Standard (for all AWS customers at no additional charge) and AWS Shield Advanced (providing enhanced protections). Shield Advanced also gives access to 24×7 support from the AWS DDoS Response Team (DRT).

Can you explain what an “account takeover” attack is and how AWS Identity and Access Management (IAM) can prevent it?

An “account takeover” attack occurs when a user’s credentials are compromised, allowing an attacker to gain unauthorized access to an account and its associated resources and data. AWS IAM helps prevent account takeovers by recommending the use of strong, complex passwords and enabling MFA. Additionally, IAM allows for monitoring and logging of user activities with AWS CloudTrail, and the use of IAM roles instead of sharing credentials can further reduce the risk.

0 0 votes
Article Rating
Subscribe
Notify of
guest
21 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Caroline Curtis
3 months ago

Great post! The OWASP Top 10 lists key vulnerabilities that developers need to be aware of. If you’re prepping for the AWS Certified Security – Specialty exam, mastering these can be crucial.

Dörthe Koller
4 months ago

Can someone explain how DDoS attacks differ from other types of cyber-attacks?

Ömür Beşok
3 months ago

The OWASP Top 10 is essential for AWS security exams. Just make sure to understand how each vulnerability applies within an AWS environment.

Alison Warren
4 months ago

How important is understanding DDoS mitigation for this AWS exam?

Iván Vázquez
3 months ago

Appreciate the information!

Mercedes Luna
4 months ago

How does Cross-Site Scripting (XSS) work and what are the preventive measures?

Delphine Gagné
3 months ago

Thank you, this is really helpful as I’m preparing for the AWS Certified Security – Specialty exam.

Rosl Kümmel
3 months ago

I didn’t find this post very detailed. There’s much more to cover in terms of security best practices.

21
0
Would love your thoughts, please comment.x
()
x