阅读目录(Content)

引言

[tcsl]天财商龙密码破解&pos站点登录和退出时间

pos站点登录和退出时间

1
SELECT * FROM "biz_ps" WHERE open_time >= '2020-05-19' AND operator_id ='5259200000000000129'

image-20230406142458441

fu主文件

使用打印出来的MD5值,进行解密https://www.cmd5.com/

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
26
27
28
29
30
31
32
import org.apache.commons.lang3.StringUtils;

public class fu {

public static void main(String[] args) {
System.out.println("1234567890");
System.out.println(encrypt("1234567890"));
// SmtwXtnZCOr6NA9kmAfXQSlz78c/sjAcPCQKYkc2qHv7b3hIuTykfQ==
System.out.println(fuck("SmtwXtnZCOr6NA9kmAfXQSlz78c/sjAcPCQKYkc2qHv7b3hIuTykfQ=="));
// password 数据库原始密码
String aa = DESUtil.decrypt(fuck("bQmdPd1p5TqodxYpwNdTXMqztI87/xCdwFTT58TccSv7b3hIuTykfQ=="),"tcslTcsltcsl");
System.out.printf("MD5:"+aa);

}
public static byte[] fuck(String password){
if (StringUtils.isBlank(password)) {
return null;
}
return Base64Utils.decode(password);
}

public static String encrypt(String password) {
if (StringUtils.isBlank(password)) {
return null;
}
String md5 = MD5Util.getMD5(password);
byte[] bs = DESUtil.encrypt(md5, "tcslTcsltcsl");
String base64 = Base64Utils.encode(bs);

return base64;
}
}

Base64Utils

1
2
3
4
5
6
7
8
9
10
11
//package cn.com.tcsl.framework.common.util;

import java.nio.charset.Charset;
import org.apache.commons.codec.binary.Base64;

public class Base64Utils
{
public static byte[] decode(String base64) { return Base64.decodeBase64(base64.getBytes(Charset.forName("UTF-8"))); }

public static String encode(byte[] bytes) { return new String(Base64.encodeBase64(bytes), Charset.forName("UTF-8")); }
}

DESUtil

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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//package cn.com.tcsl.framework.common.util;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;

public class DESUtil
{
public static byte[] encrypt(String source, String keyStr) {
try {
byte[] sourceBytes = source.getBytes("UTF-8");


Key key = getKey(keyStr);


Cipher cipher = Cipher.getInstance("DES");


cipher.init(1, key);


return cipher.doFinal(sourceBytes);
}
catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (NoSuchPaddingException e) {
throw new RuntimeException(e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} catch (InvalidKeyException e) {
throw new RuntimeException(e);
} catch (IllegalBlockSizeException e) {
throw new RuntimeException(e);
} catch (BadPaddingException e) {
throw new RuntimeException(e);
}
}






public static byte[] encrypt(String source) { return encrypt(source, null); }

public static String decrypt(byte[] source, String keyStr) {
try {
Key key = getKey(keyStr);


Cipher cipher = Cipher.getInstance("DES");


cipher.init(2, key);


byte[] dissect = cipher.doFinal(source);
return new String(dissect);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (NoSuchPaddingException e) {
throw new RuntimeException(e);
} catch (InvalidKeyException e) {
throw new RuntimeException(e);
} catch (IllegalBlockSizeException e) {
throw new RuntimeException(e);
} catch (BadPaddingException e) {
throw new RuntimeException(e);
}
}
public static String decrypt(byte[] source) { return decrypt(source, null); }

private static Key getKey(String keyStr) {
if (keyStr == null) {
return getKey();
}

try {
byte[] bs = Base64Utils.decode(keyStr);


KeySpec dks = new DESKeySpec(bs);


SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");


return keyFactory.generateSecret(dks);
} catch (InvalidKeyException e) {
throw new RuntimeException(e);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (InvalidKeySpecException e) {
throw new RuntimeException(e);
}
}






private static Key getKey() { return getKey("s7Oh75I+1ew="); }

public static void main(String[] args) throws Exception {
System.out.println(encrypt("yang哈哈tao"));
System.out.println(decrypt(encrypt("aabbc啊啊cdd")));
System.out.println(Base64Utils.encode(encrypt("hjc")));
System.out.println(decrypt(Base64Utils.decode(Base64Utils.encode(encrypt("hjc")))));
System.out.println("MD5加密后的编码:" + MD5Util.getMD5("hjc"));
System.out.println("MD5作为参数加密:" + Base64Utils.encode(encrypt(MD5Util.getMD5("hjc"))));
System.out.println("MD5作为参数解密:" + decrypt(Base64Utils.decode(Base64Utils.encode(encrypt(MD5Util.getMD5("hjc"))))));
}



}

MD5Util

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//package cn.com.tcsl.framework.common.util;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;

public class MD5Util
{
public static String getMD5(String data) {
if (StringUtils.isBlank(data)) {
return null;
}
return DigestUtils.md5Hex(data);
}

public static void main(String[] args) throws Exception { System.out.println(getMD5("yangtao")); }
}

输出效果

1
2
3
4
5
1234567890
SmtwXtnZCOr6NA9kmAfXQSlz78c/sjAcPCQKYkc2qHv7b3hIuTykfQ==
[B@3d494fbf
MD5:c6f057b86584942e415435ffb1fa93d4
Process finished with exit code 0