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



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

Dynamic Execution in PHP

The PHP function 

eval

is used to dynamically execute code that is passed to the



function at runtime. Consider a search function that enables users to create stored

searches that are then dynamically generated as links within their user interface.

When users access the search function, they use a URL like the following:

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

The server-side application implements this functionality by dynamically gen-

erating variables containing the name/value pairs specified in the 

storedsearch

parameter, in this case creating a 

mysearch

variable with the value 

wahh

:

$storedsearch = $_GET[‘storedsearch’];



eval(“$storedsearch;”);

In this situation, you can submit crafted input that is dynamically executed

by the 

eval


function, resulting in injection of arbitrary PHP commands into

the server-side application. The semicolon character can be used to batch com-

mands together in a single parameter. For example, to retrieve the contents of

the file 

/etc/password

, you could use either the 

file_get_contents

or the


system

command:


https://wahh-app.com/search.php?storedsearch=\$mysearch%3dwahh;

%20echo%20file_get_contents(‘/etc/passwd’)

https://wahh-app.com/search.php?storedsearch=\$mysearch%3dwahh;

%20system(‘cat%20/etc/passwd’)




Download 5,76 Mb.

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