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

pyrasite-shell getting permission denied in debugged process #71

Open
aarontp opened this issue Jan 19, 2018 · 3 comments
Open

pyrasite-shell getting permission denied in debugged process #71

aarontp opened this issue Jan 19, 2018 · 3 comments

Comments

@aarontp
Copy link

aarontp commented Jan 19, 2018

Hello:

I'm seeing the following in the ouput of the debugged process when trying to run pyrasite-shell on it:

Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 13] Permission denied: '/tmp/tmplzhk39'

And that file does not exist. My usage is just:

sudo pyrasite-shell <pid>

Normal pyrasite seems to work, at least this does:

sudo pyrasite <pid> hellowworld.py

Any thoughts?

@ZmingZinnia
Copy link

ZmingZinnia commented Feb 26, 2018

same problem

@gdgrc
Copy link

gdgrc commented Mar 19, 2019

I fix it by letting the user of program needed to be injected run pyrasite-shell By:

sudo vi /etc/sysctl.d/10-ptrace.conf ; set the value from 1 to 0; sudo sysctl -p;
sudo vi /proc/sys/kernel/yama/ptrace_scope; set the value from 1 to 0;
sudo +s /usr/bin/gdb

@user202729
Copy link

user202729 commented Oct 26, 2020

I fix it by letting everyone to read the temp file used to store the injected commands: (in file ipc.py)

     def create_payload(self):
         """Write out a reverse python connection payload with a custom port"""
         (fd, filename) = tempfile.mkstemp()
+        os.chmod(filename, 0o644)
         tmp = os.fdopen(fd, 'w')
         path = dirname(abspath(pyrasite.__file__))
         payload = open(join(path, 'reverse.py'))

user202729 added a commit to user202729/pyrasite-ng that referenced this issue Mar 3, 2021
user202729 added a commit to user202729/pyrasite-ng that referenced this issue Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants