-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttpsx.py
More file actions
150 lines (120 loc) · 3.95 KB
/
httpsx.py
File metadata and controls
150 lines (120 loc) · 3.95 KB
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
import sys
import argparse
import random
parser = argparse.ArgumentParser(usage="%(prog)s -f file -o output", epilog="[*] %(prog)s -f file.txt -o output.txt")
parser.add_argument("-u", "--url",
metavar="url",
help="submit url",
dest="arg_url",
nargs="+"
)
parser.add_argument("-f", "--file",
metavar="file",
help="submit input url file",
dest="arg_file"
)
parser.add_argument("-o", "--output",
metavar="output",
help="set output file name",
dest="arg_output"
)
args = parser.parse_args()
arg_url = args.arg_url
arg_file = args.arg_file
arg_output = args.arg_output
lst, https_url_lst, http_url_lst = [], [], []
def banner():
banner1 = """
__ __ __ _ __
/ /_ / /_/ /_____ ____| |/ /
/ __ \/ __/ __/ __ \/ ___/ /
/ / / / /_/ /_/ /_/ (__ ) |
/_/ /_/\__/\__/ .___/____/_/|_|
/_/
"""
banner2 = """
.__ __ __
| |___/ |__/ |_______ _________ ___
| | \ __\ __\____ \/ ___/\ \/ /
| Y \ | | | | |_> >___ \ > <
|___| /__| |__| | __/____ >/__/\_ """+"""\"""
\/ |__| \/ \/
"""
banner3 = """
__ __ __
/ /_ / /_/ /_____ ______ __
/ __ \/ __/ __/ __ \/ ___/ |/_/
/ / / / /_/ /_/ /_/ (__ )> <
/_/ /_/\__/\__/ .___/____/_/|_|
/_/
"""
banner4 = """
.__ __ __ ____ ___
| |___/ |__/ |_______ _____\ \/ /
| | \ __\ __\____ \/ ___/\ /
| Y \ | | | | |_> >___ \ / \
|___| /__| |__| | __/____ >___/\ """+"""\"""
\/ |__| \/ \_/
"""
banners = [banner1, banner2, banner3, banner4]
print(random.choice(banners))
print("[*] Created by Adarsh Addee!!!")
print("[*] Make any link full accessible!!!")
print("[*] You can use a file to create URL and save output!!!")
print()
def make_url(make_url):
r_https = "https://"+make_url
r_http = "http://"+make_url
print(r_https)
print(r_http)
https_url_lst.append(r_https)
http_url_lst.append(r_http)
def handle_url(*url_entry):
for var in url_entry:
for l in var:
if len(l) > 1:
lst.append(l)
try:
if len(lst) > 1:
for arg_tuple in url_entry:
for url in arg_tuple:
make_url(url)
if len(lst) <= 1:
for url in url_entry:
make_url(url)
except Exception as e:
print("[X] Try to Add Two URLs!!!")
print("[X] Kindly Add Two URLs!!!")
def handle_file():
if arg_file:
with open(arg_file) as file:
for line in file:
line = line.strip("\n")
handle_url(line)
def handle_output():
if arg_output:
with open(arg_output, "a") as output_file:
output_file.write("All https links are:")
output_file.write("\n")
for htps_url in https_url_lst:
output_file.write(htps_url)
output_file.write("\n")
output_file.write("\n\n")
output_file.write("All http links are:")
output_file.write("\n")
for htp_url in http_url_lst:
output_file.write(htp_url)
output_file.write("\n")
output_file.write("\n")
if __name__ == "__main__":
if len(sys.argv) == 1:
banner()
parser.print_help(sys.stderr)
sys.exit(1)
if arg_file:
handle_file()
if arg_url:
handle_url(arg_url)
if arg_output:
handle_output()
print()