send
Grupo de Telegram
play_arrow
Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.

[Java] LocateIP 0.1

  • 0 Respuestas
  • 1044 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado BigBear

  • *
  • Underc0der
  • Mensajes: 543
  • Actividad:
    0%
  • Reputación 3
    • Ver Perfil
« en: Enero 12, 2013, 11:42:49 pm »
Un simple programa para buscar la localizacion de una IP.

Código: Java
  1. //LocateIP 0.1
  2. //Coded By Doddy H
  3.  
  4. import java.util.Scanner;
  5. import java.io.*;
  6. import java.net.*;
  7.  
  8. import java.util.regex.Matcher;
  9. import java.util.regex.Pattern;
  10.  
  11. public class Main {
  12.  
  13.     public static void main(You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login[] args) throws You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login {
  14.  
  15.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login ip;
  16.         Scanner host = new Scanner(You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.in);
  17.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("\n\n-- == LocateIP 0.1 == --\n\n");
  18.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] IP : ");
  19.         ip = host.nextLine();
  20.  
  21.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login code;
  22.  
  23.         code = toma("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=" + ip);
  24.  
  25.         Pattern uno = null;
  26.         Matcher dos = null;
  27.  
  28.         uno = Pattern.compile("City</td><td align=(.*?)><b>(.*?)</b></td>");
  29.         dos = uno.matcher(code);
  30.  
  31.         if (!dos.find()) {
  32.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] City : Not Found");
  33.         } else {
  34.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] City : " + dos.group(2));
  35.         }
  36.  
  37.         uno = Pattern.compile("Country</td><td align=(.*?)><b>(.*?)</b></td>");
  38.         dos = uno.matcher(code);
  39.  
  40.         if (!dos.find()) {
  41.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] Country : Not Found");
  42.         } else {
  43.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] Country : " + dos.group(2));
  44.         }
  45.  
  46.         uno = Pattern.compile("State or Region</td><td align=(.*?)><b>(.*?)</b></td>");
  47.         dos = uno.matcher(code);
  48.  
  49.         if (!dos.find()) {
  50.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] State or Region : Not Found");
  51.         } else {
  52.             You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("[+] State or Region : " + dos.group(2));
  53.         }
  54.  
  55. //code = toma("http://www.ip-adress.com/reverse_ip/178.33.230.100");
  56.  
  57. //uno = Pattern.compile("/whois/(.*?)\">Whois");
  58. //dos = uno.matcher(code);
  59.  
  60. //while(dos.find()) {
  61. //System.out.println("[+] DNS : "+dos.group(1));
  62. //}
  63.  
  64.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.out.println("\n\n-- == Coded By Doddy H == --");
  65.  
  66.     }
  67.  
  68.     private static You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login toma(You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login urla) throws You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login {
  69.  
  70.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login re;
  71.  
  72.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login conte = new You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login(40);
  73.  
  74.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login url = new You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login(urla);
  75.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login hc = url.openConnection();
  76.         hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  77.  
  78.         You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login nave = new You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login(
  79.                 new You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login(hc.getInputStream()));
  80.  
  81.         while ((re = nave.readLine()) != null) {
  82.             conte.append(re);
  83.         }
  84.  
  85.         nave.close();
  86.  
  87.         return conte.toString();
  88.  
  89.     }
  90. }
  91.  
  92. // The End ?
  93.  

 

¿Te gustó el post? COMPARTILO!



[Video Curso] Iniciacion a Java por DesarrolloWeb y EscuelaIT Mayo 2014

Iniciado por graphixx

Respuestas: 3
Vistas: 1394
Último mensaje Febrero 23, 2015, 10:13:28 am
por Hu3c0
Como compilar programas Java en la consola de comandos de Windows

Iniciado por tar3kw0rm3d

Respuestas: 2
Vistas: 2096
Último mensaje Junio 04, 2013, 02:55:07 pm
por tar3kw0rm3d
Java Extremo [Video Cursos Completos] [Español] [ISO] 2009

Iniciado por graphixx

Respuestas: 9
Vistas: 4161
Último mensaje Diciembre 04, 2017, 02:36:34 am
por graphixx
[LIBRO] Programación avanzada en Java - Sonia Jaramillo Valbuena

Iniciado por graphixx

Respuestas: 1
Vistas: 2320
Último mensaje Noviembre 07, 2017, 12:34:40 pm
por K0m0dr3x
Tutorial: Traduccion de aplicaciones JAVA - Moviles [By :: SmartGenius :: ]

Iniciado por ProcessKill

Respuestas: 0
Vistas: 1453
Último mensaje Febrero 24, 2010, 04:26:07 pm
por ProcessKill