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

Thrip Port Scanner

Thrip Port Scanner
Posted Aug 4, 2012
Authored by grell64

This is a multithreaded scanner that scans many ip addresses on a specified port simultaneously. It is very useful for finding insecure systems when used with such ports as 23 (Telnet) or 8080, which is the web interface for many routers. The author of this program takes no responsibility for the actions of its users.

tags | tool, web, scanner
systems | unix
SHA-256 | 8b00dfe8071bfc1a6b2d42de3eb31f6439e21d035b5ca397aa790740648b7fa1

Thrip Port Scanner

Change Mirror Download
/* 
Compile with: gcc thrip.c -o thrip -pthread

This is a multithreaded scanner that scans many ip addresses on a specified port simultaneously. It is very useful for finding insecure systems when used with such ports as 23 (Telnet) or 8080, which is the web interface for many routers. The author of this program takes no responsiblity for the actions of its users. If you have any comments or suggestions, feel free to contact me at this email: grell64@gmail.com. Thanks and enjoy.

-Grell
*/

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


void usage(char *);

void *net_thread(void *);

FILE *glob_file;

int glob_port;

static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;

static pthread_mutex_t mtx2 = PTHREAD_MUTEX_INITIALIZER;

int main(int argc, char *argv[])
{
int numthreads, rc;
long i;

srand(time(NULL));
if(argc != 3)
usage(argv[0]);

glob_port = atoi(argv[1]);
numthreads = atoi(argv[2]);
unsigned long *taskids[numthreads];
pthread_t thread_array[numthreads];

// generate array of random ip addresses
for(i = 0; i <= numthreads; i++)
{
taskids[i] = (long *) malloc(sizeof(long));
*taskids[i] = i;
rc = pthread_create(&thread_array[i], NULL, net_thread, (void *) taskids[i]);
}

// wait for all threads to finish

for(i = 0; i <= numthreads; i++)
{
pthread_join(thread_array[i], NULL);
}
return 0;
}

void usage(char *progname)
{
fprintf(stderr, "Usage: %s <port> <numthread>\n", progname);
exit(1);
}

void *net_thread(void *thr_arg)
{
int sockfd, s, g;
unsigned long connip;
unsigned int a, b, c, d;
struct sockaddr_in mysock;
char str_ip[30];


connip = (long) rand();
// separate bytes in connip

a = (connip >> 24 & 0xFF);
b = (connip >> 16 & 0xFF);
c = (connip >> 8 & 0xFF);
d = (connip & 0xFF);

if(a == 0x7F){ //loopback
return 0;
}


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

snprintf(str_ip, sizeof(str_ip), "%d.%d.%d.%d", a, b, c, d);

bzero(&mysock, sizeof(mysock));

mysock.sin_family = AF_INET;
mysock.sin_port = htons(glob_port); // short, network byte order
mysock.sin_addr.s_addr = htonl(connip);

if((connect(sockfd, (struct sockaddr *) &mysock, sizeof(mysock))) == -1){
switch(errno){
case ECONNREFUSED:
case ETIMEDOUT:
break;
default:
break;
}
return 0;
}
/* connection succeeds */
else{
g = pthread_mutex_lock(&mtx2);
printf("Port %d Open on %s\n", glob_port, str_ip);
g = pthread_mutex_unlock(&mtx2);
return 0;
}

return 0;
}
Login or Register to add favorites

File Archive:

April 2024

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