badcat1215
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
Windows nslookup 問題偵查 === :::success 摘要 Windows 中的 nslookup 解析到的 IP 為不正確 IP 最後發現似乎是路由器D-Link的BUG 手動去更改電腦的IP就可以搞定 ::: # <font color='blue'>問題描述</font> 遇到問題,環境為租屋處,沒有受到資安設備管理監控。 簡易架構如下: ![](https://i.imgur.com/ptk23pS.png) 房間中有兩台電腦,一台 Laptop 一台 PC,皆為 Windows Win10, 目前 Laptop Win10 的 nslookup 中,大部分的網域,都沒辦法正確被解析。 譬如 hackercat.org ithome.com.tw 會回應奇怪的 78.xx.xx.xx IP 跟 domain.name 網域, hackercat.org -> 78.47.226.171 Aliases: hackercat.org.domain.name ithome.com.tw -> 78.47.226.171 Aliases: ithome.com.tw.domain.name 不是這個網站真正的 IP,如下圖: 預設使用的 DNS Server 是 8.8.8.8, 有嘗試把 Server 設成 168.95.1.1,仍然得到一樣的結果。 (不止這兩個,試過很多個都是一樣的情形) ![](https://i.imgur.com/PpJwUlr.png) 但是 Laptop Win10 當中的虛擬機 Kali,使用 nslookup 卻正常: hackercat.org -> 35.213.167.241 ithome.com.tw -> 220.130.119.130 得到正常回應(**注意,這邊解出來的 IP,才是正確的 IP**) ![](https://i.imgur.com/v2OD7iU.png) 而 Laptop Win10 當中雖然 nslookup 解析有問題 可是瀏覽器上網正常,利用 Nmap 或是 ping 去解析來的 IP 也正常 譬如下圖: ![](https://i.imgur.com/EWimXXO.png) # <font color='blue'>嘗試方法</font> ## <font color='blue'>VPN</font> 如果啟用Laptop Win10 公司 VPN 的話,則 nslookup 可以正常使用解析正常IP。 ## <font color='blue'>更換DNS Server</font> 如同上面提過,將 Server 設為 8.8.8.8 或 168.95.1.1 或 1.1.1.1, 仍然都是回應一樣奇怪的錯誤結果,78.xx.xx.xx 的這組 IP。 ## <font color='blue'>hosts file</font> 已確認win10本機中的host檔案並未遭受到惡意修改。 ## <font color='blue'>DHCP重新取得 IP</font> ```bash= ipconfig /release ipconfig /renew ``` 完成後再使用 nslookup,仍然得到同樣結果 ## <font color='blue'>清除DNS Cache</font> 使用 ipconfig /flushdns 清楚 DNS cache 結果一樣 ![](https://i.imgur.com/r0Z9n3q.png) ## <font color='blue'>tracert</font> tracert 看似無異狀,沒有經過 78.xx.xx.xx 的節點 ![](https://i.imgur.com/KwnLvD9.png) ## <font color='blue'>wireshark錄封包</font> 側錄封包看看,似乎有點突破(?! 幾乎靜置的狀態,也是一直query一堆奇怪的domain 都是domain.name的網域 ![](https://i.imgur.com/wpCiv5b.png) VirusTotal看好像又沒問題 ![](https://i.imgur.com/upgHZmg.png) ## <font color='blue'>Who is hijacking my NXDOMAINs</font> 資安群組中的大神分享的網路文章 https://harigovind.org/articles/who-is-hijacking-my-nxdomains/ 這個文章的人遇到跟我很像的問題, domain都被解析到78.xx.xx.xx這個IP。 不存在的網域也會被解出來到這邊IP跟網域: ![](https://i.imgur.com/jrVKSbl.png) 所以看起來是路由器問題?路由器遭受到Poison攻擊? (這邊我還沒確認路由器,下一步我先測試PC Win10) ## <font color='blue'>PC Win10 確認</font> 上面提到懷疑是路由器被攻擊, 但房間中的Laptop跟PC是接到同一台Switch, 而Switch就是同一台路由器,但測試過後 PC Win10 的 nslookup 沒有問題: ![](https://i.imgur.com/qn0zwSu.png) 完全沒有道理啊!!!極度崩潰 ![](https://i.imgur.com/HiF1lo0.png) :::info 「非常簡單」的用netstat/Process Explorer/工作管理員。觀察了一下是否有明顯異常連線、異常的檔案在執行、或是CPU與網路流量異常。初步觀察沒有明顯異狀 ::: ## <font color='blue'>手動更改 Laptop Win10 的固定 IP</font> 大神同事建議,手動更改 IP看看(前面他有建議過DHCP重新取得,不過DHCP重抓無效)。 手動更改 IP,不使用 DHCP: ![](https://i.imgur.com/IlLpWIO.png) <font color='red'>結果就成功啦!!!!</font> ![](https://i.imgur.com/MSuqR2d.png) 真心搞不懂原因,不過解決了很開心 ## <font color='blue'>確定路由器設定</font> 回頭再看看上面提到過的那篇文章 https://harigovind.org/articles/who-is-hijacking-my-nxdomains/ 這篇文章的作者跟我一樣是使用D-Link 連線到路由器確認,連到192.168.100.1(也就是我switch出去的Gatway) 產品是D-Link的DIR-612 ![](https://i.imgur.com/bzsEbWT.png) :::info 這邊我稍微備註一下 最開頭的架構圖當中的Switch是我自己的ZYXEL的L2 Switch 這個D-Link DIR-612是在架構 ::: 按照他文章的說法,是D-Link的問題(dlinkrouter或dlink), 只要把DHCP設定當中的domain.name修改成類似my-home-network(無效的TLD即可) ![](https://i.imgur.com/eCsknVE.png) 不過我自己後來是沒有去修改我的D-Link設定,因為手動設定固定IP後就解決問題了。 希望這篇文章可以幫助到有遇到同樣問題的人。 :::danger 最後稍微提一下,不過也不完全排除, 說不定內網真的有人針對我的IP進行Poison攻擊, 我也都不認識租屋處的其他室友。 ![](https://i.imgur.com/2mdjYlO.png) :::

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully