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



Download 5,76 Mb.
Pdf ko'rish
bet597/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   593   594   595   596   597   598   599   600   ...   875
Bog'liq
3794 1008 4334

342

Chapter 10 



Exploiting Path Traversal

70779c10.qxd:WileyRed  9/14/07  3:14 PM  Page 342



Taken together, these caveats presented a barrier to straightforward

exploitation of the vulnerability. First, although it was possible to write arbi-

trary files to the server file system, it was not possible to overwrite any exist-

ing file, and the low privileges of the web server process meant that it was not

possible to create a new file in any interesting locations. Second, it was not pos-

sible to request an arbitrary existing file (such as 

/etc/passwd

) without reverse

engineering the custom encoding, which presented a lengthy and unappealing

challenge.

A little experimentation revealed that the obfuscated URLs contained the

original filename string supplied by the user. For example:

■■

test.txt


became 

zM1YTU4NTY2Y

.

■■

foo/../test.txt



became 

E1NzUyMzE0ZjQ0NjMzND

.

The difference in length of the encoded URLs indicated that no path canon-



icalization had been performed before applying the encoding. This behavior

gave us enough of a toe-hold to exploit the vulnerability. The first step was to

submit a file with the following name:

../../../../../.././etc/passwd/../../tmp/foo

which in its canonical form is equivalent to

/tmp/foo


and so could be written by the web server. Uploading this file produced a

download URL containing the following obfuscated filename:

FhwUk1rNXFUVEJOZW1kNlRsUk5NazE2V1RKTmFrMHdUbXBWZWs1NldYaE5lb

To modify this value to return the file 

/etc/passwd

, we simply needed to

truncate it at the right point, which is

FhwUk1rNXFUVEJOZW1kNlRsUk5NazE2V1RKTmFrM

Attempting to download a file using this value returned the server’s 

passwd


file as expected. The server had given us sufficient resources to be able to

encode arbitrary file paths using its scheme, without even deciphering the

obfuscation algorithm being used! 


Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   593   594   595   596   597   598   599   600   ...   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