Guest User

Untitled

a guest
Jun 18th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. $address = "58.182.213.101";
  4. $port = "7776";
  5. $servername = ":fake.irc.server ";
  6. /* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */
  7. $mysock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
  8. socket_bind($mysock, $address, $port);
  9. socket_listen($mysock, 5);
  10. for($x = 0; $x < 5; $x++) {
  11. $client = socket_accept($mysock);
  12. // Say Looking up hostname
  13. $output = $servername."NOTICE Auth :*** Please wait while we process your connection...\r\n";
  14.  
  15.  
  16. socket_write($client, $output);
  17. $output = $servername."NOTICE Auth :*** No ident response; username prefixed with ~\r\n";
  18. socket_write($client, $output);
  19. // Read the input from the client
  20. $input = substr(socket_read($client, 1024),5); // NICK Angel-SL
  21. $output = $servername."NOTICE Auth :*** Thank you for being tricked into connecting to this server! Your nick is: " . $input . " ***\r\n";
  22.  
  23. // Display output back to client
  24. socket_write($client, $output);
  25.  
  26. // CLOSE CONNECTION AND LOOP
  27. socket_close($client);
  28. }
  29.  
  30. ?>
Add Comment
Please, Sign In to add comment