Skip to content

Commit

Permalink
deleted nuclei_cves and added the code to ngix_vulns
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Sanchez authored and Miguel Sanchez committed Aug 13, 2022
1 parent 0999e31 commit c339a26
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions vuln_db/nuclei_vulns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from colorama import Fore
import requests
import subprocess


def commands(cmd):
try:
subprocess.check_call(cmd, shell=True)
except:
pass


def nginx_nginx_scan(url: str) -> str:
sessions = requests.Session()
res = sessions.get(f"{url}", verify=False)
for item, value in res.headers.items():
if "nginx" in value:
cmd = f"nuclei -t ~/nuclei-templates/misconfiguration/nginx/ -u {url} -silent"
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
check, err = p.communicate()
check = check.decode()
if check:
print(f"{Fore.MAGENTA}[+] {Fore.CYAN}- {Fore.GREEN}{check}")
else:
pass

def nuclei_cve_scan(domain: str) -> str:
cmd = "nuclei -u {domain} -tags cve -severity critical,high -silent"
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
check, err = p.communicate()
check = check.decode()

if check:
print(f"{Fore.MAGENTA}[+] {Fore.CYAN}- {Fore.GREEN}{check}")
else:
pass

0 comments on commit c339a26

Please sign in to comment.