fe4a78da01
file in addition to sniffing the wire directly.
57 lines
1.6 KiB
Text
57 lines
1.6 KiB
Text
$NetBSD: patch-bj,v 1.1 2009/05/09 16:33:04 adrianp Exp $
|
|
|
|
diff -ur dsniff-2.3.orig/urlsnarf.c dsniff-2.3/urlsnarf.c
|
|
--- urlsnarf.c.orig 2000-12-19 02:53:36.000000000 +0000
|
|
+++ urlsnarf.c 2009-05-06 23:24:07.000000000 +0100
|
|
@@ -39,7 +39,7 @@
|
|
usage(void)
|
|
{
|
|
fprintf(stderr, "Version: " VERSION "\n"
|
|
- "Usage: urlsnarf [-n] [-i interface] [[-v] pattern [expression]]\n");
|
|
+ "Usage: urlsnarf [-n] [-i interface | -p pcapfile] [[-v] pattern [expression]]\n");
|
|
exit(1);
|
|
}
|
|
|
|
@@ -193,11 +193,14 @@
|
|
{
|
|
int c;
|
|
|
|
- while ((c = getopt(argc, argv, "i:nvh?V")) != -1) {
|
|
+ while ((c = getopt(argc, argv, "i:p:nvh?V")) != -1) {
|
|
switch (c) {
|
|
case 'i':
|
|
nids_params.device = optarg;
|
|
break;
|
|
+ case 'p':
|
|
+ nids_params.filename = optarg;
|
|
+ break;
|
|
case 'n':
|
|
Opt_dns = 0;
|
|
break;
|
|
@@ -230,8 +233,24 @@
|
|
|
|
nids_register_tcp(sniff_http_client);
|
|
|
|
- warnx("listening on %s [%s]", nids_params.device,
|
|
- nids_params.pcap_filter);
|
|
+ if (nids_params.pcap_filter != NULL) {
|
|
+ if (nids_params.filename == NULL) {
|
|
+ warnx("listening on %s [%s]", nids_params.device,
|
|
+ nids_params.pcap_filter);
|
|
+ }
|
|
+ else {
|
|
+ warnx("using %s [%s]", nids_params.filename,
|
|
+ nids_params.pcap_filter);
|
|
+ }
|
|
+ }
|
|
+ else {
|
|
+ if (nids_params.filename == NULL) {
|
|
+ warnx("listening on %s", nids_params.device);
|
|
+ }
|
|
+ else {
|
|
+ warnx("using %s", nids_params.filename);
|
|
+ }
|
|
+ }
|
|
|
|
nids_run();
|
|
|