Advertisement
Guest User

Untitled

a guest
Oct 28th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. import socket
  2. import shutil
  3. import os
  4. import sys
  5. import threading
  6. import platform
  7. import requests
  8.  
  9.  
  10. BUFSIZE = 10000
  11. HOST = socket.gethostname()
  12. PORT = 4444
  13.  
  14. server= socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  15. server.bind((HOST, PORT))
  16.  
  17. server.listen(1)
  18.  
  19. connect,address = server.accept()
  20. print(f"Connecting from {address}")
  21.  
  22.  
  23.  
  24. def  ip():
  25.     connect.send(command.encode())
  26.  
  27.     ip=connect.recv(BUFSIZE)
  28.     ip=ip.decode()
  29.     print(ip)
  30.  
  31. def system():
  32.     connect.send(command.encode())
  33.    
  34.     system=connect.recv(BUFSIZE)
  35.     system=system.decode()
  36.     print(system)
  37.  
  38. def file_input():
  39.     connect.send(command.encode())
  40.  
  41.     smg=connect.recv(BUFSIZE)
  42.     smg=smg.decode()
  43.     print(smg)
  44.  
  45.    
  46.  
  47. while True:
  48.     command=input(str("Введите команду для выполнения>>"))
  49.  
  50.     if command=="system":
  51.         system()
  52.            
  53.     if command == "ip":
  54.         ip()
  55.  
  56.     if command=="exit":
  57.         sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement