stwater20
    • 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
    # Linux 資安 如果喜歡我的文章,請在下面給予我掌聲。 ## Linux O.S./Application 弱點利用 * 遠端服務弱點利用 * 遠端服務可存取的port/Application/Service/Daemon弱點 * 本地端服務提權 * Kernel * ShellShock * Dirty Cow * SUID LES 工具旨在幫助檢測給定 Linux 內核/基於 Linux 的機器的安全缺陷 https://github.com/mzet-/linux-exploit-suggester ## Metasploitable2 虛擬系統是一個特別製作的ubuntu,蘊含多個Linux/Web漏洞攻擊 ### IRC Server Port 7194 Exploit 1. Unreal IRCD 3.2.81.1 下載檔案中的惡意後門程序 2. 基於時間的命令(ping)與檢查回應所需的時間來檢查IRC服務器是否重新啟動 3. Command = exploit/unix/irc/unreal_ircd_3281_backdoor ## 常見弱點與弱點利用 * SSH Service Info * Metasploit SSH Exploits * auxiliary/scanner/ssh/ssh_login * auxiliary/scanner/ssh_login_pubkey * World-Writable Files * World-Executable Files * MAC&RBAC * SELinux * 2003 NSA & SCC ## Sudo Configuration * 用來賦予使用者管理者的權限 ## Access Control Models * DAC (Discretionary Access Control) * Linux 預設的存取模式,允許存取控制由相應的資料擁所有者進行設定。資料擁有者可以完全控制他們創建的文件或檔案。 * MAC (Mandatory Access Control) * RBAC (Role-Based Access Control) ## Chroot 通過利用某些應用程式中內建的chroot功能或使用包含可編譯到Linux中的chroot功能,可以部分減輕系統保護的工作量。 包含Change與root即將將使用者切換至特定目錄,並將該目錄設定為使用者root目錄,隔離應用程式與系統。 * Chw00t: Breaking unices' chroot ## 權限提升 許多 Linux Kernel exploit * https://github.com/SecWiki/linux-kernel-exploits ### SUID 是賦予文件檔案的一種權限 <code> find / -user root -perm -4000 -print 2>/dev/null </code> * 舊版本的nmap (2.02 to 5.21) 帶有交互模式,允許用戶執行shell * exploit/unix/local/setuid_nmap * Vim * 執行shell * <code>vim.tiny /etc/shadow</code> ## 權限提升 作業系統版本 * cat /etc/issue * cat /etc/*-release * cat /etc/lsb-release #debian based ## Bash Linux Privilege Escalation * Applications & services * ps aux * ps -ef * top * cat /etc/services * 已安裝/版本 * ls -alh /usr/bin/ * ls -alh /sbin/ * dpkg -l * rpm -qa * ls -alh /var/cache/apt/archives * ls -alh /var/cache/yum * Jobs/scheduled * crontab -l * ls -alh /var/spool/cron * ls -al /etc | grep cron * ls -al /etc/cron* * cat /etc/at.allow * cat /etc/at.deny * NIC * /sbin/ifconfig -a * cat /etc/network/interfaces * cat /etc/sysconfig/network * 網路相關設定 * cat /etc/resolv.conf * cat /etc/sysconfig/network * cat /etc/networks * iptables * hostname * Logged in * id * who * w * last * Private-key info * cat ~/.ssh/authorized_keys * file-systens mounted * Mount ## Lab : Linux Exploit * Exploit * vsftp * cve:2008-0166 * Tomcat * unreal_ircd_3291_backdoor * Tools: Kali ## Kernel bug Exploit * Dirty Cow, CVE-2016-5195 " A race was found in the way the Linux Kernel's memory subsystem handled the copy...." ## Linux 安全 基本原則 * 最小權限原則 * 確保套件的更新 * 善用本機防火牆,只開放需要的ports Hardeninh Security Tips * https://www.tecmint.com/linux-server-hardening-security-tips

    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