flat assembler
Message board for the users of flat assembler.

Index > Windows > Enabling DEP & ASLR

Author
Thread Post new topic Reply to topic
yuhg



Joined: 14 Apr 2014
Posts: 3
Location: Somewhere
yuhg
What can I add to my program so that I can utilize DEP and ASLR?
Post 14 Apr 2014, 06:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
Add a relocation (fixups) section.
Code:
section '.reloc' fixups data readable discardable    
Don't mark your data sections as executable.

Don't mark your code sections as readable or writeable.
Post 14 Apr 2014, 06:22
View user's profile Send private message Visit poster's website Reply with quote
yuhg



Joined: 14 Apr 2014
Posts: 3
Location: Somewhere
yuhg
revolution wrote:
Add a relocation (fixups) section.
Code:
section '.reloc' fixups data readable discardable    
Don't mark your data sections as executable.

Don't mark your code sections as readable or writeable.


I followed the instructions in your post and DEP/ASLR are still not being enabled.

Image
Post 14 Apr 2014, 06:51
View user's profile Send private message Reply with quote
yuhg



Joined: 14 Apr 2014
Posts: 3
Location: Somewhere
yuhg
Even when I have FileHeader.OptionalHeader.DllCharacteristics set, ASLR is not being enabled.
Image

Is there something I'm missing?
Post 14 Apr 2014, 07:20
View user's profile Send private message Reply with quote
nmaps



Joined: 26 Oct 2012
Posts: 8
nmaps
revolution wrote:
Don't mark your code sections as readable or writeable.

!code sections should most definitely be readable in case data is stored there. I've yet to see a .text section that isn't read | execute. You'd have to be assured by the compiler that nothing is stored there (ie import directory).
Post 16 Apr 2014, 03:17
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
nmaps wrote:
!code sections should most definitely be readable in case data is stored there. I've yet to see a .text section that isn't read | execute. You'd have to be assured by the compiler that nothing is stored there (ie import directory).
There is no reason to store data in the code section actually. We use an assembler and can make our code section contain only code, and put all initialised data into a different section(s).
Post 16 Apr 2014, 04:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
This also might help:
Code:
format pe nx
;...    
Post 22 Apr 2014, 04:05
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.