Re: LARRY ELLISON
On Wed, 12 Mar 1997, Hamish Moffatt wrote:
> Okay, but how about this one. I'm on hamishpc.rising.com.au, accessing
> a web page (http://www.silcom.com/~tonkin/pointless/), but I'm IP
> masquerading via silly.rising.com.au, which isn't really called that
> at all because I'm on via my ISP who's given my a dynamic IP, so I'm
> really dialin-a1-30.melbourne.internex.net.au or similar, and then
> I've via proxy cache proxy1.mel.connect.com.au, but that page still
> knows I'm from hamishpc!
>
> I do CGI but can't see how they do this one.
view the document source - they're using a java applet:
<APPLET CODEBASE="classes" CODE="urname2.class" WIDTH=400 HEIGHT=30>
<PARAM NAME="background_color" VALUE=255,255,255>
<PARAM NAME="text_color" VALUE=0,0,0>
<PARAM NAME="font_name" VALUE="times roman">
<PARAM NAME="font_size" VALUE=20>
<H4><FONT COLOR=RED>If you're reading this you need to get a JAVA-capable
browser!!</FONT></H4>
</APPLET>
so, urname2.class is run by your netscape and it displays your hostname.
I'd like to see the source of that applet - i'd like to know what else
it does...e.g. does it log my hostname & login id (email address) at the
remote site?
i just did a search for urname2.class at alta-vista and came up with:
http://www.appl-math.tu-muenchen.de/~gwoersch/java.html
which has a lot of java demos and source code, including urname2.java.
here it is. it looks innocuous enough but it could quite easily be
modified to send information back to the server.
// Used to get the user name. special crdits to Scott Clark at
// the Central Java Message Base for the tech part and Mig9 for
// the motivation part. Amit C. (ConnectSoft Ruksun, Pune, India)
// amit@corus.com Updated by public demand. Lots of people wanted a
// version, where the font, etc can be changed
import java.applet.Applet;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.lang.String;
import java.util.StringTokenizer;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class urname2 extends Applet
{
Color clrTextColor = new Color (255, 255, 255);
Color clrBackGndColor = new Color (160, 160, 100);
String sFontName; // Text font, max = 72 ?
int iFontSize;
InetAddress myAddress = null;
public void init ()
{
// Get the specified color for text, else
// use black
clrTextColor = StringToColor (
MygetStringParam ("text_color", null),
Color.black);
// Get the specified color for background,
// else use red
clrBackGndColor = StringToColor (
MygetStringParam ("background_color", null),
Color.red);
// Font name
sFontName = new String (MygetStringParam ("font_name", "Courier"));
// Font size
iFontSize = MygetintParam ("font_size", 14);
// Now set the font specified
setFont (new Font (sFontName, Font.PLAIN, iFontSize));
try
{
myAddress = InetAddress.getLocalHost ();
}
catch (UnknownHostException e)
{
}
}
public void paint (Graphics g)
{
g.setColor (clrBackGndColor);
g.drawRect (0, 0, size ().width - 1, size ().height - 1);
g.fillRect (0, 0, size ().width - 1, size ().height - 1);
g.setColor (clrTextColor);
g.drawString ("Welcome " + myAddress.getHostName () + "!", 10, 20);
// g.drawString(myAddress.toString(), 10, 20);
}
public String getAppletInfo ()
{
return "urname2, a Java Applet by Amit Chaudhary \n(amit@corus.com), 3/7/96";
}
public String[][] getParameterInfo ()
{
String pinfo[][] =
{
{"background_color", "0-255,0-255,0-255", "Background Color"},
{"text_color", "0-255,0-255,0-255", "Text Color"},
{"font_name", "String", "Font for the text, TimesRoman, Courier, helvetica, .."},
{"font_size", "8-72", "The font size"}};
return pinfo;
}
// A changed version of getparam
public String MygetStringParam (String att, String def)
{
String ret;
try
{
ret = getParameter (att);
if (ret.length () < 1)
return def;
else
return ret;
}
catch (Exception e)
{
return def;
}
}
// A another changed version of getparam, this to get int params
public int MygetintParam (String att, int def)
{
Integer RetParam;
try
{
RetParam = new Integer (getParameter (att));
if (RetParam.intValue () == 0)
return def;
else
return RetParam.intValue ();
}
catch (Exception e)
{
return def;
}
}
// Given a string parses it to get the colors
public Color StringToColor (String strColor_p, Color clrDefault_p)
{
if (strColor_p.length () == 0)
{
return clrDefault_p;
}
int r;
int g;
int b;
// Delimiter is ','
StringTokenizer st = new StringTokenizer (strColor_p, ",");
try
{
r = Integer.valueOf (st.nextToken ()).intValue ();
g = Integer.valueOf (st.nextToken ()).intValue ();
b = Integer.valueOf (st.nextToken ()).intValue ();
return new Color (r, g, b);
}
catch (Exception e)
{
return clrDefault_p;
}
}
}
craig
Reply to: