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


Chapter 9  ■ Injecting Code



Download 5,76 Mb.
Pdf ko'rish
bet503/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   499   500   501   502   503   504   505   506   ...   875
Bog'liq
3794 1008 4334

Chapter 9 



Injecting Code



283

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




Equipped with this command, the attacker can retrieve arbitrary informa-

tion in various ways. One method is to leverage the same technique already

described for the case where the application returns conditional responses.

Now, instead of triggering a different application response when a particular

condition is detected, the injected query instead induces a time delay. For

example, the second of these queries will cause a time delay, indicating that the

first letter of the captured string is A:

if ASCII(SUBSTRING(‘Admin’,1,1)) = 64 waitfor delay ‘0:0:5’

if ASCII(SUBSTRING(‘Admin’,1,1)) = 65 waitfor delay ‘0:0:5’

As before, the attacker can cycle through all possible values for each charac-

ter until a time delay occurs. Alternatively, the attack could be made more effi-

cient by reducing the number of requests needed. An additional technique to

that described previously for Absinthe is to break each byte of data down into

individual bits and retrieve each bit in a single query. The 

POWER

command and



the bitwise 

AND


operator 

&

can be used to specify conditions on a bit-by-bit



basis. For example, the following query will test the first bit of the first byte of

the captured data, and pause if it is 1:

if (ASCII(SUBSTRING(‘Admin’,1,1)) & (POWER(2,0))) > 0 waitfor delay

‘0:0:5’


The following query will perform the same test on the second bit:

if (ASCII(SUBSTRING(‘Admin’,1,1)) & (POWER(2,1))) > 0 waitfor delay

‘0:0:5’

As mentioned earlier, the means of inducing a time delay are highly database-

dependent. Other databases do not contain a built-in time-delay command;

however, you can easily use other tricks to cause a time delay to occur.

In MySQL, the benchmark function can be used to perform a specified

action repeatedly. Instructing the database to perform a processor-intensive

action, such as a SHA-1 hash, a large number of times will result in a measur-

able time delay. For example:

select if(user() like ‘root@%‘, benchmark(50000,sha1(‘test’)), ‘false’)

In Oracle, one trick is to use 

UTL_HTTP

to connect to a nonexistent server,

causing a timeout. This will cause the database to attempt to connect to the

specified server, and eventually timeout. For example:

SELECT ‘a’||Utl_Http.request(‘http://madeupserver.com’) from dual

...delay...

ORA-29273: HTTP request failed

ORA-06512: at “SYS.UTL_HTTP”, line 1556

ORA-12545: Connect failed because target host or object does not exist


Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   499   500   501   502   503   504   505   506   ...   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