forked from Xyntax/POC-T
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
289 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# !/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
__author__ = 'xy' | ||
|
||
import censys.certificates | ||
|
||
UID = "login for API key" | ||
SECRET = "login for API secret" | ||
|
||
certificates = censys.certificates.CensysCertificates(UID, SECRET) | ||
fields = ["parsed.subject_dn", "parsed.fingerprint_sha256", "parsed.fingerprint_sha1"] | ||
|
||
for c in certificates.search("current_valid_nss: true"): | ||
print c["parsed.subject_dn"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
from lib.api.zoomeye.zoomeye import ZoomEye | ||
from lib.core.data import logger | ||
from lib.core.log import CUSTOM_LOGGING | ||
from lib.core.enums import EXIT_STATUS | ||
|
||
|
||
def _initial(): | ||
z = ZoomEye() | ||
token_path = os.path.join(os.path.expanduser('~'), '.zoomeye-token') | ||
if not os.path.isfile(token_path): | ||
msg = 'ZoomEye API authorization failed, Please input ZoomEye Email and Password.' | ||
logger.log(CUSTOM_LOGGING.SUCCESS, msg) | ||
token = z.login() | ||
if token: | ||
open(token_path, 'w').write(token) | ||
msg = 'Save ZoomEye access token to: ' + token_path | ||
logger.log(CUSTOM_LOGGING.SUCCESS, msg) | ||
else: | ||
msg = 'Invalid ZoomEye username or password.' | ||
logger.log(CUSTOM_LOGGING.ERROR, msg) | ||
sys.exit(EXIT_STATUS.ERROR_EXIT) | ||
|
||
else: | ||
msg = 'Load ZoomEye access token from: ' + token_path | ||
logger.log(CUSTOM_LOGGING.SUCCESS, msg) | ||
z.setToken(open(token_path).read()) | ||
|
||
info = z.resources_info()['resources'] | ||
|
||
if info: | ||
logger.log(CUSTOM_LOGGING.SUCCESS, msg) | ||
msg = 'Available ZoomEye search, web-search:{}, host-search:{}'.format(info['web-search'], info['host-search']) | ||
logger.log(CUSTOM_LOGGING.SYSINFO, msg) | ||
else: | ||
os.remove(token_path) | ||
msg = 'ZoomEye API authorization failed, Please re-run it and enter a new token.' | ||
logger.log(CUSTOM_LOGGING.ERROR, msg) | ||
sys.exit(EXIT_STATUS.ERROR_EXIT) | ||
|
||
return z | ||
|
||
|
||
def dorkSearch(query, type='host', page=1): | ||
z = _initial() | ||
ans = [] | ||
for page_n in range(page): | ||
data = z.dork_search(query, resource=type, page=page_n) | ||
if data: | ||
for i in data: | ||
ip_str = i.get('ip') | ||
if i.has_key('portinfo'): | ||
ip_str = ip_str + ':' + str(i.get('portinfo').get('port')) | ||
ans.append(ip_str) | ||
else: | ||
break | ||
return ans |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.