Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

If I compile a C/C++ program on a linux machine, does it automatically have rwx perms

I am currently learning penetration testing as part of a cybersecurity career path. I was working on a vulnhub machine that required me writing some malware to exploit a buffer overflow bug. I decided to write it in C for the sake of practicing OpSec. I used code::blocks on my machine to write the code and used tcp to transfer the compiled app to the machine. Once I tried to run it, I found that it did not have execute permissions, and the compromised user account did not have permission to use chmod, however it did have permission to use GCC. I was wondering if I uploaded the code directly to the machine and compiled it natively, would the app have execute permissions?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

From my experience, rsync would be able to retain file permission when transferring between machines, maybe give it a try?

From local machine: rsync -aP source_path remote_machine:destination_path

-a is archive mode, preserves file properties

-P shows progress

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading