Skip to content

Commit e780496

Browse files
author
HackTricks News Bot
committed
Add content from: LookOut: Discovering RCE and Internal Access on Looker (Goog...
1 parent 62000a0 commit e780496

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

  • src
    • network-services-pentesting/pentesting-web
    • pentesting-web/sql-injection/mysql-injection

src/network-services-pentesting/pentesting-web/git.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,24 @@ ls .git/hooks
4141
* **TruffleHog v3+**: entropy+regex with automatic Git history traversal. `trufflehog git file://$PWD --only-verified --json > secrets.json`
4242
* **Gitleaks** (v8+): fast regex ruleset, can scan unpacked tree or full history. `gitleaks detect -v --source . --report-format json --report-path gitleaks.json`
4343

44+
### Server-side Git integration RCE via `hooksPath` override
45+
46+
Modern web apps that integrate Git repos sometimes **rewrite `.git/config` using user-controlled identifiers**. If those identifiers are concatenated into `hooksPath`, you can redirect Git hooks to an attacker-controlled directory and execute arbitrary code when the server runs native Git (e.g., `git commit`). Key steps:
47+
48+
* **Path traversal in `hooksPath`**: if a repo name/dependency name is copied into `hooksPath`, inject `../../..` to escape the intended hooks directory and point to a writable location. This is effectively a [path traversal](../../pentesting-web/file-inclusion/README.md) in Git config.
49+
* **Force the target directory to exist**: when the application performs server-side clones, abuse clone destination controls (e.g., a `ref`/branch/path parameter) to make it clone into `../../git_hooks` or a similar traversal path so intermediate folders are created for you.
50+
* **Ship executable hooks**: set the executable bit inside Git metadata so every clone writes the hook with mode `100755`:
51+
```bash
52+
git update-index --chmod=+x pre-commit
53+
```
54+
Add your payload (reverse shell, file dropper, etc.) to `pre-commit`/`post-commit` in that repo.
55+
* **Find a native Git code path**: libraries like **JGit** ignore hooks. Hunt for deployment flows/flags that fall back to system Git (e.g., forcing deploy-with-attached-repo parameters) so hooks will actually run.
56+
* **Race the config rewrite**: if the app sanitizes `.git/config` right before running Git, spam the endpoint that writes your malicious `hooksPath` while triggering the Git action to win a [race condition](../../pentesting-web/race-condition.md) and get your hook executed.
57+
4458
## References
4559

4660
- [holly-hacker/git-dumper – parallel fast /.git dumper](https://github.com/holly-hacker/git-dumper)
4761
- [Ebryx/GitDump](https://github.com/Ebryx/GitDump)
62+
- [LookOut: RCE and internal access on Looker (Tenable)](https://www.tenable.com/blog/google-looker-vulnerabilities-rce-internal-access-lookout)
63+
4864
{{#include ../../banners/hacktricks-training.md}}

src/pentesting-web/sql-injection/mysql-injection/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,31 @@ Mitigations:
247247
Notes:
248248
- Prepared statements do not protect against semantic abuse of `REGEXP` or search operators. An input like `.*` remains a permissive regex even inside a quoted `REGEXP '.*'`. Use allow-lists or explicit guards.
249249
250+
## Error-based exfiltration via `updatexml()`
251+
252+
When the application only returns SQL errors (not raw result sets), you can leak data through MySQL error strings:
253+
254+
```sql
255+
dimension: id {
256+
type: number
257+
sql: updatexml(null, concat(0x7e, IFNULL((SELECT name FROM project_state LIMIT 1 OFFSET 0), 'NULL'), 0x7e, '///'), null) ;;
258+
}
259+
```
260+
261+
`updatexml()` raises an XPATH error that embeds the concatenated string, so the value from the inner `SELECT` appears in the error response between delimiters (`0x7e` = `~`). Iterate `LIMIT 1 OFFSET N` to enumerate rows. This works even when the UI forces “boolean” tests because the error message is still surfaced.
262+
250263
## Other MYSQL injection guides
251264
252265
- [PayloadsAllTheThings – MySQL Injection cheatsheet](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md)
253266
254267
## References
255268
256-
- [PayloadsAllTheThings – MySQL Injection cheatsheet](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md)
257269
- [Pre-auth SQLi to RCE in Fortinet FortiWeb (watchTowr Labs)](https://labs.watchtowr.com/pre-auth-sql-injection-to-rce-fortinet-fortiweb-fabric-connector-cve-2025-25257/)
258270
- [MySQL Full-Text Search – Boolean mode](https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html)
259271
- [MySQL Full-Text Search – Overview](https://dev.mysql.com/doc/refman/8.4/en/fulltext-search.html)
260272
- [MySQL REGEXP documentation](https://dev.mysql.com/doc/refman/8.4/en/regexp.html)
261273
- [ReDisclosure: New technique for exploiting Full-Text Search in MySQL (myBB case study)](https://exploit.az/posts/wor/)
262-
274+
- [LookOut: RCE and internal access on Looker (Tenable)](https://www.tenable.com/blog/google-looker-vulnerabilities-rce-internal-access-lookout)
263275
264276
{{#include ../../../banners/hacktricks-training.md}}
277+

0 commit comments

Comments
 (0)