You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. Tips for using socat in secured environments:
  2. * Configure socat to only enable the required features, e.g. to protect your
  3. filesystem from any accesses through socat:
  4. make distclean
  5. ./configure --disable-file --disable-creat --disable-gopen \
  6. --disable-pipe --disable-unix --disable-exec --disable-system
  7. use "socat -V" to see what features are still enabled; see
  8. ./configure --help for more options to disable
  9. * Do NOT install socat SUID root or so when you have untrusted users or
  10. unprivileged daemons on your machine, because the full install of socat can
  11. override arbitrary files and execute arbitrary programs!
  12. * Set logging to "-d -d" (in special cases even higher)
  13. * With files, protect against symlink attacks with nofollow (Linux), and
  14. avoid accessing files in world-writable directories like /tmp
  15. * When listening, use bind option (except UNIX domain sockets)
  16. * When listening, use range option (currently only for IP4 sockets)
  17. * When using socat with system, exec, or in a shell script, know what you do
  18. * With system and exec, use absolute pathes or set the path option
  19. * When starting programs with socat, consider using the chroot option (this
  20. requires root, so use the substuser option too).
  21. * Start socat as root only if required; if so, use substuser option
  22. Note: starting a SUID program after applying substuser or setuid gives the
  23. process the SUID owner, which might give root privileges again.
  24. * Socat, like netcat, is what intruders like to have on their victims machine:
  25. once they have gained a toehold they try to establish a versatile connection
  26. back to their attack base, and they want to attack other systems. For both
  27. purposes, socat could be helpful. Therefore, it might be useful to install
  28. socat with owner/permissions root:socatgrp/750, and to make all trusted users
  29. members of group socatgrp.