diff --git a/Command Injection/README.md b/Command Injection/README.md index 9eefa07..9b297fb 100644 --- a/Command Injection/README.md +++ b/Command Injection/README.md @@ -247,7 +247,7 @@ echo whoami|$0 ``` -### Bypass with $() +#### Bypass with $() ```powershell who$()ami diff --git a/Insecure Direct Object References/README.md b/Insecure Direct Object References/README.md index a2fd20e..49b3445 100644 --- a/Insecure Direct Object References/README.md +++ b/Insecure Direct Object References/README.md @@ -6,69 +6,123 @@ ## Summary * [Tools](#tools) -* [Exploit](#exploit) - * [IDOR Tips](#idor-tips) -* [Examples](#examples) * [Labs](#labs) +* [Exploit](#exploit) + * [Numeric Value Parameter](#numeric-value-parameter) + * [Common Identifiers Parameter](#common-identifiers-parameter) + * [Weak Pseudo Random Number Generator](#weak-pseudo-random-number-generator) + * [Hashed Parameter](#hashed-parameter) + * [Wildcard Parameter](#wildcard-parameter) + * [IDOR Tips](#idor-tips) * [References](#references) ## Tools -- [BApp Store > Authz](https://portswigger.net/bappstore/4316cc18ac5f434884b2089831c7d19e) -- [BApp Store > AuthMatrix](https://portswigger.net/bappstore/30d8ee9f40c041b0bfec67441aad158e) -- [BApp Store > Autorize](https://portswigger.net/bappstore/f9bbac8c4acf4aefa4d7dc92a991af2f) - - -## Exploit - -For instance, consider a URL like `https://example.com/account?userid=123`. In this case, `123` is a direct object reference to a specific user's account. If the application doesn't properly check that the logged-in user has the right to access the account related to `userid=123`, then any user could potentially change the userid in the URL to access other users' accounts. - -![https://lh5.googleusercontent.com/VmLyyGH7dGxUOl60h97Lr57F7dcnDD8DmUMCZTD28BKivVI51BLPIqL0RmcxMPsmgXgvAqY8WcQ-Jyv5FhRiCBueX9Wj0HSCBhE-_SvrDdA6_wvDmtMSizlRsHNvTJHuy36LG47lstLpTqLK](https://raw.githubusercontent.com/swisskyrepo/PayloadsAllTheThings/master/Insecure%20Direct%20Object%20References/Images/idor.png) - -The value of a parameter is used directly to retrieve a database record. - -```powershell -http://foo.bar/somepage?invoice=12345 -``` - -The value of a parameter is used directly to perform an operation in the system - -```powershell -http://foo.bar/changepassword?user=someuser -``` - -The value of a parameter is used directly to retrieve a file system resource - -```powershell -http://foo.bar/showImage?img=img00011 -``` - -The value of a parameter is used directly to access application functionality - -```powershell -http://foo.bar/accessPage?menuitem=12 -``` - - -### IDOR Tips - -* Change the HTTP request: POST → PUT -* Change the content type: XML → JSON -* Increment/decrement numerical values (1,2,3,..) -* GUID/UUID might be weak -* Transform numerical values to arrays: `{"id":19} → {"id":[19]}` - - -## Examples - -* [HackerOne - IDOR to view User Order Information - meals](https://hackerone.com/reports/287789) -* [HackerOne - IDOR on HackerOne Feedback Review - japz](https://hackerone.com/reports/262661) +- [PortSwigger/BApp Store > Authz](https://portswigger.net/bappstore/4316cc18ac5f434884b2089831c7d19e) +- [PortSwigger/BApp Store > AuthMatrix](https://portswigger.net/bappstore/30d8ee9f40c041b0bfec67441aad158e) +- [PortSwigger/BApp Store > Autorize](https://portswigger.net/bappstore/f9bbac8c4acf4aefa4d7dc92a991af2f) ## Labs -* [PortSwigger - Insecure direct object references](https://portswigger.net/web-security/access-control/lab-insecure-direct-object-references) +* [PortSwigger - Insecure Direct Object References](https://portswigger.net/web-security/access-control/lab-insecure-direct-object-references) + + +## Exploit + +IDOR stands for Insecure Direct Object Reference. It's a type of security vulnerability that arises when an application provides direct access to objects based on user-supplied input. As a result, attackers can bypass authorization and access resources in the system directly, potentially leading to unauthorized information disclosure, modification, or deletion. + +**Example of IDOR** + +Imagine a web application that allows users to view their profile by clicking a link `https://example.com/profile?user_id=123`: + +```php +