[
Bloke.com
|| Linux
|| JavaScript
|| Java
|| Volleyball
|| Link Me
]
Free: [ Guestbook || MessageBot || Plugins || Counter || AusPrices || Advertise ] |
This document just describes how to change the network access policy. To be more specific the only change it makes is to change the network policy from NETWORK_HOST to NETWORK_UNRESTRICTED.
There are several security issues in doing this especially if you are behind a firewall. However, it is here that the fix is most useful. Are you sick of applets not working behind your corporate firewall? This could be the fix for you.
Consequences: The basic bottom line, is that an applet outside the firewall has access to machines inside the firewall. So it could try to log into machines, it could use finger to find out usernames and guess passwords, it could send this information back outside the firewall. It could know how to communicate with data servers inside the firewall and manipulate them, and do all kinds of nasty things. So you better trust the applets, that you are going to run.
The good side. All those applets on the outside that you have been trying to run, now do! However, you could just use the IP address for the web page in most cases. If you don't know the IP address of a machine on the outside, you can use my nslookup program to find it out. This of course is *MUCH* safe.
If you look at the byte codes you see that in Method void reset() byte 44, this is where the variable networkMode is set to 2 (NETWORK_HOST). If we change this to 3 (NETWORK_UNRESTRICTED), then we should be set! so the byte code iconst_2 is 0x04, so if we change it to iconst_3 (0x05) all is well. Looking at the octal dump of the original class file, we see these bytes are found on line 0010720
0010720 04b5 0064 b12a 05b5 0064 b100 0000 0200so we change this first 04, to 05, and we would then have iconst_3!
The program a.c does exactly this. Then we zip the whole thing back up again ... (without compression).
AppletSecurity.class
from Netscape 3.0 (from the Solaris 2.4 version) (retrieved using unzip -d java_30; cd netscape/applet ; mv AppletSecurity.class AppletSecurity.class.orig
)
javap -c netscape.applet.AppletSecurity
od -x AppletSecurity.class.orig
./a < AppletSecurity.class.orig > AppletSecurity.class
java_30
in the right place). Generated by
zip -rn .class:.Z java_30.bloke 96223.class java netscape sun