Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux SimpleShellcodeLoader.c Segfault #6

Open
beelow2010 opened this issue Jul 19, 2022 · 3 comments
Open

Linux SimpleShellcodeLoader.c Segfault #6

beelow2010 opened this issue Jul 19, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@beelow2010
Copy link

beelow2010 commented Jul 19, 2022

Hi there,

while studying for OSEP I stumbled across your SimpleShellcodeLoader for Linux and gave it a shot. Unfortunately running it causes a Segfault on my end and this page explains why I guess. The compiler flag -execstack didnt work on my client (current Kali build). In the second part of his blog he shows how to fix those issues, but the code will differ from your "simpler" version (basically easy copy paste, I tested it and it works really good). Just wanted to provide the info in case someone else gets stuck here :)

@chvancooten
Copy link
Owner

Hi @beelow2010, thanks for submitting this issue!

Odd that the -z execstack option did not work for you, IIRC it was explicitly mentioned to be used in the course materials. Since altering the snippet would diverge from the way it is discussed in the course I will refrain from doing that. I will however keep this issue open for reference :)

@chvancooten chvancooten added the wontfix This will not be worked on label Jul 25, 2022
@beelow2010
Copy link
Author

beelow2010 commented Jul 25, 2022

Hello again, you're welcome :)

It is correct that it's mentioned in the course and also in the blog port that I linked it states that it is supposed to work but for some reason it didn't on my end with a fresh Kali Install. But as you said, maybe the reference will help some people that run into the same issue - so thanks for your response! :)

@theGuildHall
Copy link

Posting this blog since it helped me understand why I was receiving a segfault. I moved the unsigned char buf[] variable down into the main function and it worked fine for me. Don't forget to compile with -z execstack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants