Network - Wireshark decrypts SSL Traffic

2024-05-31 01:48

本文主要是介绍Network - Wireshark decrypts SSL Traffic,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Step one – set up an SSL-protected server to use as a testbed

To illustrate the process, we’re going to use OpenSSL to generate a certificate and act as a web server running HTTP over SSL (aka HTTPS) – it’s quite straightforward.

To begin with, we need to get ourselves a self-signed certificate that our HTTPS server can use. We can do this with a single command:

┌─[lab@core]─[/tmp/ssldemo]
└──╼ openssl req -x509 -nodes -newkey rsa:1024 -keyout testkey.pem -out testcert.pem
Generating a 1024 bit RSA private key
......................++++++
...............++++++
writing new private key to 'testkey.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:XX
State or Province Name (full name) [Some-State]:XX
Locality Name (eg, city) []:XX
Organization Name (eg, company) [Internet Widgits Pty Ltd]:XX
Organizational Unit Name (eg, section) []:XX
Common Name (e.g. server FQDN or YOUR name) []:XX
Email Address []:
┌─[lab@core]─[/tmp/ssldemo]
└──╼ ll
total 8.0K
-rw-r--r-- 1 lab lab 924 Oct 18 06:19 testcert.pem
-rw-r--r-- 1 lab lab 916 Oct 18 06:19 testkey.pem

OpenSSL will ask you for some input to populate your certificate with; once you’ve answered all the questions, the output of this command is two files, testkey.pem (containing a 1024 bit RSA private key) and testcert.pem (containing a self signed certificate). PEM (Privacy Enhanced Mail) format files are plaintext, and consist of a BASE64 encoded body with header and footer lines. You can look at the contents of your key and certificate files in more detail like this:

┌─[lab@core]─[/tmp/ssldemo]
└──╼ openssl rsa -in testkey.pem -text -noout
┌─[lab@core]─[/tmp/ssldemo]
└──╼ openssl x509 -in testcert.pem -text -noout

We need to perform one tiny tweak to the format of the private key file (Wireshark will use this later on, and it won’t work properly until we’ve done this):

┌─[lab@core]─[/tmp/ssldemo]
└──╼ openssl rsa -in testkey.pem -out testkey.pem
writing RSA key

Now we’re ready to fire up our HTTPS server:

┌─[lab@core]─[/tmp/ssldemo]
└──╼ openssl s_server -key testkey.pem -cert testcert.pem -WWW -cipher RC4-SHA -accept 443
Using default temp DH parameters
ACCEPT
bind: Permission denied0 items in the session cache0 client connects (SSL_connect())0 client renegotiates (SSL_connect())0 client connects that finished0 server accepts (SSL_accept())0 server renegotiates (SSL_accept())0 server accepts that finished0 session cache hits0 session cache misses0 session cache timeouts0 callback cache hits0 cache full overflows (128 allowed)

The -key and -cert parameters to the s_server command reference the files we’ve just created, and the -WWW parameter (this one is case sensitive) causes OpenSSL to act like a simple web server capable of retrieving files in the current directory (I created a simple test file called myfile.html for the purposes of the test).

The -cipher parameter tells the server to use a particular cipher suite – I’m using RC4-SHA because that’s what’s used when you go to https://www.google.com. The RC4-SHA cipher suite will use RSA keys for authentication and key exchange, 128-bit RC4 for encryption, and SHA1 for hashing.

Having got our server up and running, we can point a browser at https://myserver/myfile.html and retrieve our test file via SSL (you can ignore any warnings about the validity of the certificate). If you’ve got this working, we can move on to…

Step two – capture some traffic with Wireshark

Fire up Wireshark on the server machine, ideally with a capture filter like “tcp port 443” so that we don’t capture any unnecessary traffic. Once we’re capturing, point your browser (running on a different machine) at https://myserver/myfile.html and stop the capture once it’s complete.

Right-click on any of the captured frames and select “Follow TCP stream” – a window will pop up that’s largely full of SSL-protected gobbledegook.

configuring Wireshark for decryption

Close the TCP Stream window and select Preferences from Wireshark’s Edit menu. Expand the “Protocols” node in the tree on the left and scroll down to SSL (in newer versions of Wireshark, you can open the node and type SSL and it will take you there).

Once SSL is selected, there’s an option on the right to enter an “RSA keys list”. Enter something like this:

ssl decrypt

ssl decrypt


References

https://wirewatcher.wordpress.com/2010/07/20/decrypting-ssl-traffic-with-wireshark-and-ways-to-prevent-it/
http://support.citrix.com/article/CTX116557

这篇关于Network - Wireshark decrypts SSL Traffic的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1017222

相关文章

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]

python 在使用websocket 或者request可能会报这个错误,这是证书认证中的错误,如果不是对安全要求高的开发,可以使用下面的方式使request与websocket正常访问   在request中修改一个参数即可正常使用: textmod = {     "ID": "T214",      "Longitude": 123.6355038767646,      "Lati

安全科普:理解SSL(https)中的对称加密与非对称加密

今天刚好为站点的后台弄了下https,就来分享我了解的吧。 密码学最早可以追溯到古希腊罗马时代,那时的加密方法很简单:替换字母。 早期的密码学:   古希腊人用一种叫 Scytale 的工具加密。更快的工具是 transposition cipher—:只是把羊皮纸卷在一根圆木上,写下信息,羊皮纸展开后,这些信息就加密完成了。 虽然很容易被解密,但它确实是第一个在现实中应用加密的

驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接的解决方法

在连接数据库的时候出现了下面图面中的错误,尝试集中方法后终于解决了这个问题。 1.修改驱动程序版本 出现这种错误可能是因为你的驱动程序版本不兼容,我们可以尝试修改版本解决。而我们的驱动程序往往是以依赖的形式导入,因此可以在maven仓库查找你的数据库对应的驱动程序,选择一个数据库能够兼容的版本导入。 maven仓库官网:https://mvnrepository.com/ 2.在 VM opt

BookSim2 安装步骤教程 Network-on-Chips (NoCs) 片上网络模拟器 含视频

BookSim简介 BookSim2 一个用于Network-on-Chips (NoCs) 芯片上网络的周期精确模拟器。该模拟器的设计是为了实现网络组件的模拟灵活性和精确建模。  BookSim1 是一个通用的网络模拟器,并不专门针对片上环境。不支持在片上网络环境中提出的一些更先进的功能和拓扑结构。 背景 随着集成在单个芯片上的核心和模块数量的不断增加,片上网络正成为现代微处理器不可或缺

升级iOS7后利用rvictl和wireshark抓包失效?

最近把一台设备升级到iOS7后,利用rvictl和wireshark抓包发现抓不了,无意中发现在装有xcode5的机器上可以抓包,看来rvictl与xcode是绑定的,升级到最新的iOS7后,必须要装上最新的xcode5版本才能抓包。 使用rvictl有一个前提是要获取设备的UDID,看网上不少教程都是从xcode中获取UDID,步骤相当繁琐,快速获取UDID用命令行才是王道,果然不出所料,很快

论文《Tree Decomposed Graph Neural Network》笔记

【TDGNN】本文提出了一种树分解方法来解决不同层邻域之间的特征平滑问题,增加了网络层配置的灵活性。通过图扩散过程表征了多跳依赖性(multi-hop dependency),构建了TDGNN模型,该模型可以灵活地结合大感受场的信息,并利用多跳依赖性进行信息聚合。 本文发表在2021年CIKM会议上,作者学校:Vanderbilt University,引用量:59。 CIKM会议简介:全称C

Python中发邮件(明文/SSL/TLS三种方式)

#!/usr/bin/python# coding:utf-8 import smtplibfrom email.MIMEText import MIMETextfrom email.Utils import formatdatefrom email.Header import Headerimport sys#设置默认字符集为UTF8 不然有些时候转码会出问题default_en

Representation Learning on Network 网络表示学习笔记

Embedding Nodes Encoder-decoder ViewEncoding Methods 1 Factorization based2 Random Walk based3 Deep Learning based 网络表示学习(Representation Learning on Network),一般说的就是向量化(Embedding)技术,简单来说,就是

为什么配置Java环境后会出现SSL问题?

在配置Java 8环境后出现SSL证书问题,可能是由于Java 8中高版本禁用了一些旧版SSL/TLS协议,这些协议被认为存在安全漏洞。例如,Java 8从1.8.0_181版本开始禁用了SSLv3、TLSv1和TLSv1.1协议。如果您的应用程序或依赖的库试图使用这些已经被禁用的协议进行通信,就会出现SSL握手失败的问题。 为了解决这个问题,您可以采取以下步骤: 更新JDK配置文件:

雷池社区版自动SSL

正常安装雷池,并配置站点,暂时不配置ssl 不使用雷池自带的证书申请。 安装(acme.sh),使用域名验证方式生成证书 先安装git yum install git 或者 apt-get install git 安装完成后使用 git clone https://gitee.com/neilpang/acme.sh.git cd acme.sh ./acme.sh –install -m m