-
Notifications
You must be signed in to change notification settings - Fork 6
/
tenssens.py
252 lines (228 loc) · 8.65 KB
/
tenssens.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Import Modules
import os
import json
import ipapi
import banner
import hashlib
import requests
import panelList
import builtwith
import robotsList
from time import sleep
from colorama import Fore
from getpass import getpass
class Tools:
# 1. Whois
def whoisInformation():
try:
websiteURL = input("(Whois) Enter Website Link : ")
url = websiteURL
result = requests.get(f"http://api.hackertarget.com/whois/?q={url}").text
print(result)
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 2. MD5 Hash Cracker
def md5Cracker():
try:
flag = 0
getHashedPassword = input("(MD5 Cracker) Enter hashed password : ")
getWordlist = input("Enter password wordlist : ")
getWordlist = open(wordlist, "r")
for word in getWordlist:
enc_wrd = word.encode("utf-8")
digest = hashlib.md5(enc_wrd.strip()).hexdigest()
if digest == getHashedPassword:
print("Password found!!")
print(f"Password is: {word} ")
flag = 1
break
if flag == 0:
print("Password is not in the list.")
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 3. Subdomain finder
def getSubDomains():
try:
getDomain = input("(Subdomain Finder) Enter Domain name : ")
filepath = input("Enter a file name to save (txt Format) : ")
url = f"https://api.securitytrails.com/v1/domain/ {getDomain} /subdomains"
querystring = {"children_only": "true"}
headers = {"accept": "application/json", "apikey": "APIKEY"}
response = requests.request("GET", url, headers=headers, params=querystring)
resultJson = json.loads(response.text)
subDomains = [i + "." + getDomain for i in resultJson["subdomains"]]
f = open(filepath, "w+")
for i in subDomains:
f.write(i + "\n")
f.close()
return subDomains
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 4. website builtwith information
def siteBuiltWith():
try:
target = input("(BuiltWith) Enter Domain URL : : ")
if not "https://" in target or not "http://" in target:
target = f"http://{target}"
information = builtwith.parse(target)
for name in information:
value = ""
for val in information[str(name)]:
name = name.replace("-", " ")
name = name.title()
value = value + str(val)
print(f"{name} : {value}")
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 5. DNS Lockup
def websiteDNSlockup():
try:
getDomainName = input("(DNS Lockup) Enter Domain URL : ")
result = requests.get(
"http://api.hackertarget.com/dnslookup/?q=" + getDomainName
).text
print(result)
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 6. Admin Panel Finder
def adminPanelFinder():
try:
url = input("(Admin Panel Finder) Enter Website URL : ")
if "http" in url:
url = url + "/"
elif "https" in url:
url = url + "/"
else:
url = "http://" + url + "/"
for i in panelList.pathList:
r = requests.get(url + i)
if r.status_code == 200:
print(f"{url} {i} Found.")
else:
print(f"{url} {i} Not Found.")
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 7. HTTP Header
def httpHeader():
try:
getSiteDomain = input("(HTTP Header) Enter The Website URL : ")
result = requests.get(
"https://api.hackertarget.com/httpheaders/?q=" + getSiteDomain
).text
print(result)
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 8. IP Location
def ipLocationFinder():
try:
getIpAddress = input("(IP Location) Enter IP Address : ")
source = ipapi.location(ip=getIpAddress, key=None, field=None)
try:
print("Your information : ")
print(" ip = " + source["ip"])
print(" city = " + source["city"])
print(" region = " + source["region"])
print(" id country = " + source["country"])
print(" country = " + source["country_name"])
print(" Calling Code = " + source["country_calling_code"])
print(" Languages = " + source["languages"])
print(" org = " + source["org"])
except:
print("Please Enter Valid IP Address.")
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 9. Port Scanning
def portScanning():
try:
getIpOrDomainName = input("(Port Scanner.) Enter IP or Domain name : ")
result = requests.get(
"https://api.hackertarget.com/nmap/?q=" + getIpOrDomainName
).text
print(result)
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
# 10. Get Robots txt File
def robotstxt():
try:
getDomain = input("(Robots txt) Plase Enter WebSite Address : ")
if "http" in getDomain:
pass
elif "http" != getDomain:
websiteURL = "http://" + getDomain
for i in robotsList.pathList2:
reqs = requests.get(websiteURL)
if reqs.status_code == 200 or reqs.status_code == 405:
print(websiteURL)
else:
print(websiteURL)
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
banner.toolBanner()
# Login
credentials = ["username", "password"]
username = input(Fore.GREEN + "Enter Login Username : ")
password = getpass("Enter Login Password : ")
if username == credentials[0] and password == credentials[1]:
print("\nLogin Successull.")
print("\nPlease Wait, Loading.")
sleep(0.3)
os.system("clear")
print("\nPlease Wait, Loading..")
sleep(0.3)
os.system("clear")
print("\nPlease Wait, Loading...")
sleep(0.3)
os.system("clear")
print("\nPlease Wait, Loading....")
sleep(0.3)
os.system("clear")
print("\nPlease Wait, Loading.....")
sleep(1.5)
os.system("clear")
# All Tools
print(
"""
ALl Tools (Select a Number)
--------------------------------------------------------------
01. Whois : Get Website Whois Information.
02. MD5 Cracker : MD5 Hash Cracker.
03. Subdomain finder : Find Subdomain of any website.
04. Site BuiltWith : Find CMS of and All Technology.
05. DNS Lockup : Get Information About DNS.
06. Admin Finder : Find Admin Panel of Website.
07. HTTP Header : Get HTTP Header Information.
08. IP Location : Find Location From IP Address.
09. Port Scan : Network Port Scanner.
10. Robots.txt : Get Robots txt File of any website.
--------------------------------------------------------------
"""
)
try:
tools = input("Select a Number : ")
if "1" == tools or "01" == tools:
Tools.whoisInformation()
elif "2" == tools or "02" == tools:
Tools.md5Cracker()
elif "3" == tools or "03" == tools:
Tools.getSubDomains()
elif "4" == tools or "04" == tools:
Tools.siteBuiltWith()
elif "5" == tools or "05" == tools:
Tools.websiteDNSlockup()
elif "6" == tools or "06" == tools:
Tools.adminPanelFinder()
elif "7" == tools or "07" == tools:
Tools.httpHeader()
elif "8" == tools or "08" == tools:
Tools.ipLocationFinder()
elif "9" == tools or "09" == tools:
Tools.portScanning()
elif "10" == tools:
Tools.robotstxt()
else:
print("Enter a Valid Number between 1 and 10.")
except Exception as err:
print(f"An Error Occurred : {err}, Try Again.")
else:
print(Fore.RED + "Wrong Login Information. Please try Again.")
exit()