TUTORIAL apt.htb
by ARhOmOuTEd - November 02, 2020 at 04:46 PM
#73
(March 02, 2021 at 04:23 AM)sasaga Wrote:
(December 01, 2020 at 08:46 AM)shiggy100 Wrote: crackmapexec seems to have problems with IPV6?

crackmapexec --verbose smb box.htb -u henry.vinson -H 2de80758521541d19cabba480b260e8f -d htb.local

Error: Error resolving hostname box.htb: [Errno -2] Name or service not known

AND yes box.htb resolving to the ipv6 address

doesn't really work. Any suggestions?

thanks for every helpful answer.

Install crackmapexec from sources with poetry
      #~ apt-get install -y libssl-dev libffi-dev python-dev build-essential
      #~ git clone --recursive https://github.com/byt3bl33d3r/CrackMapExec
      #~ cd CrackMapExec 
      #~ poetry install
      #~ poetry run crackmapexec

You need to modify the crackmapexec connections.py file to accept ipv6, these would be the changes add the following function to the code and replace the corresponding invocation line.


def gethost_addrinfo(hostname):
            try:
                for res in socket.getaddrinfo(hostname, None, socket.AF_INET6,
                        socket.SOCK_DGRAM, socket.IPPROTO_IP, socket.AI_CANONNAME):
                    af, socktype, proto, canonname, sa = res
            except socket.gaierror:
                for res in socket.getaddrinfo(hostname, None, socket.AF_INET,
                        socket.SOCK_DGRAM, socket.IPPROTO_IP, socket.AI_CANONNAME):
                    af, socktype, proto, canonname, sa = res
       
            return sa[0]

Remove:
     self.host = gethostbyname(self.hostname)
Add:
     self.host = gethost_addrinfo(self.hostname)
Awesome! Thanks for the hint

Possibly Related Threads…
Thread Author Replies Views Last Post
TUTORIAL HTB - APT - Full tutorial EddieFlagg 39 9,376 April 18, 2021 at 09:25 PM
Last Post: DinkyDoodle
TUTORIAL APT htb i need help asalam 0 295 April 08, 2021 at 01:16 PM
Last Post: asalam
TUTORIAL HTB - You have been banned by HTB-Bot HDplus 23 3,725 March 27, 2021 at 11:11 PM
Last Post: throwawayzero

 Users browsing this thread: 1 Guest(s)