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


Chapter 5  ■ Bypassing Client-Side Controls



Download 5,76 Mb.
Pdf ko'rish
bet222/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   218   219   220   221   222   223   224   225   ...   875
Bog'liq
3794 1008 4334

Chapter 5 



Bypassing Client-Side Controls



125

70779c05.qxd:WileyRed  9/16/07  5:14 PM  Page 125




The following example shows Flasm being used to extract a human-

 readable representation of bytecode from an SWF file for a simple Flash-based

car racing game:

C:\flash>flasm racer.swf > racer.flm

C:\flash>more racer.flm

movie ‘racer.swf’ compressed // flash 7, total frames: 3, frame rate: 24

fps, 64

0x500 px


exportAssets

1 as ‘engineStart’

end // of exportAssets

exportAssets

2 as ‘engineLoop’

end // of exportAssets

frame 0

stop


push ‘car1’

getVariable

push ‘code’, ‘player’

setMember

push ‘totalLaps’, 10

setVariable

push ‘acceleration’, 1.9

setVariable

push ‘gravity’, 0.4

setVariable

push ‘speedDecay’, 0.96

setVariable

push ‘rotationStep’, 10

setVariable

push ‘maxSpeed’, 10

setVariable

push ‘backSpeed’, 1

setVariable

push ‘currentCheckpoint1’, 1

setVariable

push ‘currentLap1’, 0.0

setVariable

push ‘checkpoints’, 2

setVariable

push ‘currentLapTXT’, ‘1/10’

setVariable

end // of frame 0

frame 0


constants ‘car’, ‘code’, ‘player’, ‘speed’, ‘speedDecay’, ‘Key’,

‘isDown’, ‘

...

126

Chapter 5 



Bypassing Client-Side Controls

70779c05.qxd:WileyRed  9/16/07  5:14 PM  Page 126



Here, you can immediately see various bytecode instructions that are of

interest to someone wishing to attack and modify the game. For example, you

could change the value of the 

maxSpeed


variable from 10 to something a bit

more competitive. After doing this, the modified disassembly can then be con-

verted back into bytecode in a new SWF file, as follows:

C:\flash>flasm –a racer.flm 

racer.flm successfully assembled to racer.swf, 31212 bytes

The car should now virtually fly around the track (to make it literally fly,

you could try changing the 

gravity


variable!).

In the previous example, the functionality implemented within the Flash

object was sufficiently simple that an attacker could fundamentally reengineer

the object by inspecting the disassembled bytecode and changing a single vari-

able. In more complex Flash objects, this may not be possible, and it may be

necessary to recover the original source and review it in detail to discover how

the object works and where best to attack it. The Flare tool can be used to

decompile an SWF file back into the original ActionScript source:

C:\flash>flare racer.swf && more racer.flr

movie ‘racer.swf’ {

// flash 7, total frames: 3, frame rate: 24 fps, 640x500 px, compressed

frame 1 {

stop();

car1.code = ‘player’;

totalLaps = 10;

acceleration = 1.9;

gravity = 0.4

speedDecay = 0.96;

rotationStep = 10;

maxSpeed = 10;

backSpeed = 1;

currentCheckpoint1 = 1;

currentLap1 = 0;

checkpoints = 2;

currentLapTXT = ‘1/10’;

}

...



While modifying recreational games is usually straightforward and may be

fun for personal amusement and beating a coworker, the client-side controls

implemented within the Flash objects used by enterprise applications and

online casinos are typically better protected. As with Java, obfuscation tech-

niques have been devised in an attempt to hinder decompilation attacks. Two

available tools are ActionScript Obfuscator and Viewer Screwer, which can

change both meaningful variable names and text references into scrambled

sequences of letters, making the decompiled code harder to understand.




Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   218   219   220   221   222   223   224   225   ...   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