andreaji
    • 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
    • Invite by email
      Invitee

      This note has no invitees

    • 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
    • Note Insights New
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
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
  • Invite by email
    Invitee

    This note has no invitees

  • 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: MrRobot, netdiscover, nmap, dirb --- # 信息收集 任何渗透测试的第一步都是**信息收集(Intelligence Gathering)**。这包括[Footprinting](http://www.infosecwriters.com/text_resources/pdf/Footprinting.pdf)和[Fingerprinting](https://en.wikipedia.org/wiki/TCP/IP_stack_fingerprinting)主机、服务器等。如果您想了解有关正确程序和步骤的更多信息,那么我建议您阅读 [PTES 技术指南](http://www.pentest-standard.org/index.php/Main_Page)。 首先使用 `netdiscover` 扫描目标网络,获取目标 IP 地址。 由于 Mr.Robot 虚拟机使用 [Bridged Adapter](https://www.virtualbox.org/manual/ch06.html#network_bridged)被托管在我们的 PC 上,所以在本地网络上扫描: ```shell kali@kali $ sudo netdiscover -i eth0 -r 192.168.8.0/24 ``` 很快,扫描结果就出来了: ```shell Currently scanning: Finished! | Screen View: Unique Hosts 7 Captured ARP Req/Rep packets, from 3 hosts. Total size: 294 _____________________________________________________________________________ IP At MAC Address Count Len MAC Vendor / Hostname ----------------------------------------------------------------------------- 192.168.8.1 94:83:c4:2a:ec:6b 4 168 GL Technologies (Hong Kong) Limited 192.168.8.129 08:00:27:85:20:ff 1 42 PCS Systemtechnik GmbH 192.168.8.248 54:8d:5a:d0:76:a9 2 84 Intel Corporate ``` 从扫描结果可以看到 192.168.8.129 是我们的目标,然后就可以进一步用 nmap 命令扫描它,看看它开启了哪些端口,并探测它当前运行服务: ```shell kali@kali $ nmap -p- 192.168.8.158 ``` > nmap 默认只扫描 0--1000 号端口,设置 -p- 选项可以让 nmap 扫描全部的 65535 个端口。 > > 也有人使用以下选项获得操作系统相关信息以及更详细的服务信息 > ``` > sudo nmap -sS -O -A -n -T4 192.168.8.158 > ``` > 详情参考 [nmap 手册](https://nmap.org/book/man-briefoptions.html) 扫描结果如下: ```shell Starting Nmap 7.93 ( https://nmap.org ) at 2023-05-05 12:15 HKT Nmap scan report for 192.168.8.129 Host is up (0.00046s latency). Not shown: 65532 filtered tcp ports (no-response) PORT STATE SERVICE 22/tcp closed ssh 80/tcp open http 443/tcp open https ``` 可以看到端口 22、80 和 443 是打开的,运行的是 HTTP 服务 既然知道了这是一个 HTTP 服务器,就运行 nikto 来扫描任何可能的“漏洞或错误配置” ```shell $ nikto -C all -h 192.168.8.158 ``` ```shell - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 192.168.8.158 + Target Hostname: 192.168.8.158 + Target Port: 80 + Start Time: 2023-05-05 08:41:53 (GMT-4) --------------------------------------------------------------------------- + Server: Apache + /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/ + /VVEDDL3X.de: Retrieved x-powered-by header: PHP/5.5.29. + /index: Uncommon header 'tcn' found, with contents: list. + /index: Apache mod_negotiation is enabled with MultiViews, which allows attackers to easily brute force file names. The following alternatives for 'index' were found: index.html, index.php. See: http://www.wisec.it/sectou.php?id=4698ebdc59d15,https://exchange.xforce.ibmcloud.com/vulnerabilities/8275 + /admin/: This might be interesting. + /image/: Drupal Link header found with value: <http://192.168.8.158/?p=23>; rel=shortlink. See: https://www.drupal.org/ + /wp-links-opml.php: This WordPress script reveals the installed version. + /license.txt: License file found may identify site software. + /admin/index.html: Admin login page/section found. + /wp-login/: Cookie wordpress_test_cookie created without the httponly flag. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies + /wp-login/: Admin login page/section found. + /wordpress/: A Wordpress installation was found. + /wp-admin/wp-login.php: Wordpress login found. + /wordpress/wp-admin/wp-login.php: Wordpress login found. + /blog/wp-login.php: Wordpress login found. + /wp-login.php: Wordpress login found. + /wordpress/wp-login.php: Wordpress login found. + /#wp-config.php#: #wp-config.php# file found. This file contains the credentials. + 26640 requests: 0 error(s) and 18 item(s) reported on remote host + End Time: 2023-05-05 08:57:05 (GMT-4) (912 seconds) --------------------------------------------------------------------------- + 1 host(s) tested ``` 看不懂?输入到 Chat GPT,生成的建议如下: 1. /: X-Content-Type-Options Header Not Set 建议:应该在Web服务器的响应头中添加X-Content-Type-Options: nosniff,以防止浏览器错误地解析未知类型的文件,从而导致跨站脚本攻击(XSS)等问题。 2. /VVEDDL3X.de: Retrieved x-powered-by header: PHP/5.5.29. 建议:应该尽量减少或删除Web服务器的版本信息和框架信息,以降低攻击者对系统的攻击风险。 3. /index: Uncommon Header 'tcn' Found 建议:应该检查tcn头是否来自于代理或负载均衡设备,或者是否是应用程序的特定设置。如果是应用程序的特定设置,应该检查是否存在安全问题,并尝试禁用或删除该设置。 4. /index: Apache mod_negotiation Enabled with MultiViews 建议:如果不需要使用MultiViews功能,应该禁用Apache mod_negotiation模块,并禁用MultiViews功能,以避免攻击者使用文件名枚举攻击来探测Web服务器上的敏感文件。 5. /admin/ 、/wp-login.php 、/blog/wp-login.php 、/wordpress/wp-admin/wp-login.php 、/wp-admin/wp-login.php 、/wordpress/wp-admin/wp-login.php 、/wordpress/wp-login.php: 建议:应该尝试使用常见的用户名和密码来尝试登录管理页面,如果登录成功,应该进一步检查管理页面是否存在其他安全漏洞,例如跨站脚本(XSS)或SQL注入漏洞等。 6. /image/: Drupal Link header found with value: <http://192.168.8.158/?p=23>; rel=shortlink. 建议:应该进一步检查网站是否使用 Drupal,并检查是否存在已知的 Drupal 漏洞。 7. /wp-login/: WordPress Script Reveals the Installed Version 建议:应该尝试利用WordPress版本信息来查找已知的漏洞,例如已知的WordPress插件或主题漏洞。 8. /license.txt: License File Found 建议:应该尝试查找有关Web应用程序或 Web 服务器的版本信息,并查找已知的漏洞或安全问题。 9. /wp-login/: Cookie Wordpress_test_cookie Created without the Httponly Flag 建议:应该在 WordPress 登录页面的 wordpress_test_cookie cookie 中添加 HttpOnly 标志,以防止 XSS 攻击者窃取 cookie 。 10. /#wp-config.php#: #wp-config.php# File Found 建议:应该尝试查看wp-config.php文件中的敏感信息,例如数据库凭据等。如果找到了这些信息,应该尽快更改这些凭据并确保它们不再可用。 最后再用 dirb 命令扫描下 http 服务 ```shell $ dirb http://192.168.8.158 ``` 扫描用时1个多小时,在扫描结果中看到如下文件,可以尝试访问看看 ```shell + http://192.168.8.158/sitemap (CODE:200|SIZE:0) + http://192.168.8.158/sitemap.xml (CODE:200|SIZE:0) + http://192.168.8.158/robots (CODE:200|SIZE:41) + http://192.168.8.158/robots.txt (CODE:200|SIZE:41) ```

    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