# 4.path-abuse

## Check PATH variable

```sh
echo $PATH
env | grep PATH
```

## Example: Create a script in a PATH directory (requires write access)

```sh
# echo 'echo "PATH ABUSE!!"' > /usr/local/bin/mycommand
# chmod +x /usr/local/bin/mycommand
# mycommand
```

## Modify PATH (be cautious, this can break things)

```sh
PATH=.:$PATH
export PATH
echo $PATH
```

## Example: Create a malicious script and execute it

```sh
# echo 'echo "PATH ABUSE!!"' > ls
# chmod +x ls
# ls
```
