Himeshvyas26

socket.py

Jun 12th, 2019
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. from socket import *
  2.  
  3. serverSocket = socket(AF_INET, SOCK_STREAM)
  4.  
  5. serverSocket.bind(('', 2603)) # 2603 port h apni dal do tum aab
  6. serverSocket.listen(1)
  7. while True:
  8. print ''
  9. connectionSocket, addr = serverSocket.accept()
  10. try:
  11. message = connectionSocket.recv(1024)
  12. filename = message.split()[1]
  13. f = open(filename[1:])
  14. outputdata = f.read()
  15. f.close()
  16.  
  17. connectionSocket.send('HTTP/1.0 200 OK\r\n\r\n')
  18.  
  19. for i in range(0, len(outputdata)):
  20. connectionSocket.send(outputdata[i])
  21. connectionSocket.close()
  22. except IOError:
  23.  
  24. connectionSocket.send('<h1>Hacked By T0Ph4Ck3R26<br><br><h2>Jai Hind Jai Bharat<hr>') # Yaha apna deface page add kar sakte aap :-) next me pastebin se connect kar dunga filhal edit kar ke yaha paste karna
  25.  
  26. connectionSocket.close()
  27. serverSocket.close()
Add Comment
Please, Sign In to add comment