-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deleted nuclei_cves and added the code to ngix_vulns
- 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.
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,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 |