Last active
November 5, 2020 22:28
-
-
Save netspooky/6b18034a32168fde4df8966612a869b8 to your computer and use it in GitHub Desktop.
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
import urllib.request, json, sys, textwrap | |
# Run like | |
# python3 pubsploit.py CVE-2017-0143 | |
def cveSearch(cve): | |
with urllib.request.urlopen('http://cve.circl.lu/api/cve/'+cve) as url: | |
data = json.loads(url.read().decode()) | |
try: | |
if data['cvss']: | |
print("{} | CVSS {}".format(cve,data['cvss'])) | |
if data['summary']: | |
print('+-- Summary '+'-'*68+"\n") | |
print('\n'.join(textwrap.wrap(data['summary'],80))) | |
print() | |
if data['exploit-db']: | |
print('+-- ExploitDB '+'-'*66) | |
for d in data['exploit-db']: | |
print("| Title | {}".format(d['title'])) | |
print("| URL | {}".format(d['source'])) | |
print("+-------+"+"-"*71) | |
print() | |
if data['packetstorm']: | |
print('+-- Packet Storm '+'-'*63) | |
for p in data['packetstorm']: | |
print("| Title | {}".format(p['title'])) | |
print("| URL | {}".format(p['data source'])) | |
print("+-------+"+"-"*71) | |
print() | |
if data['metasploit']: | |
print('+-- Metasploit '+'-'*65) | |
for m in data['metasploit']: | |
print("| Title | {}".format(m['title'])) | |
print("| ID | {}".format(m['id'])) | |
print("| URL | {}".format(m['source'])) | |
print("+-------+"+"-"*71) | |
print() | |
except (TypeError, KeyError) as e: | |
print('oof') | |
print(e) | |
def gitSearch(cve): | |
with urllib.request.urlopen('https://api.github.com/search/repositories?q='+cve) as url: | |
data = json.loads(url.read().decode()) | |
try: | |
print('+-- GitHub '+'-'*69) | |
for i in data['items']: | |
print("| Repo | {}".format(i['full_name'])) | |
print("| Desc | {}".format(i['description'])) | |
print("| URL | {}".format(i['html_url'])) | |
print("+-------+"+"-"*71) | |
except (TypeError, KeyError) as e: | |
print('oof') | |
print(e) | |
cve = sys.argv[1] | |
cveSearch(cve) | |
gitSearch(cve) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yo yo yo!
Well, to distribute with pypi we need a git repo to host files and project.
I can see that your other projects can also be distribute with pypi so when I'll submit pull request to your future project you can
copy big parts of my changes to also distribute your others projects in the same way.
I let's you create your repo and ping me on twitter or irc/freenode (hberaud) when you are done :)