---
title: "5. Path abuse"
date: 2025-01-24
draft: false
---

You know what PATH is. 
- Env var specifies set of directories where executables are located. 
- Account's PATH is set of absolute paths. 

`echo $PATH` 

Adding `.` to user path adds their current working directory to the list. If we can modify a user's path we can replace a common binary such as `ls` with a malicious script like a revshell. Adding `.` to path with `PATH=.:$PATH` and then `export PATH` we will be able to run bins located in our CWD just by typing name of file. Typing ls will call malicious ls instead of binary located at /bin/ls. 

