|
IEMI和QQ.db已打码处理
- import java.io.UnsupportedEncodingException;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.sql.Statement;
- import java.util.ArrayList;
- public class Test {
- public static final String IMEI = "**************";
- public static final String getTables = "SELECT tbl_name FROM sqlite_master WHERE type='table';";
- public static void main(String[] args) {
- ArrayList<String> tables = get_table();
- for (String table : tables) {
- if (table.startsWith("mr_friend_")) {
- QQcrack(table);
- }
- }
- }
- public static Connection get_con(String db) {
- Connection conn = null;
- try {
- Class.forName("org.sqlite.JDBC");
- conn = DriverManager.getConnection("jdbc:sqlite:" + db);
- } catch (SQLException | ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return conn;
- }
- public static void QQcrack(String table) {
- Connection conn = get_con("*********.db");
- try {
- Statement stat = conn.createStatement();
- ResultSet rs = stat.executeQuery("SELECT * FROM " + table + ";");
- while (rs.next()) {
- System.out.println(jiemi(rs.getBytes("senderuin")) + "->"
- + jiemi(rs.getBytes("frienduin")) + ":"
- + jiemi(rs.getBytes("msgdata")));
- }
- rs.close();
- conn.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static String jiemi(byte[] ms) throws UnsupportedEncodingException {
- byte[] tmp = ms.clone();
- for (int i = 0; i < ms.length; i++) {
- tmp[i] = (byte) (ms[i] ^ (int) IMEI.charAt(i % 15));
- }
- return (new String(tmp, "utf-8"));
- }
- public static ArrayList<String> get_table() {
- Connection conn = get_con("***********.db");
- ArrayList<String> tables = new ArrayList<String>();
- try {
- Statement stat = conn.createStatement();
- ResultSet rs = stat.executeQuery(getTables);
- while (rs.next()) {
- tables.add(rs.getString(1));
- }
- rs.close();
- conn.close();
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return tables;
- }
- }
复制代码
自己下载SQLite3的jar包,如果android程序,这部分可以自行去掉。
关键解密语句只有一句
- tmp[i] = (byte) (ms[i] ^ (int) IMEI.charAt(i % 15));
复制代码
关键难点就是得到手机QQ的聊天记录文件,IMEI根据手机型号还可以暴力破解。 |
|