Skip to content

Commit 3bff425

Browse files
committed
Pre-commit hook and markdown table fix
1 parent a9d97e9 commit 3bff425

31 files changed

Lines changed: 647 additions & 632 deletions

File tree

.github/.markdownlint.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
"default": true,
33
"MD013": false,
44
"MD033": false,
5+
"MD060": {
6+
"style": "aligned"
7+
},
58
"no-duplicate-heading": {
69
"siblings_only": true
710
},
811
"ul-indent": {
912
"indent": 4
1013
}
11-
}
14+
}

.github/workflows/check-markdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
files: '**/*.md'
1616
separator: ","
1717

18-
- uses: DavidAnson/markdownlint-cli2-action@v20
18+
- uses: DavidAnson/markdownlint-cli2-action@v24
1919
if: steps.changed-files.outputs.any_changed == 'true'
2020
with:
2121
globs: ${{ steps.changed-files.outputs.all_changed_files }}

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: markdownlint
5+
name: Verify Markdown
6+
entry: >-
7+
sh -c 'docker run --rm -v "$PWD:/workdir"
8+
davidanson/markdownlint-cli2:latest "**/*.md"
9+
--config .github/.markdownlint.json'
10+
language: system
11+
files: '(\.md$|^\.github/\.markdownlint\.json$)'
12+
pass_filenames: false

API Key Leaks/IIS-Machine-Keys.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
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.
2121

22-
| Format | Properties |
23-
| --- | --- |
24-
| Base64 | `EnableViewStateMac=False`, `ViewStateEncryptionMode=False` |
25-
| Base64 + MAC | `EnableViewStateMac=True` |
26-
| Base64 + Encrypted | `ViewStateEncryptionMode=True` |
22+
| Format | Properties |
23+
| ------------------ | ------------------------------------------------------------ |
24+
| Base64 | `EnableViewStateMac=False`, `ViewStateEncryptionMode=False` |
25+
| Base64 + MAC | `EnableViewStateMac=True` |
26+
| Base64 + Encrypted | `ViewStateEncryptionMode=True` |
2727

2828
By default until Sept 2014, the `enableViewStateMac` property was to set to `False`.
2929
Usually unencrypted viewstate are starting with the string `/wEP`.

CRLF Injection/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ Inject a `Location` header to force a redirect for the user.
119119
120120
Firefox followed the spec by stripping off any out-of-range characters when setting cookies instead of encoding them.
121121

122-
| UTF-8 Character | Hex | Unicode | Stripped |
123-
| --------- | --- | ------- | -------- |
124-
| `` | `%E5%98%8A` | `\u560a` | `%0A` (\n) |
125-
| `` | `%E5%98%8D` | `\u560d` | `%0D` (\r) |
126-
| `` | `%E5%98%BE` | `\u563e` | `%3E` (>) |
127-
| `` | `%E5%98%BC` | `\u563c` | `%3C` (<) |
122+
| UTF-8 Character | Hex | Unicode | Stripped |
123+
| --------------- | ----------- | -------- | ---------- |
124+
| `` | `%E5%98%8A` | `\u560a` | `%0A` (\n) |
125+
| `` | `%E5%98%8D` | `\u560d` | `%0D` (\r) |
126+
| `` | `%E5%98%BE` | `\u563e` | `%3E` (>) |
127+
| `` | `%E5%98%BC` | `\u563c` | `%3C` (<) |
128128

129129
The UTF-8 character `` contains `0a` in the last part of its hex format, which would be converted as `\n` by Firefox.
130130

Denial of Service/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ Be very careful as this is most likely **out-of-scope** and can have a high impa
2929
3030
When a process is writing a file on the server, try to reach the maximum number of files allowed by the filesystem format. The system should output a message: `No space left on device` when the limit is reached.
3131
32-
| Filesystem | Maximum Inodes |
33-
| --- | --- |
34-
| BTRFS | 2^64 (~18 quintillion) |
35-
| EXT4 | ~4 billion |
36-
| FAT32 | ~268 million files |
32+
| Filesystem | Maximum Inodes |
33+
| ---------- | -------------------------- |
34+
| BTRFS | 2^64 (~18 quintillion) |
35+
| EXT4 | ~4 billion |
36+
| FAT32 | ~268 million files |
3737
| NTFS | ~4.2 billion (MFT entries) |
38-
| XFS | Dynamic (disk size) |
39-
| ZFS | ~281 trillion |
38+
| XFS | Dynamic (disk size) |
39+
| ZFS | ~281 trillion |
4040
4141
An alternative of this technique would be to fill a file used by the application until it reaches the maximum size allowed by the filesystem, for example it can occur on a SQLite database or a log file.
4242

Directory Traversal/README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ We can use the `..` characters to access the parent directory, the following str
5050
### URL Encoding
5151

5252
| Character | Encoded |
53-
| --- | -------- |
54-
| `.` | `%2e` |
55-
| `/` | `%2f` |
56-
| `\` | `%5c` |
53+
| --------- | ------- |
54+
| `.` | `%2e` |
55+
| `/` | `%2f` |
56+
| `\` | `%5c` |
5757

5858
**Example:** IPConfigure Orchid Core VMS 2.0.5 - Local File Inclusion
5959

@@ -66,10 +66,10 @@ We can use the `..` characters to access the parent directory, the following str
6666
Double URL encoding is the process of applying URL encoding twice to a string. In URL encoding, special characters are replaced with a % followed by their hexadecimal ASCII value. Double encoding repeats this process on the already encoded string.
6767

6868
| Character | Encoded |
69-
| --- | -------- |
70-
| `.` | `%252e` |
71-
| `/` | `%252f` |
72-
| `\` | `%255c` |
69+
| --------- | ------- |
70+
| `.` | `%252e` |
71+
| `/` | `%252f` |
72+
| `\` | `%255c` |
7373

7474
**Example:** Spring MVC Directory Traversal Vulnerability (CVE-2018-1271)
7575

@@ -80,11 +80,11 @@ Double URL encoding is the process of applying URL encoding twice to a string. I
8080

8181
### Unicode Encoding
8282

83-
| Character | Encoded |
84-
| --- | -------- |
85-
| `.` | `%u002e` |
86-
| `/` | `%u2215` |
87-
| `\` | `%u2216` |
83+
| Character | Encoded |
84+
| --------- | -------- |
85+
| `.` | `%u002e` |
86+
| `/` | `%u2215` |
87+
| `\` | `%u2216` |
8888

8989
**Example**: Openfire Administration Console - Authentication Bypass (CVE-2023-32315)
9090

@@ -96,11 +96,11 @@ Double URL encoding is the process of applying URL encoding twice to a string. I
9696

9797
The UTF-8 standard mandates that each codepoint is encoded using the minimum number of bytes necessary to represent its significant bits. Any encoding that uses more bytes than required is referred to as "overlong" and is considered invalid under the UTF-8 specification. This rule ensures a one-to-one mapping between codepoints and their valid encodings, guaranteeing that each codepoint has a single, unique representation.
9898

99-
| Character | Encoded |
100-
| --- | -------- |
101-
| `.` | `%c0%2e`, `%e0%40%ae`, `%c0%ae` |
102-
| `/` | `%c0%af`, `%e0%80%af`, `%c0%2f` |
103-
| `\` | `%c0%5c`, `%c0%80%5c` |
99+
| Character | Encoded |
100+
| --------- | ------------------------------- |
101+
| `.` | `%c0%2e`, `%e0%40%ae`, `%c0%ae` |
102+
| `/` | `%c0%af`, `%e0%80%af`, `%c0%2f` |
103+
| `\` | `%c0%5c`, `%c0%80%5c` |
104104

105105
### Mangled Path
106106

@@ -171,12 +171,12 @@ When cookieless session state is enabled. Instead of relying on a cookie to iden
171171
172172
For example, a typical URL might be transformed from: `http://example.com/page.aspx` to something like: `http://example.com/(S(lit3py55t21z5v55vlm25s55))/page.aspx`. The value within `(S(...))` is the Session ID.
173173

174-
| .NET Version | URI |
175-
| -------------- | -------------------------- |
176-
| V1.0, V1.1 | /(XXXXXXXX)/ |
177-
| V2.0+ | /(S(XXXXXXXX))/ |
178-
| V2.0+ | /(A(XXXXXXXX)F(YYYYYYYY))/ |
179-
| V2.0+ | ... |
174+
| .NET Version | URI |
175+
| ------------ | -------------------------- |
176+
| V1.0, V1.1 | /(XXXXXXXX)/ |
177+
| V2.0+ | /(S(XXXXXXXX))/ |
178+
| V2.0+ | /(A(XXXXXXXX)F(YYYYYYYY))/ |
179+
| V2.0+ | ... |
180180

181181
We can use this behavior to bypass filtered URLs.
182182

Encoding Transformations/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ Unicode normalization is the process of converting Unicode text into a standardi
2626
* **NFKC** (Normalization Form Compatibility Composition): Like NFC, but also replaces characters with compatibility equivalents (may change appearance/format).
2727
* **NFKD** (Normalization Form Compatibility Decomposition): Like NFD, but also decomposes compatibility characters.
2828

29-
| Character | Payload | After Normalization |
30-
| ------------ | --------------------- | --------------------- |
31-
| `` (U+2025) | `‥/‥/‥/etc/passwd` | `../../../etc/passwd` |
29+
| Character | Payload | After Normalization |
30+
| ------------- | --------------------- | --------------------- |
31+
| `` (U+2025) | `‥/‥/‥/etc/passwd` | `../../../etc/passwd` |
3232
| `` (U+FE30) | `︰/︰/︰/etc/passwd` | `../../../etc/passwd` |
33-
| `` (U+FF07) | `' or '1'='1` | `' or '1'='1` |
34-
| `` (U+FF02) | `" or "1"="1` | `" or "1"="1` |
35-
| `` (U+FE63) | `admin'﹣﹣` | `admin'--` |
36-
| `` (U+3002) | `domain。com` | `domain.com` |
37-
| `` (U+FF0F) | `//domain.com` | `//domain.com` |
38-
| `` (U+FF1C) | `<img src=a>` | `<img src=a/>` |
39-
| `` (U+FE5B) | `﹛﹛3+3﹜﹜` | `{{3+3}}` |
40-
| `` (U+FF3B) | `[[5+5]]` | `[[5+5]]` |
41-
| `` (U+FF06) | `&&whoami` | `&&whoami` |
42-
| `` (U+FF50) | `shell.pʰp` | `shell.php` |
43-
| `ʰ` (U+02B0) | `shell.pʰp` | `shell.php` |
44-
| `ª` (U+00AA) | `ªdmin` | `admin` |
33+
| `` (U+FF07) | `' or '1'='1` | `' or '1'='1` |
34+
| `` (U+FF02) | `" or "1"="1` | `" or "1"="1` |
35+
| `` (U+FE63) | `admin'﹣﹣` | `admin'--` |
36+
| `` (U+3002) | `domain。com` | `domain.com` |
37+
| `` (U+FF0F) | `//domain.com` | `//domain.com` |
38+
| `` (U+FF1C) | `<img src=a>` | `<img src=a/>` |
39+
| `` (U+FE5B) | `﹛﹛3+3﹜﹜` | `{{3+3}}` |
40+
| `` (U+FF3B) | `[[5+5]]` | `[[5+5]]` |
41+
| `` (U+FF06) | `&&whoami` | `&&whoami` |
42+
| `` (U+FF50) | `shell.pʰp` | `shell.php` |
43+
| `ʰ` (U+02B0) | `shell.pʰp` | `shell.php` |
44+
| `ª` (U+00AA) | `ªdmin` | `admin` |
4545

4646
```py
4747
import unicodedata

File Inclusion/Wrappers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ A wrapper in the context of file inclusion vulnerabilities refers to the protoco
2121

2222
The part "`php://filter`" is case insensitive
2323

24-
| Filter | Description |
25-
| ------ | ----------- |
26-
| `php://filter/read=string.rot13/resource=index.php` | Display index.php as rot13 |
27-
| `php://filter/convert.iconv.utf-8.utf-16/resource=index.php` | Encode index.php from utf8 to utf16 |
28-
| `php://filter/convert.base64-encode/resource=index.php` | Display index.php as a base64 encoded string |
24+
| Filter | Description |
25+
| ------------------------------------------------------------ | -------------------------------------------- |
26+
| `php://filter/read=string.rot13/resource=index.php` | Display index.php as rot13 |
27+
| `php://filter/convert.iconv.utf-8.utf-16/resource=index.php` | Encode index.php from utf8 to utf16 |
28+
| `php://filter/convert.base64-encode/resource=index.php` | Display index.php as a base64 encoded string |
2929

3030
```powershell
3131
http://example.com/index.php?page=php://filter/read=string.rot13/resource=index.php

Insecure Deserialization/DotNET.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
## Detection
2020

21-
| Data | Description |
22-
| -------------- | ------------------- |
21+
| Data | Description |
22+
| -------------- | -------------------- |
2323
| `AAEAAD` (Hex) | .NET BinaryFormatter |
24-
| `FF01` (Hex) | .NET ViewState |
25-
| `/w` (Base64) | .NET ViewState |
24+
| `FF01` (Hex) | .NET ViewState |
25+
| `/w` (Base64) | .NET ViewState |
2626

2727
Example: `AAEAAAD/////AQAAAAAAAAAMAgAAAF9TeXN0ZW0u[...]0KPC9PYmpzPgs=`
2828

0 commit comments

Comments
 (0)