Here is the scenario:
id gives this :
uid=1001(test1) gid=1001(test1) euid=1000(bl4ckc4t) groups=1001(test1) -
This means that I am user
test1, but my euid is set to another user.
My goal is to get my uid to change to 1000 from my current position with my euid being 1000.
The problem is that running something like
bash -i will just look at my uid and create a shell based on my uid, not euid.
The only thing I came up with, which does only work if you have
python3 -c 'import pty; import os; os.setuid(0); pty.spawn("/bin/bash")'
Through python I can change my uid, and it works, except that if I try the equivalent for this case:
python3 -c 'import pty; import os; os.setuid(1000); pty.spawn("/bin/bash")'
it throws the exception
OSError: out of pty devices
How can I achieve that change?
The general restrictions are to change it without uploading binaries, changing /etc/shadow or /etc/passwd. It would also be great if the method works natively and doesn't assume that specific programs, like gcc for example, exist.