-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpy_tools.py
156 lines (144 loc) · 5.67 KB
/
py_tools.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
def py_tools():
import os
print("[*]Enter 'exit' to exit")
print("[*]Enter 'show options' to show all project")
def py_tools_options(): #show all project for the pt_tools payload
print("""
1:Requests To Website enter:1
2:Get Web page 's resouces code enter:2
3:Get Website status code enter:3
4:Get webpage information enter:4
5:Whois enter:5
""")
return True
def main_py_tools():
options = input("Setool-Master~/Main Console~/py_tools//")
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36"
}
if options == "show options": #show all project for the py_tools
py_tools_options()
main_py_tools()
return True
if options == "exit":
import setool as setool
setool.main()
return True
if options == "1":
#Requests To Website
def Requests_web_site():
import requests
url = input("Enter URL:")
try:
geturl = requests.get(url)
print("Get The Requests:"+url)
if geturl.status_code == 200:
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36"
}
print("")
print(" Send Get requests to "+url)
print(" Reture : true")
print("")
return True
else: #if the function running error than run this function
geturl = requests.get(url)
print("")
print(" [!]Error status code")
print(" Send Get requests to "+url)
print(" [!]Status Code:"+geturl.status_code)
print("")
return False
except:
print("[!]Error Running")
return False
Requests_web_site()
main_py_tools() #retrue to the main function
return True
if options == "2":
#get web page resouces code
def get_webpage_resouces_code():
import requests
url = input("Enter URL:")
if url == "exit":
main_py_tools()
return True
else:
getcode = requests.get(url)
print("Get Web Page:"+url)
print("")
getcode.encoding = "utf8"
print(getcode.text)
print("")
chose = input("[?]Do you want to write to a file[Y or N]:")
if chose == "Y" or chose == "y":
with open("file" , "w") as f:
f.write(getcode.text)
f.close()
print("[*]wirte the file true")
return True
if chose == "N" or chose == "n":
print("Exit The Optioning")
return False
return True
get_webpage_resouces_code()
main_py_tools()
if options == "3":
def get_webpage_code():
try:
import requests
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36"
}
import requests as requests #import requests payload
url = input("Enter URL:")
print("[*]Get status code form "+url)
geturl = requests.get(url)
print("The Status Code:")
print(geturl.status_code)
print("")
return True
except:
print("[!]Error Running")
return False
get_webpage_code()
main_py_tools()
return True
if options == "4":
def get_webpage_info():
import os
import requests
try:
url = input("Enter URL:")
geturl = requests.get(url)
import urllib
print("")
print("URL:"+url)
print("Server Info:"+geturl.headers)
print("")
return True
except:
print("[!]Error Running")
return False
get_webpage_info()
main_py_tools()
return True
if options == "5":
#whois
try:
import whois
url = input("Enter URL:")
print("==================================")
print(whois.whois(url))
print("==================================")
main_py_tools()
return
except:
print("[!]Error Runnning")
main_py_tools()
return False
return True
else:
main_py_tools() #reture to main function
return False
main_py_tools()