Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Confirmation of vulnerability .....

Topic created on: June 23, 2010 09:53 CDT by voila .

hello guys ..

during research on a ftp server .. i come across a piece of code which is like this .


1---> lea eax,[ebp+var_8]  ; it can be  address ebp-8

2---> add eax,[ebp+var_220] ; [ebp+var_220] holds input integer value,     i can vary it between 1h to 200h ..

3---> sub eax,211h   ;
4---> mov byte ptr [eax],0

so we can make the equation like this after 3rd code

(ebp-8)+(my_input_data)-211h ------- say it a

now its maximum value can be when my_input_data=200h

ebp-8+200h-211h = ebp-19h

now its minimum value can be when my_input_data=1h

  ebp-8+1-211h = ebp-217h


so after code 3 we can vary value of eax register from
ebp-217 to ebp-19 ..

then after code 4 (mov byte ptr[eax] ,0 ) we can make 0 to any byte which ranges from
[ebp-217] to [ebp-19]  , which can be exploited accordingly ..  


I hope you understand what i try to explain .. may be i'll wrong , if so , then correct me please before i move forward
in my research :) :)

Thank you

  tosanjay     August 3, 2010 16:25.56 CDT
> voila: hello guys ..
>
> during research on a ftp server .. i come across a piece of code which is like this .
>
>
> 1---> lea eax,[ebp+var_8]  ; it can be  address ebp-8
>
> 2---> add eax,[ebp+var_220] ; [ebp+var_220] holds input integer value,     i can vary it between 1h to 200h ..
>
> 3---> sub eax,211h   ;
> 4---> mov byte ptr [eax],0
>
> so we can make the equation like this after 3rd code
>
> (ebp-8)+(my_input_data)-211h ------- say it a
this is wrong!! [ebp-8] != ebp-8. so your final conclusion is getting wrong from this point onwards. [ebp-8] is essentially saying that whatever is being pointed to by this memory address, load that into eax...
>
>  now its maximum value can be when my_input_data=200h
>
>  ebp-8+200h-211h = ebp-19h
>
>  now its minimum value can be when my_input_data=1h
>  
>   ebp-8+1-211h = ebp-217h
>
>
> so after code 3 we can vary value of eax register from
> ebp-217 to ebp-19 ..
>
> then after code 4 (mov byte ptr[eax] ,0 ) we can make 0 to any byte which ranges from
> [ebp-217] to [ebp-19]  , which can be exploited accordingly ..  
>
>
> I hope you understand what i try to explain .. may be i\'ll wrong , if so , then correct me please before i move forward
> in my research :) :)
>
> Thank you

  vptrlx   August 14, 2010 05:58.39 CDT
>then after code 4 (mov byte ptr[eax] ,0 ) we can make 0 to any byte which ranges from
>[ebp-217] to [ebp-19]  , which can be exploited accordingly ..

You can write zero value to any byte with address between ebp-217 to ebp-19 (if you are right with calculation) - so you can modify some local variable.

>this is wrong!! [ebp-8] != ebp-8. so your final conclusion is getting wrong from this point onwards. [ebp-8] is essentially saying that whatever is being pointed to by this memory address, load that into eax...

nope. you see - there is LEA. So eax = ebp+var_8 = &var_8

Note: Registration is required to post to the forums.

Active in Last 5 Minutes
waleedassar

There are 28,224 total registered users.


Recently Created Topics
Reverse Engineering ...
Jan/23
Career: DoD Agency I...
Jan/22
"Disappearing&q...
Jan/17
Career: Software Sec...
Jan/11
Where is the call st...
Jan/07
IDA Pro 6.1 Breakpoi...
Jan/01
How to create data s...
Dec/30
can i search all mod...
Dec/23
IDA symbol table exp...
Dec/20
An anti-attach trick
Dec/17


Recent Forum Posts
Reverse Engineering ...
NirIzr
"Disappearing&q...
NirIzr
Reverse Engineering ...
charlie
"Disappearing&q...
charlie
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
Looking for value in...
NirIzr


Recent Blog Entries
cmathieu
Feb/07
Hacker Carnival

waleedassar
Feb/06
OllyDbg v1.10 And Hardware ...

waleedassar
Jan/31
Yet Another Anti-Debug Trick

RolfRolles
Jan/22
Finding Bugs in VMs with a ...

waleedassar
Jan/13
An OllyDbg Bug Disables Sof...

More ...


Recent Blog Comments
waleedassar on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/05
Yet Another Anti-Debug Trick

trolotou on:
Feb/05
Doudoune Moncler -Pennies F...

waleedassar on:
Feb/01
Yet Another Anti-Debug Trick

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit