aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/full_transparency_shim.c (renamed from examples/mitmproxy_shim.c)8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/mitmproxy_shim.c b/examples/full_transparency_shim.c
index 9688bb41..923eea76 100644
--- a/examples/mitmproxy_shim.c
+++ b/examples/full_transparency_shim.c
@@ -7,6 +7,14 @@
#include <unistd.h>
#include <errno.h>
+/* This setuid wrapper can be used to run mitmproxy in full transparency mode, as a normal user.
+ * It will set the required capabilities (CAP_NET_RAW), drop privileges, and will then run argv[1]
+ * with the same capabilities.
+ *
+ * It can be compiled as follows:
+ * gcc examples/mitmproxy_shim.c -o mitmproxy_shim -lcap
+*/
+
int set_caps(cap_t cap_struct, cap_value_t *cap_list, size_t bufsize) {
int cap_count = bufsize / sizeof(cap_list[0]);