what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ttdbsscan.c

ttdbsscan.c
Posted Sep 23, 1999
Authored by s0ftpj

rpc.ttdbserver scanner (adapted from statd scanner by BiT), it uses a file containing the list of ip's to scan. BFiSN98 (December 98). Linux - c source. Courtesy of soft project digital security for y2k

systems | linux
SHA-256 | 05145d5b163d2e69ed1cfd957250b9a0f75515bc8b529e83c010a091cee75de9

ttdbsscan.c

Change Mirror Download
/* Questo e' un rpc.ttdbserver scanner, visto che la modifica dello statd
scanner in questo caso mi e' costata qualke secondo non me ne prendo il
merito... trovo assurdo che su rootshell vengano messi scanner di questo
tipo. L'originale e' lo statd di BiT! In questo scanner ho messo una
costante di nome RPC_NAME adattando questa a un determinato servizio rpc
potete creare quanti scanner x rpc volete ...
pIGpEN */

#include <stdio.h>
#include <netdb.h>
#include <stdlib.h>
#include <signal.h>
#include <rpc/rpc.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>

#define ERROR -1
#define RPC_NAME "ttdbserver"

void woopy(int s);
void usage(char *s);
void scan(char *i, char *o);

int statd(char *host);
unsigned long int res(char *p);

void usage(char *s)
{
printf("rpc.ttdbserver scanner\n");
printf("Usage: %s <inputfile> <outputfile>\n",s);
exit(ERROR);
}

void main(int argc, char **argv)
{
if(argc < 3) usage(argv[0]);
scan(argv[1], argv[2]);
}

void scan(char *i, char *o)
{
FILE *iff, *of;
char buf[512];

if((iff=fopen(i,"r")) == NULL)
return;
while(fgets(buf,512,iff) != NULL)
{
if(buf[strlen(buf)-1]=='\n')
buf[strlen(buf)-1]=0;
printf("\n%s",buf); /* Modifica per vedere l'host corrente */
if(statd(buf) && (of=fopen(o,"a")) != NULL) {
buf[strlen(buf)+1]=0;
buf[strlen(buf)]='\n';

fputs(buf,of);
fclose(of);
}
}
fclose(iff);
}

void woopy(int s)
{
return;
}

int statd(char *host)
{
struct sockaddr_in server_addr;
struct pmaplist *head = NULL;
int sockett = RPC_ANYSOCK;
struct timeval minutetimeout;
register CLIENT *client;
struct rpcent *rpc;

server_addr.sin_addr.s_addr=res(host);
server_addr.sin_family=AF_INET;
server_addr.sin_port = htons(PMAPPORT);
minutetimeout.tv_sec = 15;
minutetimeout.tv_usec = 0;
signal(SIGALRM,woopy);
alarm(15);

if ((client = clnttcp_create(&server_addr, PMAPPROG,
PMAPVERS, &sockett, 50, 500)) == NULL) {
alarm(0);
signal(SIGALRM,SIG_DFL);
return 0;
}
alarm(0);
signal(SIGALRM,SIG_DFL);

if (clnt_call(client, PMAPPROC_DUMP, (xdrproc_t) xdr_void, NULL,
(xdrproc_t) xdr_pmaplist, &head, minutetimeout) != RPC_SUCCESS)
return 0;
if (head != NULL)
for (; head != NULL; head = head->pml_next)
if((rpc = getrpcbynumber(head->pml_map.pm_prog)))
if(strcmp(rpc->r_name,RPC_NAME) == 0)
return 1;

return 0;
}

unsigned long int res(char *p)
{
struct hostent *h;
unsigned long int rv;

h=gethostbyname(p);
if(h!=NULL)
memcpy(&rv,h->h_addr,h->h_length);
else
rv=inet_addr(p);
return rv;
}
Login or Register to add favorites

File Archive:

December 2023

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