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


Chapter 13  ■ Automating Bespoke Attacks



Download 5,76 Mb.
Pdf ko'rish
bet815/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   811   812   813   814   815   816   817   818   ...   875
Bog'liq
3794 1008 4334

Chapter 13 



Automating Bespoke Attacks



479

70779c13.qxd:WileyRed  9/14/07  3:14 PM  Page 479




Param[] params = new Param[] 

{

new Param(“DocID”, “3801”, Param.Type.URL, true),



};

PayloadSource payloads = new PSNumbers(3000, 3100, 1);

This configuration includes the basic target information, creates a single

request parameter called 

DocID

, and configures our numeric payload source to



cycle through the range 3000–3100.

In order to cycle through a series of requests, potentially targeting multiple

parameters, we’ll need to maintain some state. Let’s use a simple 

nextRequest

method to advance the state of our request engine, returning 

true


until there

are no more requests remaining:

// attack state

int currentParam = 0;

boolean nextRequest()

{

if (currentParam >= params.length)



return false;

if (!params[currentParam].attack)

{

currentParam++;



return nextRequest();

}

if (!payloads.nextPayload())



{

payloads.reset();

currentParam++;

return nextRequest();

}

return true;



}

This stateful request engine will keep track of which parameter we are cur-

rently targeting, and which attack payload to place into it. The next step is to

actually build a complete HTTP request using this information. This involves

inserting each type of parameter into the correct place in the request, and

adding any other required headers:




Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   811   812   813   814   815   816   817   818   ...   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