Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import os
  2. import socket
  3. ip = "192.168.1.20"
  4. port = 1337
  5.  
  6. udpsocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  7.  
  8. udpsocket.bind((ip,port))
  9.  
  10. while True:
  11. data, addr = udpsocket.recvfrom(1024)
  12. if data == "disconnect":
  13. os.system("netsh advfirewall set currentprofile state on")
  14. elif data == "connect":
  15. os.system("netsh advfirewall set currentprofile state off")
  16. elif data == "exit":
  17. quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement