Results 1 to 5 of 5
  1. #1
    walkineagle is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default Is There Anything In The Router..

    Is there anything in the router that doesn't change, and is unique to everyone/most people that java can read? I'm using an authentication system and I would like to use something like this. I was using internal IP but it changes to much. Thanks :)

    EDIT: or even on the computer.
    Last edited by walkineagle; 07-23-2011 at 07:43 AM.

  2. #2
    yellowledbet is offline Senior Member
    Join Date
    Feb 2011
    Location
    Georgia, USA
    Posts
    122
    Rep Power
    0

    Default

    MAC Address is the only thing that comes to mind unless you set up static IPs. However, MAC Address spoofing will most likely make this a less than secure Authentication system.

  3. #3
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Unless you move into advanced networking, there is very little that doesn't change. MAC Addresses don't change, but can be spoofed. If you set up static IP's that could help, but depending on the configuration someone could simply change that too. Why are you trying to make a security system based off of a router's set up?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  4. #4
    walkineagle is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default

    Because, it's easy to call and read, and I can't think of anything else in the users computer that wouldn't change and is unique and java can call (preferably in number format)
    But I did post this: "EDIT: or even on the computer. "

    EDIT: Okay, I did
    Java Code:
                InetAddress []addresses = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
    then I can do addresses[number], but each number is different, how do I know which one to use?
    Last edited by walkineagle; 07-24-2011 at 12:12 AM.

  5. #5
    walkineagle is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default

    Java Code:
                            else if(s1.equalsIgnoreCase(".get")){
                            try{
                  			  String desktopPath = System.getProperty("user.home") + "/Desktop";
                			  File f;
                			  f=new File(desktopPath.replace("\\", "/")+"/get.txt");
                			  if(!f.exists()){
                			  f.createNewFile();
                			  }
                		          InetAddress []addresses = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
                				  Writer output = null;
                				  String text1 = String.valueOf(addresses[1]).substring(String.valueOf(addresses[1]).indexOf("/")+1)+String.valueOf(addresses[2]).substring(String.valueOf(addresses[2]).indexOf("/")+1);
                				  String text2 = text1.replaceAll(":", "");
                				  String text3 = text2.replaceAll("%", "");
                				  String text = text3;
                				  File file = new File(desktopPath.replace("\\", "/")+"/get.txt");
                				  output = new BufferedWriter(new FileWriter(file));
                				  output.write(text);
                				  output.close();
                            }catch(Exception e){
                            	System.out.println("Error");
                            }
                            }
    Hey guys, could you please review that and tell me if it looks fairly safe (I could also remove the letters to make it even more obvious it's not using the MAC address, if it is)?
    My authentication works by the user typing in .get, a text file being created on his desktop, he tells me everything in the text file, then I add it to the authentication (which I already have 100% worked out, as before I was using internal IP).
    Though I may later change it to when he types .get it sends it to a MySQL database, so he never sees the number anyway.
    Last edited by walkineagle; 07-24-2011 at 01:36 AM.

Similar Threads

  1. Impossible or not? restart router through java
    By Questionmark in forum Advanced Java
    Replies: 5
    Last Post: 08-07-2010, 01:22 PM
  2. Replies: 7
    Last Post: 05-02-2010, 11:35 PM
  3. Replies: 1
    Last Post: 01-17-2010, 04:29 PM
  4. Replies: 7
    Last Post: 10-21-2009, 05:24 AM
  5. router working?
    By priya deshpande in forum Networking
    Replies: 0
    Last Post: 10-09-2009, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •