コード例 #1
0
ファイル: zm.py プロジェクト: sarleon/exploit_platform
def search(query):

    zm = zoomeye.ZoomEye()
    zm.username=ZOOMEYE_USERNAME
    zm.password=ZOOMEYE_PASSWORD
    zm.login()
    zm.dork_search()
コード例 #2
0
def searchzoomeye():
    logo.zoomeyelogo()
    dir(zoomeye)
    zm = zoomeye.ZoomEye()
    zm.username = '******'
    zm.password = '******'
    zm.login()

    f = open('search.txt')
    for x in f.readlines():
        time.sleep(0)
        #print x.rstrip()
        data = zm.dork_search(x)
        print('*') * 95
        strdata = str(data)
        ip = re.findall(r'[0-9]+(?:\.[0-9]+){3}', strdata)
        urls = re.findall(
            'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',
            strdata)
        with open('table.txt', "a") as file:
            file.write("\n")
            file.write(
                "*****************ZoomEye Google Dorks***************************"
            )
            file.write("\n")
            for x in ip:
                print x
                file.write("\n")
                file.write(x)
コード例 #3
0
 def zoomeyes(self):
     conf = configparser.ConfigParser()
     conf.read('config.ini')
     ID = conf.get("zoomeye", "ID")
     password = conf.get("zoomeye", "password")
     zm = zoomeye.ZoomEye()
     zm.username = ID
     zm.password = password
     print(zm.login())
     keyword = self.lineEdit.text()
     pages = self.lineEdit_2.text()
     for mun in range(int(pages)):
         print(mun)
         data = zm.dork_search(keyword, page=mun)
         for i in data:
             self.textEdit.append(i.get('site'))
コード例 #4
0
 def zkzy(self):  #zoomeye
     conf = configparser.ConfigParser()
     conf.read("config.ini")
     ID = conf.get("zoomeye", "ID")
     password = conf.get("zoomeye", "password")
     zm = zoomeye.ZoomEye()
     zm.username = ID
     zm.password = password
     print(zm.login())
     apstr = self.lineEdit.text()  #搜索
     pages = self.lineEdit_2.text()  #页数
     apiurl = "https://api.zoomeye.org/host/search?query=" + apstr + "&page="
     headers = {'Authorization': 'JWT' + ' ' + zm.login()}
     for mun in range(1, int(pages) + int(1)):
         openurl = requests.get(apiurl + str(mun), headers=headers)
         data = json.loads(openurl.text)
         for s in data['matches']:
             ip = s['ip']
             port = s['portinfo']['port']
             self.textEdit_2.append(str(ip) + ':' + str(port))
コード例 #5
0
def zkzy(keyword, page):
    conf = configparser.ConfigParser()
    conf.read(os.getcwd() + "\\odbcs\\config.ini")
    ID = conf.get("zoomeye", "ID")
    password = conf.get("zoomeye", "password")
    zm = zoomeye.ZoomEye()
    zm.username = ID
    zm.password = password
    print('zoomeye登录成功:' + zm.login())
    apstr = keyword  #输入关键词
    pages = int(page) + int(1)  #页数
    apiurl = "https://api.zoomeye.org/host/search?query=" + apstr + "&page="
    headers = {'Authorization': 'JWT' + ' ' + zm.login()}
    results = []
    for mun in range(1, int(pages)):
        #print('number:'+str(mun))
        openurl = requests.get(apiurl + str(mun), headers=headers)
        data = json.loads(openurl.text)
        for s in data['matches']:
            ipstr = str(s['ip']) + ':' + str(s['portinfo']['port'])
            results.append(ipstr)

    return results
コード例 #6
0
 def setUp(self):
     self.zm = zoomeye.ZoomEye()
コード例 #7
0
print("\033[91m3 \033[92m) \033[0mScan selected target \n")
choose=int(input("\033[96m[\033[91m+\033[96m] \033[0mChoose: "))
if choose==1:
   target=raw_input("\033[96m[\033[91m+\033[96m] \033[0mEnter target: ")
   print("\033[96m========== \033[92mScanning\033[0m %s \033[92mwith Shodan \033[96m==========\033[0m \n"%(target))
   os.system("shodan host "+target)
elif choose==2:
   dork=raw_input("\033[96m[\033[91m+\033[96m] \033[0mEnter dork: ")
   print("\033[96m========== \033[92mScanning\033[0m %s \033[92mdork with Shodan \033[96m==========\033[0m \n"%(dork))
   with open('apikeys/shodan.txt', 'r') as file:
      api_key = file.read().replace('\n', '')
   api = Shodan(api_key)
   for targets in api.search_cursor(dork):
      print(targets['ip_str'])
   print("\033[96m========== \033[92mScanning\033[0m %s \033[92mdork with ZoomEye \033[96m==========\033[0m \n"%(dork))
   zoom = zoomeye.ZoomEye()
   with open('apikeys/zoomuser.txt') as zfile:
      zoomuser = zfile.read().replace('\n', '')
   zoom.username = zoomuser
   with open('apikeys/zoompass.txt') as pfile:
      zoompass = pfile.read().replace('\n', '')
   zoom.password = zoompass
   logs = zoom.login()
   data = zoom.dork_search(dork)
   zoomeye.show_site_ip(data)
elif choose==3:
   with open('temp.txt', 'r') as file:
      specified=file.read().replace('\n', '')
   print("\033[96m========== \033[92mScanning\033[0m %s \033[92mwith Shodan \033[96m==========\033[0m \n"%(specified))
   os.system("shodan host "+specified)
else:
コード例 #8
0
 def __init__(self, keyword):
     self.__zoom = zoomeye.ZoomEye(zoomeyeLoginInfo.username,
                                   zoomeyeLoginInfo.password)
     self.__login = self.__zoom.login()
     self.keyword = keyword
コード例 #9
0
__author__ = 'MR.SJ'

#####################################################
# example:
#python lock.py -d app,os -p 1 -o 21 -r xxe.py
#-d dork
#-p page
#-o port
#-r poc
####################################################
import getopt
import sys
import zoomeye

if __name__ == "__main__":
    z = zoomeye.ZoomEye("*****@*****.**", "wsx88619973@", 0)
    z.login()
    dork = ''
    port = 0
    page = 1
    poc_name = ''
    opts, args = getopt.getopt(sys.argv[1:], "hd:o:p:r:")
    for op, value in opts:
        if op == '-d':
            dork = value
        elif op == '-p':
            page = value
        elif op == '-o':
            port = value
        elif op == '-r':
            poc_name = value