예제 #1
0
def auto_select_target(target, output=None):
    """Auto selection logic"""
    print("Target: %s" % target)
    try:
        inp = IPAddress(target);
        if inp.is_private() or inp.is_loopback():
            print("Internal IP Detected : Skipping")
            sys.exit()
        else:
            print("Looks like an IP, running ipOsint...\n")
            ipOsint.run(target, output)
    except SystemExit:
        print("exiting")
    except AddrFormatError:
        if re.match('[^@]+@[^@]+\.[^@]+', target):
            print("Looks like an EMAIL, running emailOsint...\n")
            emailOsint.run(target, output)
        elif get_tld(target, fix_protocol=True, fail_silently=True) is not None:
            print("Looks like a DOMAIN, running domainOsint...\n")
            domainOsint.run(target, output)
        else:
            print("Nothing Matched assuming username, running usernameOsint...\n")
            usernameOsint.run(target, output)
    except:
        print("Unknown Error Occured")
예제 #2
0
def auto_select_target(target, output=None):
    """Auto selection logic"""
    print "Target: %s" % target
    try:
        inp=IPAddress(target);
        if inp.is_private() or inp.is_loopback():
            print "Internal IP Detected : Skipping"
            sys.exit()
        else:
            print "Looks like an IP, running ipOsint...\n"
            ipOsint.run(target, output)
    except SystemExit:
        print "exiting"
    except AddrFormatError:
        if re.match('[^@]+@[^@]+\.[^@]+', target):
            print "Looks like an EMAIL, running emailOsint...\n"
            emailOsint.run(target, output)
        elif get_tld(target, fix_protocol=True,fail_silently=True) is not None:
            print "Looks like a DOMAIN, running domainOsint...\n"
            domainOsint.run(target, output)
        else:
            print "Nothing Matched assuming username, running usernameOsint...\n"
            usernameOsint.run(target, output)
    except:
        print "Unknown Error Occured"
예제 #3
0
def auto_select_target(target, output=None):
    """Auto selection logic"""
    print "Target: %s" % target
    try:
        inp = IPAddress(target)
        if inp.is_private() or inp.is_loopback():
            print "Internal IP Detected : Skipping"
            sys.exit()
        else:
            print "Looks like an IP, running ipOsint...\n"
            ipOsint.run(target, output)
    except SystemExit:
        print "exiting"
    except AddrFormatError:
        if re.match('[^@]+@[^@]+\.[^@]+', target):
            print "Looks like an EMAIL, running emailOsint...\n"
            return emailOsint.run(target, output)
        elif get_tld(target, fix_protocol=True,
                     fail_silently=True) is not None:
            print "Looks like a DOMAIN, running domainOsint...\n"
            # domainOsint.run(target, output)
            return {
                'error': True,
                'message': 'We do not do domain searches yet, sorry!'
            }
        else:
            print "Nothing Matched assuming username, running usernameOsint...\n"
            # usernameOsint.run(target, output)
            return {
                'error': True,
                'message': 'We do not do username searches yet, sorry!'
            }
    except:
        print "Unknown Error Occured"
예제 #4
0
def main(user_input):
    printart()
    print "User Input: %s" % user_input

    if re.match('[^@]+@[^@]+\.[^@]+', user_input):
        print "Looks like an EMAIL, running emailOsint...\n"
        emailOsint.run(user_input)
    elif re.match('^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', user_input):
        print "Looks like an IP, running ipOsint...\n"
        ipOsint.run(user_input)
    elif re.match('^[a-zA-Z\d-]{,63}(\.[a-zA-Z\d-]{,63}).$', user_input):
        print "Looks like a DOMAIN, running domainOsint...\n"
        domainOsint.run(user_input)
    else:
        print "Looks like a Username, running usernameOsint...\n"
        usernameOsint.run(user_input)
예제 #5
0
def main(user_input, output = None):
    printart()
    print "User Input: %s" % user_input

    if re.match('[^@]+@[^@]+\.[^@]+', user_input):
        print "Looks like an EMAIL, running emailOsint...\n"
        emailOsint.run(user_input, output)
    elif re.match('^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', user_input):
        print "Looks like an IP, running ipOsint...\n"
        ipOsint.run(user_input, output)
    elif re.match('^[a-zA-Z\d-]{,63}(\.[a-zA-Z\d-]{,63}).$', user_input):
        print "Looks like a DOMAIN, running domainOsint...\n"
        domainOsint.run(user_input, output)
    else:
        print "Looks like a Username, running usernameOsint...\n"
        usernameOsint.run(user_input, output)
예제 #6
0
    def auto_select_target(self, target, output=None):
        """Auto selection logic"""
        result = {}
        print("Target: %s" % target)
        try:
            inp = IPAddress(target)
            if inp.is_private() or inp.is_loopback():
                print("Internal IP Detected : Skipping")
                sys.exit()
            else:
                print("Looks like an IP, running ipOsint...\n")
                data = ipOsint.run(target, output)
                #print("*************************************************************************")
                #print(data)
                #print("*************************************************************************")
                result = {"target": target, "data": data}
                results.append(result)
                return result
        except SystemExit:
            print("exiting")
        except AddrFormatError:
            if re.match('[^@]+@[^@]+\.[^@]+', target):
                print("Looks like an EMAIL, running emailOsint...\n")
                data = emailOsint.run(target, output)
                #print("*************************************************************************")
                #print(data)
                #print("*************************************************************************")
                result = {"target": target, "data": data}
                results.append(result)
                return result
            elif get_tld(target, fix_protocol=True,
                         fail_silently=True) is not None:
                print("Looks like a DOMAIN, running domainOsint...\n")
                data = domainOsint.run(target, output)
                #print("************************domainOsint*************************************************")
                #print(data)
                #print("*************************************************************************")
                result = {"target": target, "data": data}
                results.append(result)
                return result
            else:
                print(
                    "Nothing Matched assuming username, running usernameOsint...\n"
                )
                data = usernameOsint.run(target, output)
                #print("*************************************************************************")
                #print(data)
                #print("*************************************************************************")
                result = {"target": target, "data": data}
                results.append(result)
                return result

        except:
            print("Unknown Error Occured")
        return result, 201
예제 #7
0
def main(argv):
    output = None
    desc = """                                                           
   ____/ /____ _ / /_ ____ _ _____ ____   / /____   (_)/ /_
  / __  // __ `// __// __ `// ___// __ \ / // __ \ / // __/
 / /_/ // /_/ // /_ / /_/ /(__  )/ /_/ // // /_/ // // /_  
 \__,_/ \__,_/ \__/ \__,_//____// .___//_/ \____//_/ \__/  
                               /_/                         
                                                           
            Open Source Assistant for #OSINT               
                www.datasploit.info                                                           

    """
    epilog = """              Connect at Social Media: @datasploit                  
                """
    # Set all parser arguments here.
    parser = argparse.ArgumentParser(
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description=textwrap.dedent(desc),
        epilog=epilog)
    parser.add_argument("-i",
                        "--input",
                        help="Provide Input",
                        dest='target',
                        required=True)
    parser.add_argument("-a",
                        "--active",
                        help="Run Active Scan attacks",
                        dest='active',
                        action="store_false")
    parser.add_argument(
        "-q",
        "--quiet",
        help="Run scans in automated manner accepting default answers",
        dest='quiet',
        action="store_false")
    parser.add_argument("-o",
                        "--output",
                        help="Provide Destination Directory",
                        dest='output')
    # check and ensure the config file is present otherwise create one. required for all further operations
    ds_dir = os.path.dirname(os.path.realpath(__file__))
    config_file_path = os.path.join(ds_dir, "config.py")
    config_sample_path = os.path.join(ds_dir, "config_sample.py")
    print os.path.exists(config_file_path)
    if not os.path.exists(config_file_path):
        print "[+] Looks like a new setup, setting up the config file."
        shutil.copyfile(config_sample_path, config_file_path)
        print "[+] A config file is added please follow guide at https://datasploit.github.io/datasploit/apiGeneration/ to fill API Keys for better results"
        # We can think about quiting at this point.
    # if no argument is provided print help and quit
    if len(argv) == 0:
        parser.print_help()
        sys.exit()
    # parse arguments in case they are provided.
    x = parser.parse_args()
    active = x.active
    quiet = x.quiet
    user_input = x.target
    output = x.output
    # Banner print
    print textwrap.dedent(desc)
    # Auto selection logic
    try:
        print "User Input: %s" % user_input
        try:
            inp = IPAddress(user_input)
            if inp.is_private() or inp.is_loopback():
                print "Internal IP Detected : Skipping"
                sys.exit()
            else:
                print "Looks like an IP, running ipOsint...\n"
                ipOsint.run(user_input, output)
        except SystemExit:
            print "exiting"
        except AddrFormatError:
            if re.match('[^@]+@[^@]+\.[^@]+', user_input):
                print "Looks like an EMAIL, running emailOsint...\n"
                emailOsint.run(user_input, output)
            elif get_tld(user_input, fix_protocol=True,
                         fail_silently=True) is not None:
                print "Looks like a DOMAIN, running domainOsint...\n"
                domainOsint.run(user_input, output)
            else:
                print "Nothing Matched assuming username, running usernameOsint...\n"
                usernameOsint.run(user_input, output)
        except:
            print "Unknown Error Occured"
    except KeyboardInterrupt:
        print "Ctrl+C called Quiting"