Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
Who's got it? Who's giving it away? How to protect your privacy and steal it from other people. For intellectual privacy, personal privacy, and blackhats alike... 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
getting an internal IP on IE
Posted by: lat
Date: July 25, 2009 03:45PM

I came across the following Java class that allows you to enumerate the internal IP on IE.

http://reglos.de/myaddress/MyAddress.html

In FF, I can use JavaScript to create a java.net.Socket and get the internal IP, but that method does not work in IE. The source for the class is is not available, any ideas on how this is done in Java?

- lat

Options: ReplyQuote
Re: getting an internal IP on IE
Posted by: rvdh
Date: July 25, 2009 06:43PM

Source is right there, just look good and decompile it. Otherwise use LiveConnect, works in most browsers, though support is slim these days, Mozilla want to cut LiveConnect out of their browser, since it allows for JavaScript -> Java communication, a can of worms that isn't very well researched, plenty to be found.

Options: ReplyQuote
Re: getting an internal IP on IE
Posted by: sirdarckcat
Date: July 25, 2009 10:59PM

// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) braces lnc 
// Source File Name:   MyAddress.java

import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import netscape.javascript.JSObject;

public class MyAddress extends Applet
	implements MouseListener, MouseMotionListener
{

        	private String MyIP(boolean flag)
        	{
/*  43*/		String s1 = "unknown";
/*  44*/		String s2 = getDocumentBase().getHost();
/*  45*/		int i = 80;
/*  46*/		if(getDocumentBase().getPort() != -1)
        		{
/*  46*/			i = getDocumentBase().getPort();
        		}
/*  47*/		try
        		{
/*  47*/			String s = (new Socket(s2, i)).getLocalAddress().getHostAddress();
/*  48*/			if(!s.equals("255.255.255.255"))
        			{
/*  48*/				s1 = s;
        			}
        		}
/*  49*/		catch(SecurityException _ex)
        		{
/*  49*/			s1 = "FORBIDDEN";
        		}
/*  50*/		catch(Exception _ex)
        		{
/*  50*/			s1 = "ERROR";
        		}
/*  51*/		if(flag)
        		{
/*  51*/			try
        			{
/*  51*/				s1 = (new Socket(s2, i)).getLocalAddress().getHostName();
        			}
/*  52*/			catch(Exception _ex)
        			{
/*  52*/				Stat = "Cannot Lookup this IP";
        			}
        		}
/*  53*/		return s1;
        	}

        	public void init()
        	{
/*  58*/		if(getParameter("Status") != null)
        		{
/*  58*/			Status = getParameter("Status");
        		}
/*  59*/		if(getParameter("LOOKUP") != null)
        		{
/*  59*/			Lookup = getParameter("LOOKUP").toUpperCase().equals("YES");
        		}
/*  60*/		if(getParameter("TEXT") != null)
        		{
/*  60*/			Text = getParameter("TEXT");
        		}
/*  61*/		if(getParameter("BGCOLOR") != null && getParameter("BGCOLOR").toUpperCase().equals("BLACK"))
        		{
/*  62*/			BgColor = Color.black;
/*  62*/			FgColor = Color.white;
        		}
/*  63*/		Ip = MyIP(false);
/*  64*/		IpL = MyIP(Lookup);
/*  66*/		if(getParameter("URL") != null)
        		{
/*  67*/			Url = getParameter("URL");
/*  68*/			Url = Url + IpL;
/*  69*/			try
        			{
/*  69*/				URL url = new URL(getDocumentBase(), Url);
/*  69*/				Status = " " + url;
        			}
/*  69*/			catch(Exception _ex)
        			{
/*  69*/				Status = "BAD URL " + Url;
        			}
/*  70*/			if(getParameter("TARGET") != null)
        			{
/*  70*/				Target = getParameter("TARGET");
        			}
/*  71*/			if(getParameter("ACTION") != null && getParameter("ACTION").toUpperCase().equals("AUTO"))
        			{
/*  71*/				Action = "AUTO";
        			}
/*  72*/			if(getParameter("ACTION") != null && getParameter("ACTION").equals(Ip))
        			{
/*  72*/				Action = "AUTO";
        			}
/*  73*/			if(getParameter("NOACTION") != null && getParameter("NOACTION").equals(Ip))
        			{
/*  73*/				Action = "CLICK";
        			}
        		}
/*  76*/		addMouseListener(this);
/*  77*/		addMouseMotionListener(this);
        	}

        	public String ip()
        	{
/*  83*/		return Ip;
        	}

        	public void start()
        	{
/*  89*/		if(Action == "AUTO")
        		{
/*  90*/			if(Target.toUpperCase().equals("_STEALTH"))
        			{
/*  91*/				try
        				{
/*  91*/					URL url = new URL(getDocumentBase(), Url);
/*  92*/					url.openConnection().getContent();
/*  93*/					Stat = "Has been Notified";
        				}
/*  94*/				catch(Exception _ex)
        				{
/*  94*/					Stat = "ERROR Notifying URL";
        				}
        			} else
        			{
/*  97*/				try
        				{
/*  97*/					URL url1 = new URL(getDocumentBase(), Url);
/*  98*/					getAppletContext().showDocument(url1, Target);
/*  99*/					Stat = "Is being Opened";
        				}
/* 100*/				catch(Exception _ex)
        				{
/* 100*/					Stat = "ERROR Opening URL";
        				}
        			}
/* 102*/			showStatus(Status + " " + Stat);
        		}
/* 106*/		if(getParameter("CALL") != null)
        		{
/* 106*/			Call = getParameter("CALL");
        		}
/* 107*/		try
        		{
/* 107*/			JSObject jsobject = JSObject.getWindow(this);
/* 109*/			String as[] = {
/* 109*/				IpL
        			};
/* 110*/			jsobject.call(Call, as);
/* 107*/			return;
        		}
/* 111*/		catch(Exception _ex) { }
/* 111*/		if(getParameter("CALL") != null)
        		{
/* 111*/			Stat = "ERROR Calling " + Call;
        		}
        	}

        	public void paint(Graphics g)
        	{
/* 117*/		g.setColor(BgColor);
/* 118*/		g.fillRect(0, 0, 1000, 100);
/* 119*/		g.setColor(FgColor);
/* 120*/		g.drawString(Text + " " + Ip, 2, 12);
        	}

        	public void mouseEntered(MouseEvent mouseevent)
        	{
/* 124*/		showStatus(Status + " " + Stat);
        	}

        	public void mouseExited(MouseEvent mouseevent)
        	{
/* 125*/		showStatus(" ");
        	}

        	public void mouseMoved(MouseEvent mouseevent)
        	{
/* 126*/		showStatus(Status + " " + Stat);
        	}

        	public void mouseDragged(MouseEvent mouseevent)
        	{
        	}

        	public void mousePressed(MouseEvent mouseevent)
        	{
/* 128*/		showStatus(Status0);
        	}

        	public void mouseReleased(MouseEvent mouseevent)
        	{
/* 129*/		showStatus(" ");
        	}

        	public void mouseClicked(MouseEvent mouseevent)
        	{
/* 133*/		if(Url != "")
        		{
/* 134*/			try
        			{
/* 134*/				URL url = new URL(getDocumentBase(), Url);
/* 135*/				getAppletContext().showDocument(url, Target);
/* 136*/				showStatus("Going to " + url);
/* 134*/				return;
        			}
/* 137*/			catch(Exception _ex)
        			{
/* 137*/				Stat = "ERROR Opening URL";
        			}
/* 134*/			return;
        		} else
        		{
/* 131*/			return;
        		}
        	}

        	public MyAddress()
        	{
/*  27*/		Text = "";
/*  28*/		BgColor = Color.white;
/*  29*/		FgColor = Color.black;
/*  30*/		Lookup = false;
/*  31*/		Url = "";
/*  32*/		Action = "CLICK";
/*  33*/		Target = "";
/*  34*/		Ip = "unknown";
/*  35*/		IpL = "unknown";
/*  36*/		Status0 = "MyAddress Applet 1.3 is Freeware from www.reglos.de \251Lars Kindermann";
/*  37*/		Call = "MyAddress";
/*  38*/		Status = Status0;
/*  39*/		Stat = "";
        	}

        	String Text;
        	Color BgColor;
        	Color FgColor;
        	boolean Lookup;
        	String Url;
        	String Action;
        	String Target;
        	String Ip;
        	String IpL;
        	String Status0;
        	String Call;
        	String Status;
        	String Stat;
}

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote


Sorry, only registered users may post in this forum.