-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
5 changed files
with
166 additions
and
64 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
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 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,79 @@ | ||
import requests | ||
from urllib.parse import urlsplit | ||
from termcolor.termcolor import colored, cprint | ||
|
||
__all__ = ['info'] | ||
|
||
|
||
class info(): | ||
def __init__(self): | ||
pass | ||
|
||
def scan(self,target): | ||
execute_all_func(target) | ||
|
||
def execute_all_func(self, target): | ||
try: | ||
self.get_robots_txt(target) | ||
except: | ||
cprint("No robots.txt file Found!", "blue") | ||
try: | ||
self.get_dot_git(target) | ||
except: | ||
cprint("Error !", "red") | ||
try: | ||
self.get_dot_svn(target) | ||
except: | ||
cprint("Error", "red") | ||
try: | ||
self.get_dot_htaccess(target) | ||
except: | ||
cprint("Error", "red") | ||
|
||
def get_robots_txt(self, target): | ||
cprint("[*]Checking for Robots.txt", 'yellow') | ||
url = target | ||
target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) | ||
req = requests.get(target+"/robots.txt") | ||
r = req.text | ||
cprint(r, 'blue') | ||
|
||
def get_dot_git(self, target): | ||
cprint("[*]Checking for .git folder", 'yellow') | ||
url = target | ||
target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) | ||
req = requests.get(target+"/.git/") | ||
r = req.status_code | ||
if r == 200: | ||
cprint("Alert!", 'red') | ||
cprint(".git folder exposed publicly", 'red') | ||
else: | ||
print("NO .git folder found", 'blue') | ||
|
||
def get_dot_svn(self, target): | ||
cprint("[*]Checking for .svn folder", 'yellow') | ||
url = target | ||
target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) | ||
req = requests.get(target+"/.svn/entries") | ||
r = req.status_code | ||
if r == 200: | ||
cprint("Alert!", 'red') | ||
cprint(".SVN folder exposed publicly", 'red') | ||
else: | ||
cprint("NO .SVN folder found", 'blue') | ||
|
||
def get_dot_htaccess(self, target): | ||
cprint("[*]Checking for .htaccess", 'yellow') | ||
url = target | ||
target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) | ||
req = requests.get(target+"/.htaccess") | ||
r = req.text | ||
statcode = req.status_code | ||
if statcode == 403: | ||
cprint("403 Forbidden", 'blue') | ||
elif statcode == 200: | ||
cprint("Alert!!", 'blue') | ||
cprint(".htaccess file found!", 'blue') | ||
else: | ||
cprint("Status code", 'blue') | ||
cprint(statcode, 'blue') |
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 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