【发布时间】:2013-10-08 18:11:31
【问题描述】:
我的工作任务是对应用程序进行逆向工程。
我已经多次将Charles Proxy 与其他应用程序一起使用,没有任何问题,并且还尝试过Fiddler。我一直能够监控提出的请求/响应。
但是我现在正在尝试的应用程序现在确实在Charles 或Fiddler 中显示任何活动。首先,我认为他们检查了证书并终止了连接,但应用程序正常运行,没有任何问题。
应用程序有什么方法可以避免代理设置或我错过了什么?
我一直在使用 apktool 和 dex2jar 并发现这种代码和平。可能不是 100% 正确,但它可以为您提供一些关于正在发生的事情的线索。
public final void a(int paramInt1, int paramInt2)
{
this.b = paramInt2;
InetSocketAddress localInetSocketAddress = new InetSocketAddress(InetAddress.getByName(this.a), this.b);
while (true)
{
try
{
SSLContext localSSLContext = SSLContext.getInstance("TLS");
X509TrustManager[] arrayOfX509TrustManager = new X509TrustManager[1];
arrayOfX509TrustManager[0] = new c(this);
localSSLContext.init(null, arrayOfX509TrustManager, new SecureRandom());
this.e = ((SSLSocket)localSSLContext.getSocketFactory().createSocket());
this.e.connect(localInetSocketAddress, paramInt1);
this.d.clear();
if (Arrays.asList(this.e.getSupportedProtocols()).contains("TLSv1.2"))
{
this.d.add("TLSv1.2");
String[] arrayOfString1 = (String[])this.d.toArray(new String[this.d.size()]);
SSLSocket localSSLSocket1 = this.e;
if (arrayOfString1.length > 0)
localSSLSocket1.setEnabledProtocols(arrayOfString1);
this.c.clear();
if (!Arrays.asList(this.e.getSupportedCipherSuites()).contains("TLS_RSA_WITH_AES_256_CBC_SHA"))
break label374;
this.c.add("TLS_RSA_WITH_AES_256_CBC_SHA");
String[] arrayOfString2 = (String[])this.c.toArray(new String[this.c.size()]);
SSLSocket localSSLSocket2 = this.e;
if (arrayOfString2.length > 0)
localSSLSocket2.setEnabledCipherSuites(arrayOfString2);
e.a().a(this.e.getLocalAddress().getAddress());
e.a().a(this.e.getLocalPort());
a(5000);
this.e.startHandshake();
a(0);
return;
}
}
catch (Exception localException)
{
throw new IOException(localException.toString());
}
if (Arrays.asList(this.e.getSupportedProtocols()).contains("TLSv1.1"))
{
this.d.add("TLSv1.1");
}
else if (Arrays.asList(this.e.getSupportedProtocols()).contains("TLSv1"))
{
this.d.add("TLSv1");
continue;
label374: if (Arrays.asList(this.e.getSupportedCipherSuites()).contains("TLS_RSA_WITH_AES_128_CBC_SHA"))
this.c.add("TLS_RSA_WITH_AES_128_CBC_SHA");
else if (Arrays.asList(this.e.getSupportedCipherSuites()).contains("SSL_RSA_WITH_3DES_EDE_CBC_SHA"))
this.c.add("SSL_RSA_WITH_3DES_EDE_CBC_SHA");
else if (Arrays.asList(this.e.getSupportedCipherSuites()).contains("DES-CBC3-SHA"))
this.c.add("DES-CBC3-SHA");
}
}
}
对 TLS 1.2 了解不多,但我知道它应该更健壮?但它可以避免代理吗?
我还使用Wireshark 转储了流量,该方法有效,但信息已加密,正如预期的那样,因此它没有多大用处。
任何帮助将不胜感激。
【问题讨论】:
-
您是否尝试过嗅探来自您设备的所有流量?话虽这么说,如果您真的想拦截来自 Android 应用程序的流量,那么您最好构建自己的 Android 发行版,其中包含用于捕获所需内容的钩子,并在该自定义构建下运行应用程序(无论是在真实设备,或者更容易在模拟器中)。
-
hm...是的,我想我可以自定义构建,一个比我希望的更复杂的解决方案,但如果没有其他工作...但仍然知道为什么我看不到流量在 Charles Proxy 还是 Fiddler?
标签: android ssl proxy reverse-engineering man-in-the-middle