Bueno esta vez traigo el recuperador de Your-Freedom un exquicito proxy, el cual puede hacer uso de VPN. Es uno de los proxys mas caros que he visto, pero su desempeño lo demuestra.

Y urgando entre su codigo he realizado este recuperador de user y pass.
Unos post mas y rebazamos la zona delphi :O

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yourfreedom;

/**
 *
 * @author adwind
 */
public class Base64 {

 
    private static final char[] intToBase64 = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
    private static final byte[] base64ToInt = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51};

    public static String weedJunk(String string) {
        int l = string.length();
        StringBuilder sb = new StringBuilder(l);

        for (int i = 0; i < l; i++) {
            char c = string.charAt(i);
            if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9')) || (c == '+') || (c == '/') || (c == '=')) {
                sb.append(c);
            }
        }
        return sb.toString();
    }

    public static String byteArrayToBase64(byte[] a) {
        return byteArrayToBase64(a, a.length);
    }

    public static String byteArrayToBase64(byte[] a, int aLen) {
        int numFullGroups = aLen / 3;
        int numBytesInPartialGroup = aLen - 3 * numFullGroups;
        int resultLen = 4 * ((aLen + 2) / 3);
        StringBuilder result = new StringBuilder(resultLen);

        int inCursor = 0;
        for (int i = 0; i < numFullGroups; i++) {
            int byte0 = a[(inCursor++)] & 0xFF;
            int byte1 = a[(inCursor++)] & 0xFF;
            int byte2 = a[(inCursor++)] & 0xFF;
            result.append(intToBase64[(byte0 >> 2)]);
            result.append(intToBase64[(byte0 << 4 & 0x3F | byte1 >> 4)]);
            result.append(intToBase64[(byte1 << 2 & 0x3F | byte2 >> 6)]);
            result.append(intToBase64[(byte2 & 0x3F)]);
        }

        if (numBytesInPartialGroup != 0) {
            int byte0 = a[(inCursor++)] & 0xFF;
            result.append(intToBase64[(byte0 >> 2)]);
            if (numBytesInPartialGroup == 1) {
                result.append(intToBase64[(byte0 << 4 & 0x3F)]);
                result.append("==");
            } else {
                int byte1 = a[(inCursor++)] & 0xFF;
                result.append(intToBase64[(byte0 << 4 & 0x3F | byte1 >> 4)]);
                result.append(intToBase64[(byte1 << 2 & 0x3F)]);
                result.append('=');
            }

        }

        return result.toString();
    }

    public static byte[] base64ToByteArray(String s)
            throws IllegalArgumentException {
        s = weedJunk(s);
        int sLen = s.length();
        int numGroups = sLen / 4;
        if (4 * numGroups != sLen) {
            throw new IllegalArgumentException("String length must be a multiple of four.");
        }
        int missingBytesInLastGroup = 0;
        int numFullGroups = numGroups;
        if (sLen != 0) {
            if (s.charAt(sLen - 1) == '=') {
                missingBytesInLastGroup++;
                numFullGroups--;
            }
            if (s.charAt(sLen - 2) == '=') {
                missingBytesInLastGroup++;
            }
        }
        byte[] result = new byte[3 * numGroups - missingBytesInLastGroup];

        int inCursor = 0;
        int outCursor = 0;
        for (int i = 0; i < numFullGroups; i++) {
            int ch0 = base64toInt(s.charAt(inCursor++));
            int ch1 = base64toInt(s.charAt(inCursor++));
            int ch2 = base64toInt(s.charAt(inCursor++));
            int ch3 = base64toInt(s.charAt(inCursor++));
            result[(outCursor++)] = ((byte) (ch0 << 2 | ch1 >> 4));
            result[(outCursor++)] = ((byte) (ch1 << 4 | ch2 >> 2));
            result[(outCursor++)] = ((byte) (ch2 << 6 | ch3));
        }

        if (missingBytesInLastGroup != 0) {
            int ch0 = base64toInt(s.charAt(inCursor++));
            int ch1 = base64toInt(s.charAt(inCursor++));
            result[(outCursor++)] = ((byte) (ch0 << 2 | ch1 >> 4));

            if (missingBytesInLastGroup == 1) {
                int ch2 = base64toInt(s.charAt(inCursor++));
                result[(outCursor++)] = ((byte) (ch1 << 4 | ch2 >> 2));
            }

        }

        return result;
    }

    public static int base64ToByteArray(String s, byte[] result) throws IllegalArgumentException {
        s = weedJunk(s);
        int sLen = s.length();
        int numGroups = sLen / 4;
        if (4 * numGroups != sLen) {
            throw new IllegalArgumentException("String length must be a multiple of four.");
        }
        int missingBytesInLastGroup = 0;
        int numFullGroups = numGroups;
        if (sLen != 0) {
            if (s.charAt(sLen - 1) == '=') {
                missingBytesInLastGroup++;
                numFullGroups--;
            }
            if (s.charAt(sLen - 2) == '=') {
                missingBytesInLastGroup++;
            }
        }
        if (result.length < 3 * numGroups - missingBytesInLastGroup) {
            throw new IllegalArgumentException("result array too small");
        }

        int inCursor = 0;
        int outCursor = 0;
        for (int i = 0; i < numFullGroups; i++) {
            int ch0 = base64toInt(s.charAt(inCursor++));
            int ch1 = base64toInt(s.charAt(inCursor++));
            int ch2 = base64toInt(s.charAt(inCursor++));
            int ch3 = base64toInt(s.charAt(inCursor++));
            result[(outCursor++)] = ((byte) (ch0 << 2 | ch1 >> 4));
            result[(outCursor++)] = ((byte) (ch1 << 4 | ch2 >> 2));
            result[(outCursor++)] = ((byte) (ch2 << 6 | ch3));
        }

        if (missingBytesInLastGroup != 0) {
            int ch0 = base64toInt(s.charAt(inCursor++));
            int ch1 = base64toInt(s.charAt(inCursor++));
            result[(outCursor++)] = ((byte) (ch0 << 2 | ch1 >> 4));

            if (missingBytesInLastGroup == 1) {
                int ch2 = base64toInt(s.charAt(inCursor++));
                result[(outCursor++)] = ((byte) (ch1 << 4 | ch2 >> 2));
            }

        }

        return outCursor;
    }

    private static int base64toInt(char c) throws IllegalArgumentException {
        int result = base64ToInt[c];
        if (result < 0) {
            throw new IllegalArgumentException(new StringBuilder().append("Illegal character ").append(c).toString());
        }
        return result;
    }
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yourfreedom;

import java.nio.charset.Charset;
import java.util.Random;

/**
 *
 * @author adwind
 */
public class CryptUtils {

    public static final Charset UTF_8 = Charset.forName("UTF-8");

    private static long seed(String seed) {
        long s = 0L;
        int l = seed.length();
        for (int i = 0; i < l; i++) {
            byte k = (byte) ((byte) (int) (s >>> 24) & 0x42);
            s ^= k;
            k = (byte) ((byte) (int) (s >>> 48) & 0xFFFFFF84);
            s ^= k;
            byte b = (byte) seed.charAt(i);
            s ^= b;
            s <<= 3;
        }
        return s;
    }

    private static void crypt(byte[] b, String seed) {
        Random r = new Random(seed(seed));
        byte[] c = new byte[b.length];
        r.nextBytes(c);
        for (int i = 0; i < b.length; i++) {
            int tmp35_33 = i;
            b[tmp35_33] = ((byte) (b[tmp35_33] ^ c[i]));
        }
    }

    static String decrypt(String seed, String s) {
        if (s == null) {
            return s;
        }

        if (s.charAt(0) != '~') {
            return s;
        }
        if (s.charAt(s.length() - 1) != '~') {
            return s;
        }

        byte[] b = Base64.base64ToByteArray(s);
        crypt(b, seed);
        String clear;

        clear = new String(b, UTF_8);

        return clear;
    }

    static String encrypt(String seed, String s) {
        if (s == null) {
            return s;
        }
        byte[] b = s.getBytes(UTF_8);

        crypt(b, seed);

        String b64 = Base64.byteArrayToBase64(b);
        StringBuilder sb = new StringBuilder(b64.length() + 2);
        sb.append('~');
        sb.append(b64);
        sb.append('~');
        return sb.toString();
    }
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yourfreedom;


public abstract class OsArchHelper
{
  public static final boolean windows;
  public static final boolean amd64;
  public static final boolean armv71;
  public static final boolean android;
  public static final boolean linux;
  public static final boolean macosx;
  public static final boolean windows_7;
  public static final boolean windows_8;
  public static final boolean windows_vista;
  public static final boolean windows_xp;
  public static final boolean window95;
  public static final boolean window98;
  public static final boolean window2000;
  public static final boolean windowMe;
  public static final boolean windowNT;

  static
  {
    String strOS = System.getProperty("os.name.override", System.getProperty("os.name"));
    windows = strOS.contains("Windows");
    windows_xp = strOS.contains("Windows XP");
    windows_vista = strOS.contains("Windows Vista");
    windows_7 = strOS.contains("Windows 7");
    windows_8 = strOS.contains("Windows 8");
    macosx = strOS.contains("Mac OS X");
    window95 = strOS.contains("Windows 95");
    window98 = strOS.contains("Windows 98");
    window2000 = strOS.contains("Windows 2000");
    windowMe = strOS.contains("Windows Me");
    windowNT = strOS.contains("Windows NT");
    String arch = System.getProperty("os.arch");
    amd64 = "amd64".equals(arch);
    armv71 = "armv71".equals(arch);
    String jrn = System.getProperty("java.runtime.name");
    if ((jrn != null) && (jrn.contains("Android"))) {
      linux = false;
      android = true;
    }
    else {
      linux = strOS.contains("Linux");
      android = false;
    }
  }
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yourfreedom;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

/**
 *
 * @author adwind
 */
public class YourFreedomAcountRecovery {

    private static String getHomeFolder() {
        if ((OsArchHelper.windows) && (!OsArchHelper.window95) && (!OsArchHelper.window98) && (!OsArchHelper.windowMe) && (!OsArchHelper.windowNT) && (!OsArchHelper.window2000) && (!OsArchHelper.windows_xp)) {
            return System.getenv("LOCALAPPDATA") + File.separator + "Your Freedom";
        }
        return System.getProperty("user.home");
    }

    private static File determineConfigFile() {
        return new File(getHomeFolder(), "ems.cfg");
    }

    public static String[] getAccount() {

        File configFile = determineConfigFile();
        String datos[] = new String[2];
        if (configFile.exists()) {
            try {
                BufferedReader br = new BufferedReader(new FileReader(configFile));
                String t;
                while ((t = br.readLine()) != null) {
                    if (t.contains("username")) {
                        datos[0] = t.substring(9);
                    }
                    if (t.contains("password")) {
                        String temporal = t.substring(9);
                        datos[1] = CryptUtils.decrypt("password", temporal);
                        return datos;
                    }
                }
            } catch (Exception ex) {
            }
            return new String[]{};

        } else {

            return new String[]{};
        }

    }

    public static void main(String[] args) {
        String[] datos = YourFreedomAcountRecovery.getAccount();
        if (datos.length != 0) {
            System.out.println("####Your-Freedom Account Recovery####");
            System.out.println("Username: " + datos[0]);
            System.out.println("Password: " + datos[1]);
        }
    }
}
Responder

Volver a “Fuentes”