Пример #1
0
    def autoSherlock(self, host=None):
        print()
        print('Let me see what I can get for you...')
        print()

        if not host:
            return

        lookup = Lookup()
        if not host.domainName:
            host = lookup.doLookup(host)
        elif not host.ip:
            host = lookup.doLookup(host)

        if not host.ports:
            sType = 'F'
            scan = PortScan(host.ip, sType)
            host.ports = scan.runScan(host.ip, sType)

        if not host.whoisInfo:
            if not host.domainName:
                self.whoisLookup = Whois(ip=host.ip)
            else:
                self.whoisLookup = Whois(hostName=host.domainName)
            host.whoisInfo = self.whoisLookup.getInfo()
        return host
Пример #2
0
    def investigation(self):

        self.openInvestigation()

        while True:
            self.displayInvestMenu()

            cmd = input('> ')
            if cmd == '0':
                print('Add help')

            elif cmd == '1':
                self.hostInfo()

            elif cmd == '2':
                self.printReport(self.host)

            elif cmd == '3':
                lookup = Lookup()
                self.host = lookup.doLookup(self.host)
                if self.host.ip and self.host.domainName:
                    self.hostInfo()

            elif cmd == '4':
                print(
                    'What type of scan do you want to do? (e.g. F (default), sS, sV, A)'
                )
                sType = input('> ')
                scan = PortScan(self.host.ip, sType)
                self.host.ports = scan.runScan(self.host.ip, sType)

            elif cmd == '5':
                if not self.host.domainName:
                    self.whoisLookup = Whois(ip=self.host.ip)
                else:
                    self.whoisLookup = Whois(hostName=self.host.domainName)
                self.host.whoisInfo = self.whoisLookup.getInfo()

            elif cmd == '6':
                if not self.host.ip and not self.host.domainName:
                    print('I don\'t have enough info for that yet!')
                else:
                    self.autoSherlock(self.host)

            elif cmd == '96':
                self.exportReport(self.host)

            elif cmd == '97':
                self.host.changeIP()

            elif cmd == '98':
                self.host.changeDomain()

            elif cmd == '99':
                print('[!] Quitting!')
                break

            else:
                print('Please enter a valid option!')
    def autoSherlock(self, host=None, nmap=True):
        print()
        print('Let me see what I can get for you...')
        print()

        if not host:
            return

        lookup = Lookup()
        if not host.domainName:
            host = lookup.doLookup(host)
        elif not host.ip:
            host = lookup.doLookup(host)

        if nmap:
            if not host.ports:
                sType = 'F'
                scan = PortScan(host.ip, sType)
                resultL = scan.runScan(host.ip, sType)
                try:
                    host.ports = resultL[0]
                    host.status = resultL[1]
                except:
                    print('No ports returned')
        else:
            print()
            print('Run in passive mode. Skipping nmap scan!')

        if not host.whoisInfo:
            if not host.domainName:
                self.whoisLookup = Whois(ip=host.ip)
            else:
                self.whoisLookup = Whois(hostName=host.domainName)
            host.whoisInfo = self.whoisLookup.getInfo()
        if host.ip:
            asnLookup = AsnLookup()
            host.asnNum = asnLookup.lookup(host.ip)
            if host.asnNum:
                host.asnInfo = asnLookup.getDetails(host.asnNum)

        if host.domainName:
            print('Checking blacklists...')
            blackListCheck = BlackListCheck()
            host.blackListed = blackListCheck.singleLookup(host.domainName)

        return host
Пример #4
0
    def autoSherlock(self, host=None):
        print()
        print('Let me see what I can get for you...')
        print()

        if not host:
            return

        lookup = Lookup()
        if not host.domainName:
            host = lookup.doLookup(host)
        elif not host.ip:
            host = lookup.doLookup(host)

        if not host.ports:
            sType = 'F'
            scan = PortScan(host.ip, sType)
            resultL = scan.runScan(host.ip, sType)
            host.ports = resultL[0]
            host.status = resultL[1]

        if not host.whoisInfo:
                if not host.domainName:
                    self.whoisLookup = Whois(ip=host.ip)
                else:
                    self.whoisLookup = Whois(hostName=host.domainName)
                host.whoisInfo = self.whoisLookup.getInfo()
        if host.ip:
            asnLookup = AsnLookup()
            host.asnNum = asnLookup.lookup(host.ip)
            if host.asnNum:
                host.asnInfo = asnLookup.getDetails(host.asnNum)

        #self.printReport(host)

        return host
    def investigation(self):

        while True:
            self.displayInvestMenu()

            cmd = input('> ')
            if cmd == '0':
                self.showHelp()

            elif cmd == '1':
                self.hostInfo()

            elif cmd == '2':
                self.printReport(self.host)

            elif cmd == '3':
                lookup = Lookup()
                self.host = lookup.doLookup(self.host)
                if self.host:
                    if self.host.ip or self.host.domainName:
                        self.hostInfo()
                    else:
                        print('Need an IP or hostname first!')

            elif cmd == '4':
                print(
                    'What type of scan do you want to do? (e.g. F (default), sS)'
                )
                sType = input('> ')
                if self.host.ip:
                    scan = PortScan(self.host.ip, sType)
                    resultL = scan.runScan(self.host.ip, sType)
                    self.host.ports = resultL[0]
                    self.host.status = resultL[1]
                else:
                    print('Need an IP first!')

            elif cmd == '5':
                if not self.host.domainName:
                    self.whoisLookup = Whois(ip=self.host.ip)
                else:
                    self.whoisLookup = Whois(hostName=self.host.domainName)
                self.host.whoisInfo = self.whoisLookup.getInfo()
                self.printReport(self.host)

            elif cmd == '6':
                asnLookup = AsnLookup()
                if self.host:
                    if not self.host.ip:
                        lookup = Lookup()
                        self.host = lookup.doLookup(self.host)
                    if not self.host.ip:
                        print()
                        print('Couldn\'t get IP to search!')
                        print()
                    else:
                        self.host.asnNum = asnLookup.lookup(self.host.ip)
                        self.host.asnInfo = asnLookup.getDetails(
                            self.host.asnNum)
                        self.printReport(self.host)
                else:
                    print('I need an IP first!')

            elif cmd == '7':
                blackListCheck = BlackListCheck()
                if self.host.domainName:
                    self.host.blackListed = blackListCheck.singleLookup(
                        self.host.domainName)
                else:
                    print()
                    print('You need a hostname/domain name first!')

            elif cmd == '8':
                choices = ['A', 'P']
                choice = ""
                while choice.upper() not in choices:
                    print(
                        'Do you want to run AutoSherlock in (A)ctive or (P)assive mode? (Passive skips modules that directly touch targed i.e. nmap)'
                    )
                    choice = input('> ')

                if self.host:
                    if not self.host.ip and not self.host.domainName:
                        print('I don\'t have enough info for that yet!')
                    else:
                        if choice == 'A':
                            self.autoSherlock(self.host)
                        else:
                            self.autoSherlock(self.host, False)
                else:
                    print('You need to add an IP or hostname first!')

            elif cmd == '95':
                tzConverter = UtcToLocal()
                localTime = tzConverter.convPrompt()
                if localTime:
                    print('The event occured at {}'.format(localTime))
                else:
                    print('Unable to convert time!')

            elif cmd == '96':
                if self.host.ip or self.host.domainName:
                    self.exportReport(self.host)
                else:
                    print('At least add an IP or hostname first!')

            elif cmd == '97':
                self.host.changeIP()

            elif cmd == '98':
                self.host.changeDomain()

            elif cmd == '99':
                print('[!] Quitting!')
                break

            else:
                print('Please enter a valid option!')
Пример #6
0
    def investigation(self):
        
        while True:
            self.displayInvestMenu()

            cmd = input('> ')
            if cmd == '0':
                self.showHelp()

            elif cmd == '1':
               self.hostInfo()

            elif cmd == '2':
                self.printReport(self.host)

            elif cmd == '3':
                lookup = Lookup()
                self.host = lookup.doLookup(self.host)
                if self.host:
                    if self.host.ip or self.host.domainName:
                        self.hostInfo()
                    else:
                        print('Need an IP or hostname first!')

            elif cmd == '4':
                print('What type of scan do you want to do? (e.g. F (default), sS)')
                sType = input('> ')
                if self.host.ip:
                    scan = PortScan(self.host.ip, sType)
                    resultL = scan.runScan(self.host.ip, sType)
                    self.host.ports = resultL[0]
                    self.host.status = resultL[1]
                else:
                    print('Need an IP first!')

            elif cmd == '5':
                if not self.host.domainName:
                    self.whoisLookup = Whois(ip=self.host.ip)
                else:
                    self.whoisLookup = Whois(hostName=self.host.domainName)
                self.host.whoisInfo = self.whoisLookup.getInfo()
                self.printReport(self.host)

            elif cmd == '6':
                asnLookup = AsnLookup()
                if self.host:
                    if not self.host.ip:
                        lookup = Lookup()
                        self.host = lookup.doLookup(self.host)
                    if not self.host.ip:
                        print()
                        print('Couldn\'t get IP to search!')
                        print()
                    else:
                        self.host.asnNum = asnLookup.lookup(self.host.ip)
                        self.host.asnInfo = asnLookup.getDetails(self.host.asnNum)
                        self.printReport(self.host)
                else:
                    print('I need an IP first!')
            
            elif cmd == '7':
                if self.host:
                    if not self.host.ip and not self.host.domainName:
                        print('I don\'t have enough info for that yet!')
                    else:
                        self.autoSherlock(self.host)
                else:
                    print('You need to add an IP or hostname first!')

            elif cmd == '96':
                if self.host.ip or self.host.domainName:
                    self.exportReport(self.host)
                else:
                    print('At least add an IP or hostname first!')

            elif cmd == '97':
                self.host.changeIP()

            elif cmd == '98':
                self.host.changeDomain()

            elif cmd == '99':
                print('[!] Quitting!')
                break

            else:
                print('Please enter a valid option!')