<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Crypto on PseudorandomDog&#39;s Blog</title>
    <link>https://binarydog.top/tags/crypto/</link>
    <description>Recent content in Crypto on PseudorandomDog&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Sun, 10 Nov 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://binarydog.top/tags/crypto/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>WebGoat笔记之二：Cryptographic Failures</title>
      <link>https://binarydog.top/posts/webgoat/webgoat-a2-cryptographic-failures/</link>
      <pubDate>Sun, 10 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://binarydog.top/posts/webgoat/webgoat-a2-cryptographic-failures/</guid>
      <description>&lt;h2 class=&#34;heading&#34; id=&#34;crypto-basics&#34;&gt;&#xA;  Crypto Basics&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#crypto-basics&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 class=&#34;heading&#34; id=&#34;实验一http-basic-auth&#34;&gt;&#xA;  实验一：HTTP Basic Auth&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#%e5%ae%9e%e9%aa%8c%e4%b8%80http-basic-auth&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;这种模式流行于 HTTP 的早期，密码和用户名只做了编码而未做加密&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Authorization: Basic d2ViZ29hdDoxMjM0NTY=&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;webgoat:passw0rd&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 class=&#34;heading&#34; id=&#34;实验二ibm-websphere-application-server-xor-encoding&#34;&gt;&#xA;  实验二：IBM WebSphere Application Server XOR encoding&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#%e5%ae%9e%e9%aa%8c%e4%ba%8cibm-websphere-application-server-xor-encoding&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;根据资料，XOR 的密钥始终是 _*n (长度和明文等长）&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;{xor}Oz4rPj0+LDovPiwsKDAtOw==&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;databasepassword&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 class=&#34;heading&#34; id=&#34;实验三哈希&#34;&gt;&#xA;  实验三：哈希&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#%e5%ae%9e%e9%aa%8c%e4%b8%89%e5%93%88%e5%b8%8c&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;第一个哈希&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;21232F297A57A5A743894A0E4A801FC3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;看长度是 MD5&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;hashcat -m 0 hash.txt /usr/share/wordlists/rockyou.txt&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;得 &lt;code&gt;admin&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;第二个哈希&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;2BB80D537B1DA3E38BD30361AA855686BDE0EACD7162FEF6A25FE97BF527A25B&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;看长度是 SHA256&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;hashcat -m 1400 hash.txt /usr/share/wordlists/rockyou.txt&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;得 &lt;code&gt;secret&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 class=&#34;heading&#34; id=&#34;实验四从-pem-文件提取-rsa-私钥并对-n-签名&#34;&gt;&#xA;  实验四：从 PEM 文件提取 RSA 私钥并对 n 签名&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#%e5%ae%9e%e9%aa%8c%e5%9b%9b%e4%bb%8e-pem-%e6%96%87%e4%bb%b6%e6%8f%90%e5%8f%96-rsa-%e7%a7%81%e9%92%a5%e5%b9%b6%e5%af%b9-n-%e7%ad%be%e5%90%8d&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;HTTPS 的基本流程：&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;客户端向服务端请求它的证书&lt;/li&gt;&#xA;&lt;li&gt;客户端依据本机安装的权威证书验证证书签名链，从而决定服务端是否可信&lt;/li&gt;&#xA;&lt;li&gt;客户端从证书读取服务端的公钥&lt;/li&gt;&#xA;&lt;li&gt;客户端生成一些用于对称加密密钥的随机值，用服务端的公钥加密并发送给服务端&lt;/li&gt;&#xA;&lt;li&gt;两边根据约定的算法同步产生对称加密密钥&lt;/li&gt;&#xA;&lt;li&gt;使用对称加密密钥加密 HTTP 报文进行通讯&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;签名三要素：数据、签名、证书&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
