View | Details | Raw Unified | Return to bug 235862
Collapse All | Expand All

(-)b/security/dsniff/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	dsniff
4
PORTNAME=	dsniff
5
DISTVERSION=	2.4b1
5
DISTVERSION=	2.4b1
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	security
7
CATEGORIES=	security
8
MASTER_SITES=	http://www.monkey.org/~dugsong/${PORTNAME}/beta/ \
8
MASTER_SITES=	http://www.monkey.org/~dugsong/${PORTNAME}/beta/ \
9
		LOCAL/sbz
9
		LOCAL/sbz
(-)b/security/dsniff/files/patch-Makefile.in (-3 / +4 lines)
Lines 21-27 Link Here
21
 
21
 
22
 INSTALL	= @INSTALL@
22
 INSTALL	= @INSTALL@
23
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
23
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
24
@@ -76,22 +75,23 @@ CONFIGS	= dsniff.magic dsniff.services d
24
@@ -76,23 +75,24 @@ CONFIGS	= dsniff.magic dsniff.services dnsspoof.hosts
25
 .c.o:
25
 .c.o:
26
 	$(CC) $(CFLAGS) $(INCS) -c $(srcdir)/$*.c
26
 	$(CC) $(CFLAGS) $(INCS) -c $(srcdir)/$*.c
27
 
27
 
Lines 48-61 Link Here
48
-	$(RANLIB) $@
48
-	$(RANLIB) $@
49
+nfs_prot.c: nfs_prot.x nfs_prot.h
49
+nfs_prot.c: nfs_prot.x nfs_prot.h
50
+	rpcgen -c nfs_prot.x -o $@
50
+	rpcgen -c nfs_prot.x -o $@
51
+
51
 
52
+nfs_prot.h: nfs_prot.x
52
+nfs_prot.h: nfs_prot.x
53
+	rpcgen -h nfs_prot.x -o $@
53
+	rpcgen -h nfs_prot.x -o $@
54
+
54
+
55
+filesnarf.c: nfs_prot.h
55
+filesnarf.c: nfs_prot.h
56
 
56
+
57
 dsniff: $(HDRS) $(SRCS) $(OBJS)
57
 dsniff: $(HDRS) $(SRCS) $(OBJS)
58
 	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB) $(DBLIB) $(SSLLIB)
58
 	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB) $(DBLIB) $(SSLLIB)
59
 
59
@@ -156,7 +156,7 @@ install:
60
@@ -156,7 +156,7 @@ install:
60
 	done
61
 	done
61
 
62
 
(-)b/security/dsniff/files/patch-arpspoof.c (-8 / +8 lines)
Lines 1-5 Link Here
1
--- ./arpspoof.c.orig	2001-03-15 09:32:58.000000000 +0100
1
--- arpspoof.c.orig	2001-03-15 08:32:58 UTC
2
+++ ./arpspoof.c	2014-07-22 13:21:17.000000000 +0200
2
+++ arpspoof.c
3
@@ -13,7 +13,10 @@
3
@@ -13,7 +13,10 @@
4
 
4
 
5
 #include <sys/types.h>
5
 #include <sys/types.h>
Lines 27-33 Link Here
27
 static struct ether_addr spoof_mac, target_mac;
27
 static struct ether_addr spoof_mac, target_mac;
28
 static in_addr_t spoof_ip, target_ip;
28
 static in_addr_t spoof_ip, target_ip;
29
 static char *intf;
29
 static char *intf;
30
@@ -41,47 +44,49 @@
30
@@ -41,47 +44,49 @@ usage(void)
31
 }
31
 }
32
 
32
 
33
 static int
33
 static int
Lines 94-100 Link Here
94
 }
94
 }
95
 
95
 
96
 #ifdef __linux__
96
 #ifdef __linux__
97
@@ -119,7 +124,7 @@
97
@@ -119,7 +124,7 @@ arp_find(in_addr_t ip, struct ether_addr *mac)
98
 		/* XXX - force the kernel to arp. feh. */
98
 		/* XXX - force the kernel to arp. feh. */
99
 		arp_force(ip);
99
 		arp_force(ip);
100
 #else
100
 #else
Lines 103-109 Link Here
103
 #endif
103
 #endif
104
 		sleep(1);
104
 		sleep(1);
105
 	}
105
 	}
106
@@ -136,9 +141,9 @@
106
@@ -136,9 +141,9 @@ cleanup(int sig)
107
 	if (arp_find(spoof_ip, &spoof_mac)) {
107
 	if (arp_find(spoof_ip, &spoof_mac)) {
108
 		for (i = 0; i < 3; i++) {
108
 		for (i = 0; i < 3; i++) {
109
 			/* XXX - on BSD, requires ETHERSPOOF kernel. */
109
 			/* XXX - on BSD, requires ETHERSPOOF kernel. */
Lines 116-122 Link Here
116
 				 target_ip);
116
 				 target_ip);
117
 			sleep(1);
117
 			sleep(1);
118
 		}
118
 		}
119
@@ -151,7 +156,8 @@
119
@@ -151,7 +156,8 @@ main(int argc, char *argv[])
120
 {
120
 {
121
 	extern char *optarg;
121
 	extern char *optarg;
122
 	extern int optind;
122
 	extern int optind;
Lines 126-132 Link Here
126
 	int c;
126
 	int c;
127
 	
127
 	
128
 	intf = NULL;
128
 	intf = NULL;
129
@@ -163,7 +169,7 @@
129
@@ -163,7 +169,7 @@ main(int argc, char *argv[])
130
 			intf = optarg;
130
 			intf = optarg;
131
 			break;
131
 			break;
132
 		case 't':
132
 		case 't':
Lines 135-141 Link Here
135
 				usage();
135
 				usage();
136
 			break;
136
 			break;
137
 		default:
137
 		default:
138
@@ -176,26 +182,26 @@
138
@@ -176,26 +182,26 @@ main(int argc, char *argv[])
139
 	if (argc != 1)
139
 	if (argc != 1)
140
 		usage();
140
 		usage();
141
 	
141
 	
(-)b/security/dsniff/files/patch-dnsspoof.c (-11 / +11 lines)
Lines 1-6 Link Here
1
--- ./dnsspoof.c.orig	2001-03-15 09:33:03.000000000 +0100
1
--- dnsspoof.c.orig	2001-03-15 08:33:03 UTC
2
+++ ./dnsspoof.c	2014-07-22 13:20:14.000000000 +0200
2
+++ dnsspoof.c
3
@@ -38,7 +38,7 @@
3
@@ -38,7 +38,7 @@ SLIST_HEAD(, dnsent) dns_entries;
4
 
4
 
5
 pcap_t		*pcap_pd = NULL;
5
 pcap_t		*pcap_pd = NULL;
6
 int		 pcap_off = -1;
6
 int		 pcap_off = -1;
Lines 9-15 Link Here
9
 u_long		 lnet_ip = -1;
9
 u_long		 lnet_ip = -1;
10
 
10
 
11
 static void
11
 static void
12
@@ -90,19 +90,18 @@
12
@@ -90,19 +90,18 @@ static void
13
 dns_init(char *dev, char *filename)
13
 dns_init(char *dev, char *filename)
14
 {
14
 {
15
 	FILE *f;
15
 	FILE *f;
Lines 36-42 Link Here
36
 
36
 
37
 	SLIST_INIT(&dns_entries);
37
 	SLIST_INIT(&dns_entries);
38
 	
38
 	
39
@@ -180,7 +179,7 @@
39
@@ -180,7 +179,7 @@ dns_lookup_ptr(const char *name)
40
 static void
40
 static void
41
 dns_spoof(u_char *u, const struct pcap_pkthdr *pkthdr, const u_char *pkt)
41
 dns_spoof(u_char *u, const struct pcap_pkthdr *pkthdr, const u_char *pkt)
42
 {
42
 {
Lines 45-51 Link Here
45
 	struct libnet_udp_hdr *udp;
45
 	struct libnet_udp_hdr *udp;
46
 	HEADER *dns;
46
 	HEADER *dns;
47
 	char name[MAXHOSTNAMELEN];
47
 	char name[MAXHOSTNAMELEN];
48
@@ -189,7 +188,7 @@
48
@@ -189,7 +188,7 @@ dns_spoof(u_char *u, const struct pcap_pkthdr *pkthdr,
49
 	in_addr_t dst;
49
 	in_addr_t dst;
50
 	u_short type, class;
50
 	u_short type, class;
51
 
51
 
Lines 54-60 Link Here
54
 	udp = (struct libnet_udp_hdr *)(pkt + pcap_off + (ip->ip_hl * 4));
54
 	udp = (struct libnet_udp_hdr *)(pkt + pcap_off + (ip->ip_hl * 4));
55
 	dns = (HEADER *)(udp + 1);
55
 	dns = (HEADER *)(udp + 1);
56
 	p = (u_char *)(dns + 1);
56
 	p = (u_char *)(dns + 1);
57
@@ -212,7 +211,7 @@
57
@@ -212,7 +211,7 @@ dns_spoof(u_char *u, const struct pcap_pkthdr *pkthdr,
58
 	if (class != C_IN)
58
 	if (class != C_IN)
59
 		return;
59
 		return;
60
 
60
 
Lines 63-69 Link Here
63
 	
63
 	
64
 	if (type == T_A) {
64
 	if (type == T_A) {
65
 		if ((dst = dns_lookup_a(name)) == -1)
65
 		if ((dst = dns_lookup_a(name)) == -1)
66
@@ -234,38 +233,38 @@
66
@@ -234,38 +233,38 @@ dns_spoof(u_char *u, const struct pcap_pkthdr *pkthdr,
67
 		anslen += 12;
67
 		anslen += 12;
68
 	}
68
 	}
69
 	else return;
69
 	else return;
Lines 117-123 Link Here
117
 	pcap_close(pcap_pd);
117
 	pcap_close(pcap_pd);
118
 	exit(0);
118
 	exit(0);
119
 }
119
 }
120
@@ -276,6 +275,7 @@
120
@@ -276,6 +275,7 @@ main(int argc, char *argv[])
121
 	extern char *optarg;
121
 	extern char *optarg;
122
 	extern int optind;
122
 	extern int optind;
123
 	char *p, *dev, *hosts, buf[1024];
123
 	char *p, *dev, *hosts, buf[1024];
Lines 125-131 Link Here
125
 	int i;
125
 	int i;
126
 
126
 
127
 	dev = hosts = NULL;
127
 	dev = hosts = NULL;
128
@@ -306,7 +306,7 @@
128
@@ -306,7 +306,7 @@ main(int argc, char *argv[])
129
 		strlcpy(buf, p, sizeof(buf));
129
 		strlcpy(buf, p, sizeof(buf));
130
 	}
130
 	}
131
 	else snprintf(buf, sizeof(buf), "udp dst port 53 and not src %s",
131
 	else snprintf(buf, sizeof(buf), "udp dst port 53 and not src %s",
Lines 134-140 Link Here
134
 	
134
 	
135
 	if ((pcap_pd = pcap_init(dev, buf, 128)) == NULL)
135
 	if ((pcap_pd = pcap_init(dev, buf, 128)) == NULL)
136
 		errx(1, "couldn't initialize sniffing");
136
 		errx(1, "couldn't initialize sniffing");
137
@@ -314,10 +314,10 @@
137
@@ -314,10 +314,10 @@ main(int argc, char *argv[])
138
 	if ((pcap_off = pcap_dloff(pcap_pd)) < 0)
138
 	if ((pcap_off = pcap_dloff(pcap_pd)) < 0)
139
 		errx(1, "couldn't determine link layer offset");
139
 		errx(1, "couldn't determine link layer offset");
140
 	
140
 	
(-)b/security/dsniff/files/patch-filesnarf.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- ./filesnarf.c.orig	2001-03-15 09:33:03.000000000 +0100
1
--- filesnarf.c.orig	2001-03-15 08:33:03 UTC
2
+++ ./filesnarf.c	2014-07-22 13:20:14.000000000 +0200
2
+++ filesnarf.c
3
@@ -134,8 +134,8 @@
3
@@ -134,8 +134,8 @@ nfs_save(struct tuple4 *addr, struct myreadargs *ma, u
4
 	int fd;
4
 	int fd;
5
 
5
 
6
 	warnx("%s.%d > %s.%d: %s (%d@%d)",
6
 	warnx("%s.%d > %s.%d: %s (%d@%d)",
Lines 11-17 Link Here
11
 	      ma->filename, len, ma->offset);
11
 	      ma->filename, len, ma->offset);
12
 	
12
 	
13
 	if ((fd = open(ma->filename, O_WRONLY|O_CREAT, 0644)) >= 0) {
13
 	if ((fd = open(ma->filename, O_WRONLY|O_CREAT, 0644)) >= 0) {
14
@@ -353,7 +353,7 @@
14
@@ -353,7 +353,7 @@ decode_nfs(struct tuple4 *addr, u_char *buf, int len)
15
 }
15
 }
16
 
16
 
17
 static void
17
 static void
(-)b/security/dsniff/files/patch-macof.c (-9 / +9 lines)
Lines 1-6 Link Here
1
--- ./macof.c.orig	2001-03-15 09:33:04.000000000 +0100
1
--- macof.c.orig	2001-03-15 08:33:04 UTC
2
+++ ./macof.c	2014-07-22 13:20:14.000000000 +0200
2
+++ macof.c
3
@@ -48,8 +48,8 @@
3
@@ -48,8 +48,8 @@ usage(void)
4
 static void
4
 static void
5
 gen_mac(u_char *mac)
5
 gen_mac(u_char *mac)
6
 {
6
 {
Lines 11-17 Link Here
11
 }
11
 }
12
 
12
 
13
 int
13
 int
14
@@ -59,22 +59,23 @@
14
@@ -59,22 +59,23 @@ main(int argc, char *argv[])
15
 	extern int optind;
15
 	extern int optind;
16
 	int c, i;
16
 	int c, i;
17
 	struct libnet_link_int *llif;
17
 	struct libnet_link_int *llif;
Lines 39-45 Link Here
39
 			break;
39
 			break;
40
 		case 'e':
40
 		case 'e':
41
 			Tha = (u_char *)ether_aton(optarg);
41
 			Tha = (u_char *)ether_aton(optarg);
42
@@ -101,13 +102,13 @@
42
@@ -101,13 +102,13 @@ main(int argc, char *argv[])
43
 	if (argc != 0)
43
 	if (argc != 0)
44
 		usage();
44
 		usage();
45
 	
45
 	
Lines 58-64 Link Here
58
 	
58
 	
59
 	for (i = 0; i != Repeat; i++) {
59
 	for (i = 0; i != Repeat; i++) {
60
 		
60
 		
61
@@ -117,39 +118,39 @@
61
@@ -117,39 +118,39 @@ main(int argc, char *argv[])
62
 		else memcpy(tha, Tha, sizeof(tha));
62
 		else memcpy(tha, Tha, sizeof(tha));
63
 		
63
 		
64
 		if (Src != 0) src = Src;
64
 		if (Src != 0) src = Src;
Lines 78-90 Link Here
78
+		else dport = libnet_get_prand(LIBNET_PRu16);
78
+		else dport = libnet_get_prand(LIBNET_PRu16);
79
 
79
 
80
-		seq = libnet_get_prand(PRu32);
80
-		seq = libnet_get_prand(PRu32);
81
-		
81
+		seq = libnet_get_prand(LIBNET_PRu32);
82
 		
82
-		libnet_build_ethernet(tha, sha, ETHERTYPE_IP, NULL, 0, pkt);
83
-		libnet_build_ethernet(tha, sha, ETHERTYPE_IP, NULL, 0, pkt);
83
-		
84
-		
84
-		libnet_build_ip(TCP_H, 0, libnet_get_prand(PRu16), 0, 64,
85
-		libnet_build_ip(TCP_H, 0, libnet_get_prand(PRu16), 0, 64,
85
-				IPPROTO_TCP, src, dst, NULL, 0, pkt + ETH_H);
86
-				IPPROTO_TCP, src, dst, NULL, 0, pkt + ETH_H);
86
+		seq = libnet_get_prand(LIBNET_PRu32);
87
-		
87
 		
88
 		libnet_build_tcp(sport, dport, seq, 0, TH_SYN, 512,
88
 		libnet_build_tcp(sport, dport, seq, 0, TH_SYN, 512,
89
-				 0, NULL, 0, pkt + ETH_H + IP_H);
89
-				 0, NULL, 0, pkt + ETH_H + IP_H);
90
+				 0, 0, LIBNET_TCP_H, NULL, 0, l, 0);
90
+				 0, 0, LIBNET_TCP_H, NULL, 0, l, 0);
(-)b/security/dsniff/files/patch-pcaputil.c (-1 / +1 lines)
Lines 21-27 Link Here
21
 int
21
 int
22
 pcap_dloff(pcap_t *pd)
22
 pcap_dloff(pcap_t *pd)
23
 {
23
 {
24
@@ -87,12 +76,6 @@ pcap_init(char *intf, char *filter, int 
24
@@ -87,12 +76,6 @@ pcap_init(char *intf, char *filter, int snaplen)
25
 		pcap_perror(pd, "pcap_compile");
25
 		pcap_perror(pd, "pcap_compile");
26
 		return (NULL);
26
 		return (NULL);
27
 	}
27
 	}
(-)b/security/dsniff/files/patch-record.c (-3 / +3 lines)
Lines 1-6 Link Here
1
--- ./record.c.orig	2001-03-15 09:33:04.000000000 +0100
1
--- record.c.orig	2001-03-15 08:33:04 UTC
2
+++ ./record.c	2014-07-22 13:20:14.000000000 +0200
2
+++ record.c
3
@@ -65,8 +65,8 @@
3
@@ -65,8 +65,8 @@ record_print(struct rec *rec)
4
 	tm = localtime(&rec->time);
4
 	tm = localtime(&rec->time);
5
 	strftime(tstr, sizeof(tstr), "%x %X", tm);
5
 	strftime(tstr, sizeof(tstr), "%x %X", tm);
6
 	
6
 	
(-)b/security/dsniff/files/patch-ssh.c (+176 lines)
Added Link Here
1
--- ssh.c.orig	2001-03-15 08:33:04 UTC
2
+++ ssh.c
3
@@ -232,6 +232,10 @@ SSH_accept(SSH *ssh)
4
 	u_char *p, cipher, cookie[8], msg[1024];
5
 	u_int32_t num;
6
 	int i;
7
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
8
+	const BIGNUM *servkey_e, *servkey_n;
9
+	const BIGNUM *hostkey_e, *hostkey_n;
10
+#endif
11
 	
12
 	/* Generate anti-spoofing cookie. */
13
 	RAND_bytes(cookie, sizeof(cookie));
14
@@ -241,11 +245,23 @@ SSH_accept(SSH *ssh)
15
 	*p++ = SSH_SMSG_PUBLIC_KEY;			/* type */
16
 	memcpy(p, cookie, 8); p += 8;			/* cookie */
17
 	num = 768; PUTLONG(num, p);			/* servkey bits */
18
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
19
+	RSA_get0_key(ssh->ctx->servkey, &servkey_n, &servkey_e, NULL);
20
+	put_bn(servkey_e, &p);				/* servkey exponent */
21
+	put_bn(servkey_n, &p);				/* servkey modulus */
22
+#else
23
 	put_bn(ssh->ctx->servkey->e, &p);		/* servkey exponent */
24
 	put_bn(ssh->ctx->servkey->n, &p);		/* servkey modulus */
25
+#endif
26
 	num = 1024; PUTLONG(num, p);			/* hostkey bits */
27
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
28
+	RSA_get0_key(ssh->ctx->hostkey, &hostkey_n, &hostkey_e, NULL);
29
+	put_bn(hostkey_e, &p);				/* hostkey exponent */
30
+	put_bn(hostkey_n, &p);				/* hostkey modulus */
31
+#else
32
 	put_bn(ssh->ctx->hostkey->e, &p);		/* hostkey exponent */
33
 	put_bn(ssh->ctx->hostkey->n, &p);		/* hostkey modulus */
34
+#endif
35
 	num = 0; PUTLONG(num, p);			/* protocol flags */
36
 	num = ssh->ctx->encmask; PUTLONG(num, p);	/* ciphers */
37
 	num = ssh->ctx->authmask; PUTLONG(num, p);	/* authmask */
38
@@ -296,7 +312,11 @@ SSH_accept(SSH *ssh)
39
 	SKIP(p, i, 4);
40
 
41
 	/* Decrypt session key. */
42
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
43
+	if (BN_cmp(servkey_n, hostkey_n) > 0) {
44
+#else
45
 	if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) > 0) {
46
+#endif
47
 		rsa_private_decrypt(enckey, enckey, ssh->ctx->servkey);
48
 		rsa_private_decrypt(enckey, enckey, ssh->ctx->hostkey);
49
 	}
50
@@ -316,8 +336,13 @@ SSH_accept(SSH *ssh)
51
 	BN_clear_free(enckey);
52
 	
53
 	/* Derive real session key using session id. */
54
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
55
+	if ((p = ssh_session_id(cookie, hostkey_n,
56
+				servkey_n)) == NULL) {
57
+#else
58
 	if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
59
 				ssh->ctx->servkey->n)) == NULL) {
60
+#endif
61
 		warn("ssh_session_id");
62
 		return (-1);
63
 	}
64
@@ -326,10 +351,15 @@ SSH_accept(SSH *ssh)
65
 	}
66
 	/* Set cipher. */
67
 	if (cipher == SSH_CIPHER_3DES) {
68
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
69
+		warnx("cipher 3des no longer supported");
70
+		return (-1);
71
+#else
72
 		ssh->estate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
73
 		ssh->dstate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
74
 		ssh->encrypt = des3_encrypt;
75
 		ssh->decrypt = des3_decrypt;
76
+#endif
77
 	}
78
 	else if (cipher == SSH_CIPHER_BLOWFISH) {
79
 		ssh->estate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
80
@@ -355,6 +385,10 @@ SSH_connect(SSH *ssh)
81
 	u_char *p, cipher, cookie[8], msg[1024];
82
 	u_int32_t num;
83
 	int i;
84
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
85
+	BIGNUM *servkey_n, *servkey_e;
86
+	BIGNUM *hostkey_n, *hostkey_e;
87
+#endif
88
 	
89
 	/* Get public key. */
90
 	if ((i = SSH_recv(ssh, pkt, sizeof(pkt))) <= 0) {
91
@@ -377,21 +411,43 @@ SSH_connect(SSH *ssh)
92
 
93
 	/* Get servkey. */
94
 	ssh->ctx->servkey = RSA_new();
95
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
96
+	servkey_n = BN_new();
97
+	servkey_e = BN_new();
98
+	RSA_set0_key(ssh->ctx->servkey, servkey_n, servkey_e, NULL);
99
+#else
100
 	ssh->ctx->servkey->n = BN_new();
101
 	ssh->ctx->servkey->e = BN_new();
102
+#endif
103
 
104
 	SKIP(p, i, 4);
105
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
106
+	get_bn(servkey_e, &p, &i);
107
+	get_bn(servkey_n, &p, &i);
108
+#else
109
 	get_bn(ssh->ctx->servkey->e, &p, &i);
110
 	get_bn(ssh->ctx->servkey->n, &p, &i);
111
+#endif
112
 
113
 	/* Get hostkey. */
114
 	ssh->ctx->hostkey = RSA_new();
115
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
116
+	hostkey_n = BN_new();
117
+	hostkey_e = BN_new();
118
+	RSA_set0_key(ssh->ctx->hostkey, hostkey_n, hostkey_e, NULL);
119
+#else
120
 	ssh->ctx->hostkey->n = BN_new();
121
 	ssh->ctx->hostkey->e = BN_new();
122
+#endif
123
 
124
 	SKIP(p, i, 4);
125
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
126
+	get_bn(hostkey_e, &p, &i);
127
+	get_bn(hostkey_n, &p, &i);
128
+#else
129
 	get_bn(ssh->ctx->hostkey->e, &p, &i);
130
 	get_bn(ssh->ctx->hostkey->n, &p, &i);
131
+#endif
132
 
133
 	/* Get cipher, auth masks. */
134
 	SKIP(p, i, 4);
135
@@ -403,8 +459,13 @@ SSH_connect(SSH *ssh)
136
 	RAND_bytes(ssh->sesskey, sizeof(ssh->sesskey));
137
 
138
 	/* Obfuscate with session id. */
139
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
140
+	if ((p = ssh_session_id(cookie, hostkey_n,
141
+				servkey_n)) == NULL) {
142
+#else
143
 	if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
144
 				ssh->ctx->servkey->n)) == NULL) {
145
+#endif
146
 		warn("ssh_session_id");
147
 		return (-1);
148
 	}
149
@@ -420,7 +481,11 @@ SSH_connect(SSH *ssh)
150
 		else BN_add_word(bn, ssh->sesskey[i]);
151
 	}
152
 	/* Encrypt session key. */
153
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
154
+	if (BN_cmp(servkey_n, hostkey_n) < 0) {
155
+#else
156
 	if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) < 0) {
157
+#endif
158
 		rsa_public_encrypt(bn, bn, ssh->ctx->servkey);
159
 		rsa_public_encrypt(bn, bn, ssh->ctx->hostkey);
160
 	}
161
@@ -468,10 +533,15 @@ SSH_connect(SSH *ssh)
162
 		ssh->decrypt = blowfish_decrypt;
163
 	}
164
 	else if (cipher == SSH_CIPHER_3DES) {
165
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
166
+		warnx("cipher 3des no longer supported");
167
+		return (-1);
168
+#else
169
 		ssh->estate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
170
 		ssh->dstate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
171
 		ssh->encrypt = des3_encrypt;
172
 		ssh->decrypt = des3_decrypt;
173
+#endif
174
 	}
175
 	/* Get server response. */
176
 	if ((i = SSH_recv(ssh, pkt, sizeof(pkt))) <= 0) {
(-)b/security/dsniff/files/patch-sshcrypto.c (-47 / +59 lines)
Lines 1-66 Link Here
1
$OpenBSD: patch-sshcrypto_c,v 1.3 2015/05/29 15:57:29 jca Exp $
1
$OpenBSD: patch-sshcrypto_c,v 1.3 2015/05/29 15:57:29 jca Exp $
2
--- sshcrypto.c.orig	Tue Nov 28 22:23:28 2000
2
--- sshcrypto.c.orig	2001-03-15 08:33:04 UTC
3
+++ sshcrypto.c	Fri May 29 17:56:22 2015
3
+++ sshcrypto.c
4
@@ -15,7 +15,9 @@
4
@@ -13,11 +13,13 @@
5
 #include "config.h"
6
 
5
 #include <sys/types.h>
7
 #include <sys/types.h>
8
+#include <openssl/blowfish.h>
6
 #include <openssl/ssl.h>
9
 #include <openssl/ssl.h>
7
 
10
 
8
+#include <openssl/des.h>
9
 #include <err.h>
11
 #include <err.h>
10
+#include <openssl/blowfish.h>
11
 #include <stdio.h>
12
 #include <stdio.h>
12
 #include <stdlib.h>
13
 #include <stdlib.h>
14
+#include <string.h>
15
 
16
 #include "sshcrypto.h"
13
 
17
 
14
@@ -27,8 +29,8 @@ struct blowfish_state {
18
@@ -26,10 +28,12 @@ struct blowfish_state {
19
 	u_char			iv[8];
15
 };
20
 };
16
 
21
 
22
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
17
 struct des3_state {
23
 struct des3_state {
18
-	des_key_schedule	k1, k2, k3;
24
 	des_key_schedule	k1, k2, k3;
19
-	des_cblock		iv1, iv2, iv3;
25
 	des_cblock		iv1, iv2, iv3;
20
+	DES_key_schedule	k1, k2, k3;
21
+	DES_cblock		iv1, iv2, iv3;
22
 };
26
 };
27
+#endif
23
 
28
 
24
 void
29
 void
25
@@ -153,13 +155,13 @@ des3_init(u_char *sesskey, int len)
30
 rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
26
 	if ((state = malloc(sizeof(*state))) == NULL)
31
@@ -37,10 +41,20 @@ rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
27
 		err(1, "malloc");
32
 	u_char *inbuf, *outbuf;
33
 	int len, ilen, olen;
28
 
34
 
29
-	des_set_key((void *)sesskey, state->k1);
35
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
30
-	des_set_key((void *)(sesskey + 8), state->k2);
36
+	const BIGNUM *n, *e;
31
+	DES_set_key((void *)sesskey, &state->k1);
37
+	RSA_get0_key(key, &n, &e, NULL);
32
+	DES_set_key((void *)(sesskey + 8), &state->k2);
38
+	if (BN_num_bits(e) < 2 || !BN_is_odd(e))
39
+#else
40
 	if (BN_num_bits(key->e) < 2 || !BN_is_odd(key->e))
41
+#endif
42
 		errx(1, "rsa_public_encrypt() exponent too small or not odd");
33
 
43
 
34
 	if (len <= 16)
44
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
35
-		des_set_key((void *)sesskey, state->k3);
45
+	olen = BN_num_bytes(n);
36
+		DES_set_key((void *)sesskey, &state->k3);
46
+#else
37
 	else
47
 	olen = BN_num_bytes(key->n);
38
-		des_set_key((void *)(sesskey + 16), state->k3);
48
+#endif
39
+		DES_set_key((void *)(sesskey + 16), &state->k3);
49
 	outbuf = malloc(olen);
40
 	
50
 
41
 	memset(state->iv1, 0, 8);
51
 	ilen = BN_num_bytes(in);
42
 	memset(state->iv2, 0, 8);
52
@@ -69,7 +83,13 @@ rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key)
43
@@ -175,9 +177,9 @@ des3_encrypt(u_char *src, u_char *dst, int len, void *
53
 	u_char *inbuf, *outbuf;
44
 	estate = (struct des3_state *)state;
54
 	int len, ilen, olen;
45
 	memcpy(estate->iv1, estate->iv2, 8);
55
 
46
 	
56
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
47
-	des_ncbc_encrypt(src, dst, len, estate->k1, &estate->iv1, DES_ENCRYPT);
57
+	const BIGNUM *n;
48
-	des_ncbc_encrypt(dst, dst, len, estate->k2, &estate->iv2, DES_DECRYPT);
58
+	RSA_get0_key(key, &n, NULL, NULL);
49
-	des_ncbc_encrypt(dst, dst, len, estate->k3, &estate->iv3, DES_ENCRYPT);
59
+	olen = BN_num_bytes(n);
50
+	DES_ncbc_encrypt(src, dst, len, &estate->k1, &estate->iv1, DES_ENCRYPT);
60
+#else
51
+	DES_ncbc_encrypt(dst, dst, len, &estate->k2, &estate->iv2, DES_DECRYPT);
61
 	olen = BN_num_bytes(key->n);
52
+	DES_ncbc_encrypt(dst, dst, len, &estate->k3, &estate->iv3, DES_ENCRYPT);
62
+#endif
63
 	outbuf = malloc(olen);
64
 
65
 	ilen = BN_num_bytes(in);
66
@@ -144,6 +164,7 @@ blowfish_decrypt(u_char *src, u_char *dst, int len, vo
67
 	swap_bytes(dst, dst, len);
53
 }
68
 }
54
 
69
 
55
 void
70
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
56
@@ -188,7 +190,7 @@ des3_decrypt(u_char *src, u_char *dst, int len, void *
71
 /* XXX - SSH1's weirdo 3DES... */
57
 	dstate = (struct des3_state *)state;
72
 void *
58
 	memcpy(dstate->iv1, dstate->iv2, 8);
73
 des3_init(u_char *sesskey, int len)
59
 	
74
@@ -192,3 +213,4 @@ des3_decrypt(u_char *src, u_char *dst, int len, void *
60
-	des_ncbc_encrypt(src, dst, len, dstate->k3, &dstate->iv3, DES_DECRYPT);
75
 	des_ncbc_encrypt(dst, dst, len, dstate->k2, &dstate->iv2, DES_ENCRYPT);
61
-	des_ncbc_encrypt(dst, dst, len, dstate->k2, &dstate->iv2, DES_ENCRYPT);
76
 	des_ncbc_encrypt(dst, dst, len, dstate->k1, &dstate->iv1, DES_DECRYPT);
62
-	des_ncbc_encrypt(dst, dst, len, dstate->k1, &dstate->iv1, DES_DECRYPT);
63
+	DES_ncbc_encrypt(src, dst, len, &dstate->k3, &dstate->iv3, DES_DECRYPT);
64
+	DES_ncbc_encrypt(dst, dst, len, &dstate->k2, &dstate->iv2, DES_ENCRYPT);
65
+	DES_ncbc_encrypt(dst, dst, len, &dstate->k1, &dstate->iv1, DES_DECRYPT);
66
 }
77
 }
78
+#endif
(-)b/security/dsniff/files/patch-sshmitm.c (-14 / +14 lines)
Lines 1-55 Link Here
1
--- ./sshmitm.c.orig	2001-03-15 09:33:04.000000000 +0100
1
--- sshmitm.c.orig	2001-03-15 08:33:04 UTC
2
+++ ./sshmitm.c	2014-07-22 13:20:14.000000000 +0200
2
+++ sshmitm.c
3
@@ -41,7 +41,7 @@
3
@@ -41,7 +41,7 @@ int	 mitm_fd;
4
 int	 client_fd, server_fd;
4
 int	 client_fd, server_fd;
5
 SSH_CTX	*ssh_client_ctx, *ssh_server_ctx;
5
 SSH_CTX	*ssh_client_ctx, *ssh_server_ctx;
6
 SSH	*ssh_client, *ssh_server;
6
 SSH	*ssh_client, *ssh_server;
7
-struct	 sockaddr_in csin, ssin;
7
-struct	 sockaddr_in csin, ssin;
8
+struct	 sockaddr_in ________csin, ssin;
8
+struct	 sockaddr_in ____________csin, ssin;
9
 int	 sig_pipe[2];
9
 int	 sig_pipe[2];
10
 
10
 
11
 static void
11
 static void
12
@@ -148,7 +148,7 @@
12
@@ -148,7 +148,7 @@ mitm_child(void)
13
 	
13
 	
14
 	if (Opt_debug)
14
 	if (Opt_debug)
15
 		warnx("new connection from %s.%d",
15
 		warnx("new connection from %s.%d",
16
-		      inet_ntoa(csin.sin_addr), ntohs(csin.sin_port));
16
-		      inet_ntoa(csin.sin_addr), ntohs(csin.sin_port));
17
+		      inet_ntoa(________csin.sin_addr), ntohs(________csin.sin_port));
17
+		      inet_ntoa(____________csin.sin_addr), ntohs(____________csin.sin_port));
18
 	
18
 	
19
 	if (fcntl(client_fd, F_SETFL, 0) == -1)
19
 	if (fcntl(client_fd, F_SETFL, 0) == -1)
20
 		err(1, "fcntl");
20
 		err(1, "fcntl");
21
@@ -237,10 +237,10 @@
21
@@ -237,10 +237,10 @@ mitm_child(void)
22
 				}
22
 				}
23
 				else {
23
 				else {
24
 					pass_done = 1;
24
 					pass_done = 1;
25
-					record(csin.sin_addr.s_addr,
25
-					record(csin.sin_addr.s_addr,
26
+					record(________csin.sin_addr.s_addr,
26
+					record(____________csin.sin_addr.s_addr,
27
 					       ssin.sin_addr.s_addr,
27
 					       ssin.sin_addr.s_addr,
28
 					       IPPROTO_TCP,
28
 					       IPPROTO_TCP,
29
-					       ntohs(csin.sin_port),
29
-					       ntohs(csin.sin_port),
30
+					       ntohs(________csin.sin_port),
30
+					       ntohs(____________csin.sin_port),
31
 					       ntohs(ssin.sin_port), "ssh",
31
 					       ntohs(ssin.sin_port), "ssh",
32
 					       userpass, strlen(userpass));
32
 					       userpass, strlen(userpass));
33
 				}
33
 				}
34
@@ -326,7 +326,7 @@
34
@@ -326,7 +326,7 @@ mitm_run(void)
35
 			if (errno != EINTR)
35
 			if (errno != EINTR)
36
 				err(1, "select");
36
 				err(1, "select");
37
 		}
37
 		}
38
-		i = sizeof(csin);
38
-		i = sizeof(csin);
39
+		i = sizeof(________csin);
39
+		i = sizeof(____________csin);
40
 		
40
 		
41
 		if (FD_ISSET(sig_pipe[0], &fds)) {
41
 		if (FD_ISSET(sig_pipe[0], &fds)) {
42
 			while (read(sig_pipe[0], buf, 1) == 1)
42
 			while (read(sig_pipe[0], buf, 1) == 1)
43
@@ -336,7 +336,7 @@
43
@@ -336,7 +336,7 @@ mitm_run(void)
44
 		}
44
 		}
45
 		if (FD_ISSET(mitm_fd, &fds)) {
45
 		if (FD_ISSET(mitm_fd, &fds)) {
46
 			client_fd = accept(mitm_fd,
46
 			client_fd = accept(mitm_fd,
47
-					   (struct sockaddr *)&csin, &i);
47
-					   (struct sockaddr *)&csin, &i);
48
+					   (struct sockaddr *)&________csin, &i);
48
+					   (struct sockaddr *)&____________csin, &i);
49
 
49
 
50
 			if (client_fd >= 0) {
50
 			if (client_fd >= 0) {
51
 				if (fork() == 0) {
51
 				if (fork() == 0) {
52
@@ -389,7 +389,7 @@
52
@@ -389,7 +389,7 @@ main(int argc, char *argv[])
53
 	if (argc < 1)
53
 	if (argc < 1)
54
 		usage();
54
 		usage();
55
 	
55
 	
(-)b/security/dsniff/files/patch-tcp_raw.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- ./tcp_raw.c.orig	2001-03-15 09:33:04.000000000 +0100
1
--- tcp_raw.c.orig	2001-03-15 08:33:04 UTC
2
+++ ./tcp_raw.c	2014-07-22 13:20:14.000000000 +0200
2
+++ tcp_raw.c
3
@@ -119,7 +119,7 @@
3
@@ -119,7 +119,7 @@ tcp_raw_reassemble(struct tcp_conn *conn, int minlen)
4
 }
4
 }
5
 
5
 
6
 struct iovec *
6
 struct iovec *
Lines 9-15 Link Here
9
 {
9
 {
10
 	struct tha tha;
10
 	struct tha tha;
11
 	struct tcp_conn *conn;
11
 	struct tcp_conn *conn;
12
@@ -131,7 +131,7 @@
12
@@ -131,7 +131,7 @@ tcp_raw_input(struct libnet_ip_hdr *ip, struct libnet_
13
 
13
 
14
 	/* Verify TCP checksum. */
14
 	/* Verify TCP checksum. */
15
 	cksum = tcp->th_sum;
15
 	cksum = tcp->th_sum;
(-)b/security/dsniff/files/patch-tcp_raw.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- ./tcp_raw.h.orig	2001-03-15 09:33:06.000000000 +0100
1
--- tcp_raw.h.orig	2001-03-15 08:33:06 UTC
2
+++ ./tcp_raw.h	2014-07-22 13:20:14.000000000 +0200
2
+++ tcp_raw.h
3
@@ -15,7 +15,7 @@
3
@@ -15,7 +15,7 @@ typedef void (*tcp_raw_callback_t)(in_addr_t src, in_a
4
 				   u_short sport, u_short dport,
4
 				   u_short sport, u_short dport,
5
 				   u_char *buf, int len);
5
 				   u_char *buf, int len);
6
 
6
 
(-)b/security/dsniff/files/patch-tcpkill.c (-8 / +9 lines)
Lines 1-6 Link Here
1
--- ./tcpkill.c.orig	2001-03-17 09:10:43.000000000 +0100
1
--- tcpkill.c.orig	2001-03-17 08:10:43 UTC
2
+++ ./tcpkill.c	2014-07-22 13:20:14.000000000 +0200
2
+++ tcpkill.c
3
@@ -39,17 +39,18 @@
3
@@ -39,17 +39,18 @@ usage(void)
4
 static void
4
 static void
5
 tcp_kill_cb(u_char *user, const struct pcap_pkthdr *pcap, const u_char *pkt)
5
 tcp_kill_cb(u_char *user, const struct pcap_pkthdr *pcap, const u_char *pkt)
6
 {
6
 {
Lines 24-30 Link Here
24
 	if (ip->ip_p != IPPROTO_TCP)
24
 	if (ip->ip_p != IPPROTO_TCP)
25
 		return;
25
 		return;
26
 	
26
 	
27
@@ -57,34 +58,31 @@
27
@@ -57,35 +58,32 @@ tcp_kill_cb(u_char *user, const struct pcap_pkthdr *pc
28
 	if (tcp->th_flags & (TH_SYN|TH_FIN|TH_RST))
28
 	if (tcp->th_flags & (TH_SYN|TH_FIN|TH_RST))
29
 		return;
29
 		return;
30
 
30
 
Lines 62-68 Link Here
62
+		libnet_build_tcp(ntohs(tcp->th_dport), ntohs(tcp->th_sport),
62
+		libnet_build_tcp(ntohs(tcp->th_dport), ntohs(tcp->th_sport),
63
+				 seq, 0, TH_RST, 0, 0, 0, LIBNET_TCP_H, 
63
+				 seq, 0, TH_RST, 0, 0, 0, LIBNET_TCP_H, 
64
+				 NULL, 0, l, 0);
64
+				 NULL, 0, l, 0);
65
+		
65
 		
66
+		libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_TCP_H, 0,
66
+		libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_TCP_H, 0,
67
+				  libnet_get_prand(LIBNET_PRu16), 0, 64,
67
+				  libnet_get_prand(LIBNET_PRu16), 0, 64,
68
+				  IPPROTO_TCP, 0, ip->ip_dst.s_addr,
68
+				  IPPROTO_TCP, 0, ip->ip_dst.s_addr,
Lines 70-79 Link Here
70
+		
70
+		
71
+		if (libnet_write(l) < 0)
71
+		if (libnet_write(l) < 0)
72
+			warn("write");
72
+			warn("write");
73
 		
73
+		
74
 		fprintf(stderr, "%s R %lu:%lu(0) win 0\n", ctext, seq, seq);
74
 		fprintf(stderr, "%s R %lu:%lu(0) win 0\n", ctext, seq, seq);
75
 	}
75
 	}
76
@@ -95,8 +93,10 @@
76
 }
77
@@ -95,8 +93,10 @@ main(int argc, char *argv[])
77
 {
78
 {
78
 	extern char *optarg;
79
 	extern char *optarg;
79
 	extern int optind;
80
 	extern int optind;
Lines 85-91 Link Here
85
 	pcap_t *pd;
86
 	pcap_t *pd;
86
 	
87
 	
87
 	intf = NULL;
88
 	intf = NULL;
88
@@ -136,14 +136,14 @@
89
@@ -136,14 +136,14 @@ main(int argc, char *argv[])
89
 	if ((pcap_off = pcap_dloff(pd)) < 0)
90
 	if ((pcap_off = pcap_dloff(pd)) < 0)
90
 		errx(1, "couldn't determine link layer offset");
91
 		errx(1, "couldn't determine link layer offset");
91
 	
92
 	
(-)b/security/dsniff/files/patch-tcpnice.c (-8 / +8 lines)
Lines 1-6 Link Here
1
--- ./tcpnice.c.orig	2001-03-17 08:41:51.000000000 +0100
1
--- tcpnice.c.orig	2001-03-17 07:41:51 UTC
2
+++ ./tcpnice.c	2014-07-22 13:20:14.000000000 +0200
2
+++ tcpnice.c
3
@@ -41,107 +41,106 @@
3
@@ -41,107 +41,106 @@ usage(void)
4
 }
4
 }
5
 
5
 
6
 static void
6
 static void
Lines 106-113 Link Here
106
+	memcpy((u_char *)icmp + LIBNET_ICMPV4_MASK_H, (u_char *)ip, len);
106
+	memcpy((u_char *)icmp + LIBNET_ICMPV4_MASK_H, (u_char *)ip, len);
107
 
107
 
108
-	libnet_do_checksum(buf, IPPROTO_ICMP, ICMP_MASK_H + len);
108
-	libnet_do_checksum(buf, IPPROTO_ICMP, ICMP_MASK_H + len);
109
-	
110
-	len += (IP_H + ICMP_MASK_H);
111
+	len += LIBNET_ICMPV4_MASK_H;
109
+	len += LIBNET_ICMPV4_MASK_H;
112
+
110
+
113
+	libnet_build_ipv4(LIBNET_IPV4_H + len, 4,
111
+	libnet_build_ipv4(LIBNET_IPV4_H + len, 4,
Lines 115-120 Link Here
115
+			  0, ip->ip_dst.s_addr, ip->ip_src.s_addr,
113
+			  0, ip->ip_dst.s_addr, ip->ip_src.s_addr,
116
+			  (u_int8_t *) icmp, len, l, 0);
114
+			  (u_int8_t *) icmp, len, l, 0);
117
 	
115
 	
116
-	len += (IP_H + ICMP_MASK_H);
117
-	
118
-	if (libnet_write_ip(sock, buf, len) != len)
118
-	if (libnet_write_ip(sock, buf, len) != len)
119
+	if (libnet_write(l) != len)
119
+	if (libnet_write(l) != len)
120
 		warn("write");
120
 		warn("write");
Lines 149-155 Link Here
149
 	if (ip->ip_p != IPPROTO_TCP)
149
 	if (ip->ip_p != IPPROTO_TCP)
150
 		return;
150
 		return;
151
 	
151
 	
152
@@ -151,11 +150,11 @@
152
@@ -151,11 +150,11 @@ tcp_nice_cb(u_char *user, const struct pcap_pkthdr *pc
153
 	
153
 	
154
 	if (ntohs(ip->ip_len) > (ip->ip_hl << 2) + (tcp->th_off << 2)) {
154
 	if (ntohs(ip->ip_len) > (ip->ip_hl << 2) + (tcp->th_off << 2)) {
155
 		if (Opt_icmp)
155
 		if (Opt_icmp)
Lines 164-170 Link Here
164
 	}
164
 	}
165
 }
165
 }
166
 
166
 
167
@@ -164,8 +163,10 @@
167
@@ -164,8 +163,10 @@ main(int argc, char *argv[])
168
 {
168
 {
169
 	extern char *optarg;
169
 	extern char *optarg;
170
 	extern int optind;
170
 	extern int optind;
Lines 176-182 Link Here
176
 	pcap_t *pd;
176
 	pcap_t *pd;
177
 	
177
 	
178
 	intf = NULL;
178
 	intf = NULL;
179
@@ -209,14 +210,14 @@
179
@@ -209,14 +210,14 @@ main(int argc, char *argv[])
180
 	if ((pcap_off = pcap_dloff(pd)) < 0)
180
 	if ((pcap_off = pcap_dloff(pd)) < 0)
181
 		errx(1, "couldn't determine link layer offset");
181
 		errx(1, "couldn't determine link layer offset");
182
 	
182
 	
(-)b/security/dsniff/files/patch-trigger.c (-5 / +5 lines)
Lines 1-6 Link Here
1
--- ./trigger.c.orig	2001-03-15 09:33:05.000000000 +0100
1
--- trigger.c.orig	2001-03-15 08:33:05 UTC
2
+++ ./trigger.c	2014-07-22 13:20:14.000000000 +0200
2
+++ trigger.c
3
@@ -276,7 +276,7 @@
3
@@ -276,7 +276,7 @@ trigger_dump(void)
4
 }
4
 }
5
 	
5
 	
6
 void
6
 void
Lines 9-15 Link Here
9
 {
9
 {
10
 	struct trigger *t, tr;
10
 	struct trigger *t, tr;
11
 	u_char *buf;
11
 	u_char *buf;
12
@@ -305,7 +305,7 @@
12
@@ -305,7 +305,7 @@ trigger_ip(struct libnet_ip_hdr *ip)
13
 
13
 
14
 /* libnids needs a nids_register_udp()... */
14
 /* libnids needs a nids_register_udp()... */
15
 void
15
 void
Lines 18-24 Link Here
18
 {
18
 {
19
 	struct trigger *t, tr;
19
 	struct trigger *t, tr;
20
 	struct libnet_udp_hdr *udp;
20
 	struct libnet_udp_hdr *udp;
21
@@ -437,7 +437,7 @@
21
@@ -437,7 +437,7 @@ trigger_tcp(struct tcp_stream *ts, void **conn_save)
22
 }
22
 }
23
 
23
 
24
 void
24
 void
(-)b/security/dsniff/files/patch-trigger.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- ./trigger.h.orig	2001-03-15 09:33:06.000000000 +0100
1
--- trigger.h.orig	2001-03-15 08:33:06 UTC
2
+++ ./trigger.h	2014-07-22 13:20:14.000000000 +0200
2
+++ trigger.h
3
@@ -24,10 +24,10 @@
3
@@ -24,10 +24,10 @@ int	trigger_set_udp(int port, char *name);
4
 int	trigger_set_tcp(int port, char *name);
4
 int	trigger_set_tcp(int port, char *name);
5
 int	trigger_set_rpc(int program, char *name);
5
 int	trigger_set_rpc(int program, char *name);
6
 
6
 
(-)b/security/dsniff/files/patch-urlsnarf.c (-3 / +3 lines)
Lines 1-6 Link Here
1
--- ./urlsnarf.c.orig	2001-03-15 10:26:13.000000000 +0100
1
--- urlsnarf.c.orig	2001-03-15 09:26:13 UTC
2
+++ ./urlsnarf.c	2014-07-22 13:20:14.000000000 +0200
2
+++ urlsnarf.c
3
@@ -145,14 +145,14 @@
3
@@ -145,14 +145,14 @@ process_http_request(struct tuple4 *addr, u_char *data
4
 		if (user == NULL)
4
 		if (user == NULL)
5
 			user = "-";
5
 			user = "-";
6
 		if (vhost == NULL)
6
 		if (vhost == NULL)
(-)b/security/dsniff/files/patch-webmitm.c (-20 / +20 lines)
Lines 1-26 Link Here
1
--- ./webmitm.c.orig	2001-03-17 09:35:05.000000000 +0100
1
--- webmitm.c.orig	2001-03-17 08:35:05 UTC
2
+++ ./webmitm.c	2014-07-22 13:20:14.000000000 +0200
2
+++ webmitm.c
3
@@ -43,7 +43,7 @@
3
@@ -43,7 +43,7 @@ int	 http_fd, https_fd;
4
 int	 client_fd, server_fd;
4
 int	 client_fd, server_fd;
5
 SSL_CTX	*ssl_client_ctx, *ssl_server_ctx;
5
 SSL_CTX	*ssl_client_ctx, *ssl_server_ctx;
6
 SSL	*ssl_client, *ssl_server;
6
 SSL	*ssl_client, *ssl_server;
7
-struct	 sockaddr_in csin, ssin;
7
-struct	 sockaddr_in csin, ssin;
8
+struct	 sockaddr_in ________csin, ssin;
8
+struct	 sockaddr_in ____________csin, ssin;
9
 int	 do_ssl, sig_pipe[2];
9
 int	 do_ssl, sig_pipe[2];
10
 in_addr_t	static_host = 0;
10
 in_addr_t	static_host = 0;
11
 
11
 
12
@@ -101,8 +101,8 @@
12
@@ -101,8 +101,8 @@ grep_passwords(char *buf, int len)
13
 	char obuf[1024];
13
 	char obuf[1024];
14
 	
14
 	
15
 	if ((len = decode_http(buf, len, obuf, sizeof(obuf))) > 0) {
15
 	if ((len = decode_http(buf, len, obuf, sizeof(obuf))) > 0) {
16
-		record(csin.sin_addr.s_addr, ssin.sin_addr.s_addr,
16
-		record(csin.sin_addr.s_addr, ssin.sin_addr.s_addr,
17
-		       IPPROTO_TCP, ntohs(csin.sin_port), ntohs(ssin.sin_port),
17
-		       IPPROTO_TCP, ntohs(csin.sin_port), ntohs(ssin.sin_port),
18
+		record(________csin.sin_addr.s_addr, ssin.sin_addr.s_addr,
18
+		record(____________csin.sin_addr.s_addr, ssin.sin_addr.s_addr,
19
+		       IPPROTO_TCP, ntohs(________csin.sin_port), ntohs(ssin.sin_port),
19
+		       IPPROTO_TCP, ntohs(____________csin.sin_port), ntohs(ssin.sin_port),
20
 		       "http", obuf, len);
20
 		       "http", obuf, len);
21
 	}
21
 	}
22
 }
22
 }
23
@@ -242,7 +242,7 @@
23
@@ -242,7 +242,7 @@ server_init(char *buf, int size)
24
 			word = buf_tok(&msg, "/", 1);
24
 			word = buf_tok(&msg, "/", 1);
25
 			vhost = buf_strdup(word);
25
 			vhost = buf_strdup(word);
26
 		}
26
 		}
Lines 29-85 Link Here
29
 		free(vhost);
29
 		free(vhost);
30
 		
30
 		
31
 		if (ssin.sin_addr.s_addr == ntohl(INADDR_LOOPBACK) ||
31
 		if (ssin.sin_addr.s_addr == ntohl(INADDR_LOOPBACK) ||
32
@@ -355,7 +355,7 @@
32
@@ -355,7 +355,7 @@ mitm_child(void)
33
 	
33
 	
34
 	if (Opt_debug)
34
 	if (Opt_debug)
35
 		warnx("new connection from %s.%d",
35
 		warnx("new connection from %s.%d",
36
-		      inet_ntoa(csin.sin_addr), ntohs(csin.sin_port));
36
-		      inet_ntoa(csin.sin_addr), ntohs(csin.sin_port));
37
+		      inet_ntoa(________csin.sin_addr), ntohs(________csin.sin_port));
37
+		      inet_ntoa(____________csin.sin_addr), ntohs(____________csin.sin_port));
38
 
38
 
39
 	client_init();
39
 	client_init();
40
 	
40
 	
41
@@ -363,7 +363,7 @@
41
@@ -363,7 +363,7 @@ mitm_child(void)
42
 		err(1, "client_request");
42
 		err(1, "client_request");
43
 
43
 
44
 	if (Opt_debug)
44
 	if (Opt_debug)
45
-		warnx("%d bytes from %s", i, inet_ntoa(csin.sin_addr));
45
-		warnx("%d bytes from %s", i, inet_ntoa(csin.sin_addr));
46
+		warnx("%d bytes from %s", i, inet_ntoa(________csin.sin_addr));
46
+		warnx("%d bytes from %s", i, inet_ntoa(____________csin.sin_addr));
47
 	
47
 	
48
 	if (Opt_debug > 1)
48
 	if (Opt_debug > 1)
49
 		write(STDERR_FILENO, buf, i);
49
 		write(STDERR_FILENO, buf, i);
50
@@ -393,7 +393,7 @@
50
@@ -393,7 +393,7 @@ mitm_child(void)
51
 			
51
 			
52
 			if (Opt_debug)
52
 			if (Opt_debug)
53
 				warnx("%d bytes from %s",
53
 				warnx("%d bytes from %s",
54
-				      i, inet_ntoa(csin.sin_addr));
54
-				      i, inet_ntoa(csin.sin_addr));
55
+				      i, inet_ntoa(________csin.sin_addr));
55
+				      i, inet_ntoa(____________csin.sin_addr));
56
 
56
 
57
 			if (Opt_debug > 1)
57
 			if (Opt_debug > 1)
58
 				write(STDERR_FILENO, buf, i);
58
 				write(STDERR_FILENO, buf, i);
59
@@ -456,7 +456,7 @@
59
@@ -456,7 +456,7 @@ mitm_run(void)
60
 			if (errno != EINTR)
60
 			if (errno != EINTR)
61
 				err(1, "select");
61
 				err(1, "select");
62
 		}
62
 		}
63
-		i = sizeof(csin);
63
-		i = sizeof(csin);
64
+		i = sizeof(________csin);
64
+		i = sizeof(____________csin);
65
 		
65
 		
66
 		if (FD_ISSET(sig_pipe[0], &fds)) {
66
 		if (FD_ISSET(sig_pipe[0], &fds)) {
67
 			while (read(sig_pipe[0], &i, 1) == 1)
67
 			while (read(sig_pipe[0], &i, 1) == 1)
68
@@ -466,11 +466,11 @@
68
@@ -466,11 +466,11 @@ mitm_run(void)
69
 			continue;
69
 			continue;
70
 		}
70
 		}
71
 		if (FD_ISSET(http_fd, &fds)) {
71
 		if (FD_ISSET(http_fd, &fds)) {
72
-			client_fd = accept(http_fd, (struct sockaddr *)&csin, &i);
72
-			client_fd = accept(http_fd, (struct sockaddr *)&csin, &i);
73
+			client_fd = accept(http_fd, (struct sockaddr *)&________csin, &i);
73
+			client_fd = accept(http_fd, (struct sockaddr *)&____________csin, &i);
74
 			do_ssl = 0;
74
 			do_ssl = 0;
75
 		}
75
 		}
76
 		else if (FD_ISSET(https_fd, &fds)) {
76
 		else if (FD_ISSET(https_fd, &fds)) {
77
-			client_fd = accept(https_fd, (struct sockaddr *)&csin, &i);
77
-			client_fd = accept(https_fd, (struct sockaddr *)&csin, &i);
78
+			client_fd = accept(https_fd, (struct sockaddr *)&________csin, &i);
78
+			client_fd = accept(https_fd, (struct sockaddr *)&____________csin, &i);
79
 			do_ssl = 1;
79
 			do_ssl = 1;
80
 		}
80
 		}
81
 		else errx(1, "select failure");
81
 		else errx(1, "select failure");
82
@@ -510,7 +510,7 @@
82
@@ -510,7 +510,7 @@ main(int argc, char *argv[])
83
 	argv += optind;
83
 	argv += optind;
84
 
84
 
85
 	if (argc == 1) {
85
 	if (argc == 1) {
(-)b/security/dsniff/files/patch-webspy.c (-5 / +4 lines)
Lines 1-6 Link Here
1
--- ./webspy.c.orig	2001-03-15 09:33:05.000000000 +0100
1
--- webspy.c.orig	2001-03-15 08:33:05 UTC
2
+++ ./webspy.c	2014-07-22 13:20:14.000000000 +0200
2
+++ webspy.c
3
@@ -126,7 +126,7 @@
3
@@ -126,7 +126,7 @@ process_http_request(struct tuple4 *addr, u_char *data
4
 		if (auth == NULL)
4
 		if (auth == NULL)
5
 			auth = "";
5
 			auth = "";
6
 		if (vhost == NULL)
6
 		if (vhost == NULL)
Lines 9-15 Link Here
9
 		
9
 		
10
 		snprintf(cmd, sizeof(cmd), "openURL(http://%s%s%s%s)",
10
 		snprintf(cmd, sizeof(cmd), "openURL(http://%s%s%s%s)",
11
 			 auth, *auth ? "@" : "", vhost, uri);
11
 			 auth, *auth ? "@" : "", vhost, uri);
12
@@ -202,7 +202,7 @@
12
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
13
 	cmdtab[0] = cmd;
13
 	cmdtab[0] = cmd;
14
 	cmdtab[1] = NULL;
14
 	cmdtab[1] = NULL;
15
 	
15
 	
16
- 

Return to bug 235862