How to use the zoomeye.zoomeye.ZoomEyeAPI.OUTFILE function in zoomeye

To help you get started, we’ve selected a few zoomeye examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jm33-m0 / mec / zoomeye / zoomeye.py View on Github external
def api_test():
    '''
    get verified with zoomeye
    '''
    amnt = int(
        console.input_check(
            "[*] How many results do you want? (10 IPs on each page) ",
            check_type=int).strip())
    threads = []
    api = ZoomEyeAPI('zoomeye.conf')
    access_token = api.login()
    headers = {
        'Authorization': 'JWT ' + access_token,
    }
    status = threading.Thread(target=progress, args=(ZoomEyeAPI.OUTFILE,))
    status.setDaemon(True)
    status.start()
    limit = 0
    for page in range(1, int(amnt / 10)):
        thd = threading.Thread(
            target=crawler, args=(ZoomEyeAPI.QRY, amnt, page, headers,))
        threads.append(thd)
    for job in threads:
        job.setDaemon(True)
        job.start()
        if limit == 0 or limit == 10:
            limit = 0
            job.join()
        limit += 1
github jm33-m0 / mec / zoomeye / zoomeye.py View on Github external
'''
    put things together
    '''
    try:
        api_test()
    except (EOFError, KeyboardInterrupt, SystemExit):
        pass
    else:
        console.print_error('[-] Error with api_test')
        debug_traceback()

if __name__ == '__main__':
    try:
        ZoomEyeAPI.QRY = console.input_check(
            "[*] Your query is: ", allow_blank=False)
        ZoomEyeAPI.OUTFILE = '../data/zoomeye-{}.txt'.format(
                '-'.join(ZoomEyeAPI.QRY.replace(':', '_').split()))
        main()
    except KeyboardInterrupt:
        print('\n[*] Exiting...')
    else:
        debug_traceback()
github jm33-m0 / mec / zoomeye / zoomeye.py View on Github external
def crawler(qery, _, page, headers):
    '''
    fetch result from zoomeye
    '''
    try:
        r_get = requests.get(
            url='https://api.zoomeye.org/host/search?query=' +
            qery +
            '&facet=app,os&page=' +
            str(page),
            headers=headers)
        r_decoded = json.loads(r_get.text)
        for item in r_decoded['matches']:
            save_str_to_file(ZoomEyeAPI.OUTFILE, item['ip'])
    except BaseException:
        pass

zoomeye

Python library and command-line tool for ZoomEye (https://www.zoomeye.org/doc)

GPL-2.0
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis