---
# System prepended metadata

title: HackMD Dark Theme
tags: [theme]

---

---
title: HackMD Dark Theme
tags: theme
description: Use `{%hackmd theme-dark %}` syntax to include this theme.
---

<style>

html, body, .ui-content {
    background-color: #333;
    color: #ddd;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: #ddd;
}

.markdown-body h1,
.markdown-body h2 {
    border-bottom-color: #ffffff69;
}

.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
    color: #fff;
}

.markdown-body img {
    background-color: transparent;
}

.ui-toc-dropdown .nav>.active:focus>a, .ui-toc-dropdown .nav>.active:hover>a, .ui-toc-dropdown .nav>.active>a {
    color: white;
    border-left: 2px solid white;
}

.expand-toggle:hover, 
.expand-toggle:focus, 
.back-to-top:hover, 
.back-to-top:focus, 
.go-to-bottom:hover, 
.go-to-bottom:focus {
    color: white;
}


.ui-toc-dropdown {
    background-color: #333;
}

.ui-toc-label.btn {
    background-color: #191919;
    color: white;
}

.ui-toc-dropdown .nav>li>a:focus, 
.ui-toc-dropdown .nav>li>a:hover {
    color: white;
    border-left: 1px solid white;
}

.markdown-body blockquote {
    color: #bcbcbc;
}

.markdown-body table tr {
    background-color: #5f5f5f;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #4f4f4f;
}

.markdown-body code,
.markdown-body tt {
    color: #eee;
    background-color: rgba(230, 230, 230, 0.36);
}

a,
.open-files-container li.selected a {
    color: #5EB7E0;
}

</style>





# Linux Hacking Common Tools

- For Debian-like Linux versions (Debian, Ubuntu, Kali, etc.)
- Exploit: tool, technique, process that takes advantage of a vulnerability go gain access or information.
- 

## Important topics and their tools

| Topic                            | Description                                                  | Tools   | Basic Commands                |
| -------------------------------- | ------------------------------------------------------------ | ------- | ----------------------------- |
| Binary  Reversing,               | Extracting the knowledge of design and implementation information from anything we use in reality. Reversing a software is a practice of analyzing the compiled code to examine its internals when we don’t have the source code and utilizing the knowledge we make from it in a beneficial manner. | radare2 |                               |
| Network Mapping / Host Detection |                                                              | nmap    | - sS<br/>- sP<br />- sT<br /> |



## Detailed  common commands

- `apt` **VS** `apt-get` : `apt-get` may be considered as lower-level and "back-end", and support other APT-based tools. `apt` is designed for end-users (human) and its output may be changed between versions.

- `source` command is used to read / execute a file
    - `./script` runs the script as an executable file, launching a **new shell** to run it
    - `source script` reads and executes commands from filename in the **current shell** environment

- `git` commands: `init`,`clone`,`add`,`commit -m`,`status`,`log`,`diff`, `branch`, `checkout -b`, `merge`, `rebase`

- `usermod`: 

    - `-aG` appends user to a group
    - `-d` set new user login directory. option `-m` it will move the home content to this directory
    - `-e` set and expiry date on the user
    - `-f` set the number of days after the password expire until the account is deactivated
    - `-g` set the login group of the user. Any file *inside* the user home directory will be owned by the group.
    - `-l` change the login name. doesn't change anything else.
    - `-L` locks the user
    - `-U` unlocks the user
    - `-p` return the encrypted password as returned by `crypt(3)`. This be written in `/etc/passwd` or `/etc/shadow`
    - `-s` without argument return the login shell of the user. you pass the path of a new shell to set it.

    



## Common sets of commands

- **Setup hostname**
    - `sudo nano /etc/hostname`
    - `sudo nano /etc/hosts`

- **Add user, password and set to sudoer group**
    - `sudo useradd -m <usernameq>` `-m` will add the file tree for the user.
    - `sudo passwd <username>` will ask the user to set up his password.
    - `sudo usermod -aG <group> <username>` appends the user to a group
    - `sudo usermod -s /bin/bash <username>` to set default shell to `bash` instead of `bourne shell (default shell)` 
          
- **Setup a http and https webserver on port 80 and 443 with `NGNIX` webserver** 
    - `sudo apt-get install nginx` install the webserver
    - `sudo apt-get install openssl`
    - 
- **Setup a free DNS for your machine**
    - Go to your favorite DNS provider (e.g duckdns.org)
    - Create an account, setup a domain name and get your token.
    - Create a shell file that will update your server ip on the DNS server.
    - `sudo apt-get install openssl`

    - ```bash
    echo url="https://www.duckdns.org/update?domains=alicesys&token=ee790ee2-2b9f-4a76-9835-d485849628a3&ip=" | curl -k -o /etc/duckdns/duck.log -K -
    ```

- 
