https://github.com/0xricksanchez/getenv_wrapper
https://github.com/0xricksanchez/getenv_wrapper
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/0xricksanchez/getenv_wrapper
- Owner: 0xricksanchez
- Created: 2021-11-17T12:25:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-19T20:04:43.000Z (over 4 years ago)
- Last Synced: 2025-03-05T15:51:08.913Z (over 1 year ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## README
This is a simple wrapper that hooks calls to `getenv` or `secure_getenv` and replaces the value of the environment variable specified in `argv[1]` with data from stdin.
## Usage
```bash
clang -ggdb -O2 tests/env.c -o tests/env
cargo build
LD_PRELOAD=./target/debug/libets.so ./tests/env ZSH <<< $(head /dev/urandom)
```
Note: The changed environment variable only persist in the context of the run application.