-
Notifications
You must be signed in to change notification settings - Fork 14.5k
MantisBT 1.2.13-1.2.16 Arbitrary File Read via SQLi #3057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
remove extra new line and fix author line
FWIW the version that is fixed is 1.2.17 and has been officially released by the MantisBT team: |
|
||
resp.body =~ /qgjuq(.*)qirpq/ | ||
|
||
file = [$1].pack("H*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use .match instead of automatch variables here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
msftidy run:
|
All of the comments should be addressed now. Let me know if you see any more issues! Sent from a computer
|
[ | ||
OptString.new('FILEPATH', [ true, 'Path to remote file', '/etc/passwd']), | ||
OptString.new('USERNAME', [ true, 'Single username', 'administrator']), | ||
OptString.new('PASSWORD', [ true, 'Single password', 'password']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version uses the default password "password"? I'm testing on 1.2.16 and the default password is "root".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default password is not password. Sorry, that is a remnant of development. Let me change it to root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I tried to read a different file other than /etc/passwd, and I'd get nothing: Can you please try to read a different file and see if it works? |
Yes, but it may be a bit before I can test... That is odd, I am sure I had tested that. |
Testing now, give me a few |
You are right, it looks like it has issues with other files, but I am not sure why. Even sqlmap cannot download anything except the /etc/passwd file, which is quite weird. Still digging...
|
I believe we are running into this bug: http://bugs.mysql.com/bug.php?id=38403 Going to install on CentOS and see if that changes the behavior. LOAD_FILE is apparently very buggy. FWIW I tried disabling apparmor as well to no avail. IIRC my original testing was on centos 6.5, and I am sure that /tmp was able to be read from. |
BTW I am assuming you threw together an Ubuntu vm to repro this? |
Yeah, Ubuntu 12.04.4 LTS |
Yep, throwing up a CentOS vm now, will install and test. Give me a few. Should have results by 5. |
Uh. If you can do a SELECT LOAD_FILE("/etc/passwd"); you can do a SELECT "" INTO OUTFILE "/some/writeable/web/dir/file.php"; and just drop a shellstager... Right? So why not that? |
@infodox That is assuming you have WRITE permission and that AppArmor allows it, which by default doesn't. |
Yes, I cannot write to the FS, only read. On CentOS (with SELinux disabled) I can read files from /tmp as well.
|
Ok, so that's probably an issue with load_file on ubuntu then. Since that's the only problem I've found and it's not your fault, I'd like to go ahead and land it if you don't mind. |
Go for it! Sent from a computer
|
http://www.mantisbt.org/bugs/view.php?id=17055
This module exploits the above vulnerability to read arbitrary files from the file system.
Can download vulnerable releases here:
http://sourceforge.net/projects/mantisbt/files/mantis-stable/