https://github.com/jwilk/getenvy
LD_PRELOAD library to snoop on getenv() calls
https://github.com/jwilk/getenvy
security
Last synced: about 1 year ago
JSON representation
LD_PRELOAD library to snoop on getenv() calls
- Host: GitHub
- URL: https://github.com/jwilk/getenvy
- Owner: jwilk
- License: mit
- Created: 2017-06-18T19:25:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-24T20:49:14.000Z (over 1 year ago)
- Last Synced: 2025-03-26T00:02:58.862Z (over 1 year ago)
- Topics: security
- Language: C
- Size: 16.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
**getenvy** is an LD_PRELOAD library to snoop on ``getenv()`` calls:
.. code:: console
$ make
gcc -W -Wall -O2 -g -shared -fPIC -ldl getenvy.c -o libgetenvy.so
$ export LD_PRELOAD="$PWD/libgetenvy.so"
$ GETENVY=1 ls > /dev/null
getenv("QUOTING_STYLE")
getenv("COLUMNS")
getenv("TABSIZE")
getenv("LS_BLOCK_SIZE")
getenv("BLOCK_SIZE")
getenv("BLOCKSIZE")
getenv("POSIXLY_CORRECT")
getenv("BLOCK_SIZE")
getenv("TZ")
If you feel brave, you can install and enable it globally
(even for setuid/setgid programs):
.. code:: console
# make install
install -D -m 644 libgetenvy.so /usr/local/lib/libgetenvy.so
# echo /usr/local/lib/libgetenvy.so >> /etc/ld.so.preload
.. vim:ft=rst ts=3 sts=3 sw=3 et