diff --git a/examples/mitmproxy_shim.c b/examples/full_transparency_shim.c similarity index 87% rename from examples/mitmproxy_shim.c rename to examples/full_transparency_shim.c index 9688bb415..923eea760 100644 --- a/examples/mitmproxy_shim.c +++ b/examples/full_transparency_shim.c @@ -7,6 +7,14 @@ #include #include +/* 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]);