The Web Application Hacker’s Handbook Discovering and Exploiting Security Flaws


Chapter 9  ■ Injecting Code



Download 5,76 Mb.
Pdf ko'rish
bet561/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   557   558   559   560   561   562   563   564   ...   875
Bog'liq
3794 1008 4334

Chapter 9 



Injecting Code



319

70779c09.qxd:WileyRed  9/14/07  3:13 PM  Page 319




By cycling through every child node of every address node, and extracting

their values one character at a time, you can extract the entire contents of the

XML data store.

T I P

XPath contains two useful functions that can help you automate the

above attack and quickly iterate through all nodes and data in the XML

document:

■■

count()



— This returns the number of child nodes of a given element,

which can be used to determine the range of 

position()



values to

iterate over.

■■

string-length()



— This returns the length of a supplied string, 

which can be used to determine the range of 

substring()



values to

iterate over. 

Finding XPath Injection Flaws

Many of the attack strings that are commonly used to probe for SQL injection

flaws will typically result in anomalous behavior when submitted to a func-

tion that is vulnerable to XPath injection. For example, either of the following

two strings will normally invalidate the XPath query syntax and so generate

an error:

‘--


One or more of the following strings will typically result in some change in

the application’s behavior without causing an error, in the same way as they

do in relation to SQL injection flaws:

‘ or ‘a’=’a

‘ and ‘a’=’b

or 1=1


and 1=2

Hence, in any situation where your tests for SQL injection provide tentative

evidence for a vulnerability, but you are unable to conclusively exploit the

flaw, you should investigate the possibility that you are dealing with an XPath

injection flaw.


Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   557   558   559   560   561   562   563   564   ...   875




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish