<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>算法 on MoeJue&#39;s Blog</title>
    <link>https://en.moejue.cn/zh-hant/tags/%E7%AE%97%E6%B3%95/</link>
    <description>Recent content in 算法 on MoeJue&#39;s Blog</description>
    <generator>Hugo -- 0.151.2</generator>
    <language>zh-hant</language>
    <lastBuildDate>Wed, 23 Nov 2016 08:27:09 +0000</lastBuildDate>
    <atom:link href="https://en.moejue.cn/zh-hant/tags/%E7%AE%97%E6%B3%95/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>58同城的登錄（RSA演算法）</title>
      <link>https://en.moejue.cn/zh-hant/posts/16/</link>
      <pubDate>Wed, 23 Nov 2016 08:27:09 +0000</pubDate>
      <guid>https://en.moejue.cn/zh-hant/posts/16/</guid>
      <description>&lt;p&gt;58同城的登入（RSA演算法）&lt;/p&gt;
&lt;p&gt;這一次。又是一個精彩的登入演算法解析&lt;/p&gt;
&lt;p&gt;目標位址：
&lt;a href=&#34;https://passport.58.com/login&#34;&gt;https://passport.58.com/login&lt;/a&gt;?（58 同城）
用到的工具：
js 除錯工具（我這裡用的是改自某論壇的 js 除錯工具，相對智慧化了）
抓包工具（我這次就直接使用瀏覽器的 F12 了，搜尋關鍵字更方便）&lt;/p&gt;
&lt;p&gt;提示：由於這篇文章發表於 1 年前，年久失修，圖片內容已遺失！&lt;/p&gt;</description>
    </item>
    <item>
      <title>新浪微博動態 RSA 分析圖文 &#43; 登入</title>
      <link>https://en.moejue.cn/zh-hant/posts/13/</link>
      <pubDate>Wed, 12 Oct 2016 06:50:19 +0000</pubDate>
      <guid>https://en.moejue.cn/zh-hant/posts/13/</guid>
      <description>&lt;p&gt;新浪微博動態 RSA 分析&lt;/p&gt;
&lt;p&gt;一、用到的工具
1.ie 瀏覽器（9 以上的版本）
2.httpwatch （中英文都可以）
3.js 偵錯工具&lt;/p&gt;
&lt;p&gt;目標網站：&lt;a href=&#34;http://weibo.com/&#34;&gt;http://weibo.com&lt;/a&gt; (新浪微博)&lt;/p&gt;
&lt;p&gt;二、抓包
還是遵從我們上一次的抓包流程，養成良好的習慣，這裡就不多做說明。
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixqxrdj30m808p421.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixmpmdj30ja06r3z4.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixpef1j30m60azgn3.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixrm8wj30k008rdgm.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixw3l7j30m806eq5d.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ixyrvuj30m80fvtfm.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iy8lk3j30jb07uwf9.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iy9zgtj30kv089aan.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iycexlj30m807w0ve.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iymkxpj30m80fkq6d.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iysq5qj30et06bwev.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iyxgegj30m80a8gnz.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iz51cqj30gc08175d.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iz6tvrj30ip0fut9z.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2iz8pi3j30m807ewf0.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2izftdtj30ku05yjs4.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2izoqdrj30kh05cgm5.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2izr82ij30hh0e5400.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2izvdnzj30h403o74o.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2j02n8yj30m8030mye.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;三、分析抓包資料
1、確定我們的登入提交包&lt;/p&gt;
&lt;p&gt;2、靈活變通關鍵字的查找&lt;/p&gt;
&lt;p&gt;四、尋找關鍵字
1、可以在 HttpWatch 上搜尋關鍵字
也可以在 ie 的 F12 繼續尋找
2、尋找 pwencode 關鍵字&lt;/p&gt;
&lt;p&gt;五、js 偵錯
1、這裡和上次不同，我先把呼叫的程式碼複製出來先做簡單的改寫，因為複製出來的程式碼並不是 function（）函數，如同易語言中的子程式
（這裡描述可能有誤）
3個參數，我們知道 p 是密碼，那剩下兩個我們去開發人員工具中看一下&lt;/p&gt;
&lt;p&gt;六、具體看圖文分析
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2j0d0tpj30m80elwkm.jpg&#34;&gt;
&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2j05q0ej30jz0bx3zu.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;有什麼不對的地方還望指出&lt;/p&gt;</description>
    </item>
    <item>
      <title>中國電信登入RSA演算法&#43;分析圖文</title>
      <link>https://en.moejue.cn/zh-hant/posts/14/</link>
      <pubDate>Fri, 30 Sep 2016 01:29:10 +0000</pubDate>
      <guid>https://en.moejue.cn/zh-hant/posts/14/</guid>
      <description>&lt;p&gt;廢話不多說！&lt;/p&gt;
&lt;p&gt;一、用到的工具&lt;/p&gt;
&lt;p&gt;1.ie瀏覽器（9以上的版本）&lt;/p&gt;
&lt;p&gt;2.httpwatch （中英文都可以）&lt;/p&gt;
&lt;p&gt;3.js偵錯工具&lt;/p&gt;
&lt;p&gt;目標網站：&lt;a href=&#34;http://xz.189.cn/sso/LoginServlet&#34;&gt;http://xz.189.cn/sso/LoginServlet&lt;/a&gt; 電信189登入&lt;/p&gt;
&lt;p&gt;二、抓包：&lt;/p&gt;
&lt;p&gt;1.抓包前先清除網站的cookie和快取
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh27cuooyj30l90cv0u6.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh27cuooyj30l90cv0u6.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2.在頁面開啟前就開啟抓包工具(否則會抓不到加密的js)&lt;/p&gt;
&lt;p&gt;3.判斷哪一個才是我們的登入提交包
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh27p2sm7j30m80akdjt.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh27p2sm7j30m80akdjt.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;三、分析抓包資料：&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh282bkdxj30ls076t9g.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh282bkdxj30ls076t9g.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1.這裡就用到ie的F12開發人員工具&lt;/p&gt;
&lt;p&gt;2.查到我們密碼關鍵字 密碼 passWord
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh28mmahhj30m804iwfp.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh28mmahhj30m804iwfp.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3.繼續追蹤 加密所呼叫的函數 encryptedString
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh28uu87ij30ik087aaf.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh28uu87ij30ik087aaf.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4.encryptedString 這個函數的兩個參數 我們也要知道是什麼 繼續尋找key&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh29aoqekj30m803zq3w.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh29aoqekj30m803zq3w.jpg&#34;&gt;&lt;/a&gt;
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh29rurbtj30m80ccwi2.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh29rurbtj30m80ccwi2.jpg&#34;&gt;&lt;/a&gt;
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh29u07pgj30i50bx753.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh29u07pgj30i50bx753.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5.那我加密所需的參數就夠了，接下來就是偵錯了，這裡有人就會問 那參數不是有兩個嗎 另一個s呢 透過函數我們知道 s就是對密碼加密那的pwd 透過函數的呼叫if判斷可以知道pwd 就是我們的密碼passWord&lt;/p&gt;
&lt;p&gt;6.接下來複製呼叫函數先在開發人員工具中先偵錯一下 需要key，s兩個參數
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2a02ub9j30m60d440i.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2a02ub9j30m60d440i.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;7.ie中偵錯沒有問題 ，那接下來在js偵錯工具中偵錯一下&lt;/p&gt;
&lt;p&gt;8.複製3個RSA的機密js以及key 呼叫bodyRSA()這個函數 參數為密碼 我們發現 它是一個物件 沒有辦法直接呼叫 如果繼續呼叫就會導致工具掛掉
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh2a1pjyxj30fq06vaau.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqh2a1pjyxj30fq06vaau.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;9.這裡就是RSA的難點 需要進行改寫，否則我們的易語言也沒有辦法呼叫。&lt;/p&gt;
&lt;p&gt;10.將改寫完的函數和剛才一樣複製到偵錯工具中，還是呼叫bodyrsa（）這個函數
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2acq1dwj30m808utbb.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2acq1dwj30m808utbb.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;最後發現我們成功了
&lt;a href=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ai5ee1j30hy0dggms.jpg&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqh2ai5ee1j30hy0dggms.jpg&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;因為沒有電信手機號，沒辦法寫個完整的對cookie操作登入 期待下期！&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
