Squid

squid proxy phpmyadmin nt authority\local service

  • Nom machine : Squid

  • Difficulté : Easy

  • OS : Windows

Enumération

NMAP

Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-07-27 04:59 EDT
Nmap scan report for 192.168.248.189
Host is up (0.034s latency).
Not shown: 65530 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds?
3128/tcp  open  http-proxy    Squid http proxy 4.14
|_http-server-header: squid/4.14
|_http-title: ERROR: The requested URL could not be retrieved
49666/tcp open  msrpc         Microsoft Windows RPC
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

SMB (139/445)

Aucun accès

HTTP-Proxy (3128) : Squid http proxy 4.14

Configurer le proxy

FoxyProxy

Enumérer les ports

Attention : nmap (avec proxychains) ne fonctionne pas ici, il faut utiliser spose.py.

HTTP (8080) : Wampserver 3.2.3

Nous allons aller sur la pahe phpmyadmin

Une rapide recherche google nous indique que le nom d'utilisateur par défault est root.

Cela fonctionne !

Accès initial

phpMyAdmin

Nous avons créer une base de données : reverse. Ensuite nous avons formulé une requête SQL.

En visitant le lien http://192.168.248.189:8080/reverse.php, nous arrivons bien au fichier uploader.

Nous pouvant maintenant chercher à obtenir un reverse shell.

Powershell base64 (encodé URL) fonctionne.

Le local.txt se trouve à C:\local.txt

Elévation des privilèges

nt authority\local service

Nous avons téléchargé le fichier .exe FullPowers.exe sur notre kali, lancer un server python puis l'avons ajouté sur notre machine cible. Nous avons également ajouté nc.exe.

Nous avons exécuté l'exploit et lancer un listener.

"SeImpersonatePrivilege" Nous pouvons l'exploiter

SeImpersonatePrivilege

Nous sommes nt authority\system !

Mis à jour