aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmill <smill@cuckoo.sh>2016-09-14 19:25:53 +0000
committersmill <smill@cuckoo.sh>2016-09-14 19:25:53 +0000
commit7cd845644520cc52c53c2957429afae60ffaba25 (patch)
treead124f4ef6841d262a432cc2bdd197d974970f1b
parent83a28021ad863d0ced37594df68c5b97381910f1 (diff)
downloadmitmproxy-7cd845644520cc52c53c2957429afae60ffaba25.tar.gz
mitmproxy-7cd845644520cc52c53c2957429afae60ffaba25.tar.bz2
mitmproxy-7cd845644520cc52c53c2957429afae60ffaba25.zip
Added a description to the shim loader, and renamed it.
-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]);