Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $address = "58.182.213.101";
- $port = "7776";
- $servername = ":fake.irc.server ";
- /* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */
- $mysock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
- socket_bind($mysock, $address, $port);
- socket_listen($mysock, 5);
- for($x = 0; $x < 5; $x++) {
- $client = socket_accept($mysock);
- // Say Looking up hostname
- $output = $servername."NOTICE Auth :*** Please wait while we process your connection...\r\n";
- socket_write($client, $output);
- $output = $servername."NOTICE Auth :*** No ident response; username prefixed with ~\r\n";
- socket_write($client, $output);
- // Read the input from the client
- $input = substr(socket_read($client, 1024),5); // NICK Angel-SL
- $output = $servername."NOTICE Auth :*** Thank you for being tricked into connecting to this server! Your nick is: " . $input . " ***\r\n";
- // Display output back to client
- socket_write($client, $output);
- // CLOSE CONNECTION AND LOOP
- socket_close($client);
- }
- ?>
Add Comment
Please, Sign In to add comment