Hijacks
npm
via sudo
npm
via sudo
A
NodeJS
package is defined in a filepackage.json
, is possible to create a malicious package and run it with the--unsafe
option to get code execution:
The malicious
package.json
needs to be contain within the fake package directory; once is all setup just run it withsudo
:
dstat
Plugin poisoning
dstat
Plugin poisoning~/.dstat/
(path of binary)/plugins/
/usr/share/dstat/
/usr/local/share/dstat
Normally to escalate privilege you want to choose the ones within the root
path, check for writable
permissions:
Create a malicious plugin:
Execute it with --PluginName
:
Composer
Hijacking
Composer
HijackingFirst create the temporal folder where you will invoke the shell from and save in an environmental variable:
Once is done, create the malicious script to feed
composer
:
Finally, just execute the script with it's in-build option:
GitPython
GitPython
CVE-2022-24439
Inadequate validation of user input when handling remote URLs passed to the clone command:
Symbolic Links
via sudo
Symbolic Links
via sudo
Sudoedit Double Wildcard Exploit
Sudoedit Double Wildcard Exploit
First create a new directory in the vulnerable path:
Now, from the new directory pop the symbolic link:
Finally use
sudoedit
to write your public key:
tar wildcards
tar wildcards
Move the directory being use by the script:
Replace it with a symbolic link pointing to your target directory:
Decompress the content:
Last updated