execve shellcode linux segmentation fault

前端 未结 1 1772
太阳男子
太阳男子 2020-12-06 14:13

Im trying to run this shellcode but it throws me: \"Segmentation fault\" error The shellcode is the following:

shellcode.asm:

global _start
_start:

         


        
相关标签:
1条回答
  • 2020-12-06 14:52

    Your problem is that the .text section is not writable by default. The easiest thing to do is put your code into a new custom section that is marked as writable. Add this line at the top of your asm file:

    section .shellcode  progbits alloc exec write align=16
    

    You could also pass the -N switch to the linker.

    Alternatively, you could rewrite the shellcode so that it uses the stack to create the arguments.

    0 讨论(0)
提交回复
热议问题