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

Gbs.c

Gbs.c
Posted Feb 22, 2000
Authored by W. ter Maat

Grazer1's Bait System opens a specific port and logs connections to it. Simple and ghetto way to log Netbus requests.

tags | tool, intrusion detection
systems | unix
SHA-256 | 4d1c34d8c7e1d3019ddb12e8da599860277edd1654a3828364909bb64b8eec09

Gbs.c

Change Mirror Download
/*--------------- GrAzEr1's BAIT SYSTEM -------------------*/
/* Use this program to detect people who are connecting */
/* to you machine on a specified port (such as trojan ports)*/
/* They will be logged! */
/* to compile: gcc GBS.c -o BGS logfile: log.txt */
/* default port: 12345 */
/*-------------------------------------------------------- */
/* Please e-mail your comments to: uuhaas@hotmail.com */
/* Greetingz fly out to : ToXic N Togooz */
/* 05-03-2000 by GrAzEr1 */



#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <errno.h>

#define portnr 12345
#define que 2

main()
{
int fpoint;
int sockfd, new_s;
struct sockaddr_in my_addr;
struct sockaddr_in their_addr;
int sin_size;

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
perror("socket error");
exit(1);
}

my_addr.sin_family = AF_INET;
my_addr.sin_port = htons(portnr);
my_addr.sin_addr.s_addr = INADDR_ANY;
bzero(&(my_addr.sin_zero), 8);

if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr))
== -1)
{
perror("cannot bind");
exit(1);
}

if (listen(sockfd, que) == -1)
{
perror("listen error");
exit(1);
}

while(1) {
sin_size = sizeof(struct sockaddr_in);
if ((new_s = accept(sockfd, (struct sockaddr *)&their_addr,
&sin_size)) == -1)
{
perror("accept error");
continue;
}

{
FILE *fpoint;
fpoint = fopen ("log.txt", "a");
{
fputs (inet_ntoa(their_addr.sin_addr),fpoint);
fputs ("\n ",fpoint);
}
fclose (fpoint);
}


if (!fork())
{
if (send(new_s, "U R LOGGED\n", 11, 0) == -1)

perror("unable to send");


exit(0);

}

close(new_s);


while(waitpid(-1,NULL,WNOHANG) > 0);

}
}
Login or Register to add favorites

File Archive:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close