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

msadcscan-unix.c

msadcscan-unix.c
Posted Dec 13, 1999
Authored by synnergy, elux | Site synnergy.net

Synnergy Networks msadc scanner - This is just a basic string scanner that happens to scan for the msadc module string.

SHA-256 | 43eb2a907f3b1f2f09d00bfb5c51fe0347776efd1e8c47248536521263f254a9

msadcscan-unix.c

Change Mirror Download
// *** Synnergy Networks

// * Description:
//
// msadc scanner.

// * Usage:
//
// # gcc -o msadcscan-unix msadcscan-unix.c
// # ./msadcscan-unix [infile] [outfile]

// * Author:
//
// elux (elux@synnergy.net)
// Synnergy Networks (c) 1999, http://www.synnergy.net

// * Comments:
//
// This is just a basic string scanner that happens to scan for the msadc module
// string. If you want to edit this to scan for something else, by all means. It
// was designed to work with IP databases for the input-file.

// *** Synnergy Networks

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

#define HTTPPORT 80
#define MAXDATASIZE 100

int probe(char *host);

int main(int argc, char **argv)
{
FILE *in, *out;
char buf[MAXDATASIZE];

if (argc < 3)
{
fprintf(stderr, "\nmsadc vuln scanner - by elux\n");
fprintf(stderr, "usage: %s [infile] [outfile]\n\n", argv[0]);
exit(-1);
}

if ((in = fopen(argv[1], "r")) == NULL)
{
fprintf(stderr, "Error opening %s\n", argv[1]);
exit(1);
}

while (fgets(buf, 100, in) != NULL)
{
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) -1] = 0;
if (probe(buf) && (out = fopen(argv[2], "a")) != NULL)
{
buf[strlen(buf) + 1] = 0;
buf[strlen(buf)] = '\n';

fprintf(out, "%s", buf);
fclose(out);
}
}
fclose(in);
}

int probe(char *host)
{
struct sockaddr_in their_addr;
int sockfd;
struct hostent *he;
char sendstr[] = "GET /msadc/msadcs.dll";
char *vulnstr = "Microsoft-IIS/4.0";
char *vulnstr2 = "HTTP/1.1 200 OK";
char buf[MAXDATASIZE];

if ((he = gethostbyname(host)) == NULL)
return 0;

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
return 0;

their_addr.sin_family = AF_INET;
their_addr.sin_port = htons(HTTPPORT);
their_addr.sin_addr = *((struct in_addr *)he->h_addr);
bzero(&(their_addr.sin_zero), 8);

if (connect(sockfd, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) == -1)
return 0;

sendstr[strlen(sendstr)] = '\n';
write(sockfd, sendstr, sizeof(sendstr));
read(sockfd, buf, 100);

if (strstr(buf, vulnstr) && strstr(buf, vulnstr2))
{
close(sockfd);
return 1;
}
else
close(sockfd);
return 0;
}

// EOF
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 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