Created
November 26, 2010 12:10
-
-
Save jonyesno/716627 to your computer and use it in GitHub Desktop.
Patch to htracr to accept interface name on commandline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- htracr.js.orig 2010-11-26 11:36:51.000000000 +0000 | |
+++ htracr.js 2010-11-26 12:08:49.000000000 +0000 | |
@@ -16,13 +16,14 @@ | |
server_names: {}, | |
pcap_session: undefined, | |
drop_watcher: undefined, | |
+ device: '', | |
start_capture: function() { | |
var self = this | |
self.clear() | |
var f = "tcp port 80" | |
var b = 10 | |
- self.pcap_session = pcap.createSession('', f, (b * 1024 * 1024)) | |
+ self.pcap_session = pcap.createSession(self.device, f, (b * 1024 * 1024)) | |
this.setup_listeners() | |
console.log("Sniffing on " + self.pcap_session.device_name) | |
@@ -220,8 +221,14 @@ | |
// port to listen to | |
var port = parseInt(argv._[0]) | |
if (! port || port == NaN) { | |
- console.log("Usage: test-browser.js listen-port [state-file]") | |
+ console.log("Usage: test-browser.js listen-port [device] [state-file]") | |
process.exit(1) | |
} | |
+// device to snoop on | |
+var device = argv._[1] | |
+if (device) { | |
+ htracr.device = device | |
+} | |
+ | |
server.start(port, htracr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment