Skip to content

[NSFW] Hijack UDP-based(libc recvfrom) DNS A/AAAA response with LD_PRELOAD.

License

Notifications You must be signed in to change notification settings

damnever/hosts-hijacking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hosts-hijacking

Hijack UDP-based(libc recvfrom) DNS A/AAAA response with LD_PRELOAD.

# make build

# cat /path/to/hosts
10.8.8.8 google.com

# HOSTS_HIJACKING=/path/to/hosts LD_PRELOAD=$(pwd)/src/hosts-hijacking.so xx-cmd-using-libc-recvfrom

Why

  • We want to keep the dirty hack at the client-side.
  • We have no permission to change the hosts file(or we do not want to change it, see below).
  • No side effect to other processes.

NOTES

  • NOT FULLY TESTED!!!
  • If you want to use it with golang, the most reliable way is compiling the golang program with -tags netcgo(DO NOT use cross-platform compile).

About

[NSFW] Hijack UDP-based(libc recvfrom) DNS A/AAAA response with LD_PRELOAD.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published