Skip to content

redbaron/librebind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Force socket bind calls to bind to a different port

LD_PRELOAD this library to "rwrite" port values in bind calls. You must set environment variable REBIND_PORT to value FROM:TO

In following example nc tries to bind to port 9000, but becaue of librebind it is "rewritten" to bind to port 10000:

make
LD_PRELOAD=./librebind.so REBIND_PORT=9000:10000 nc -l 9000 &
lsof -p $! -P -a -i

You can force any application (like jprofiler) to bind to random port by specifying 0 as "target port".

About

LD_PRELOAD library to rebind fixed port to arbitrary port

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published