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?
Advertisement
Answer
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