Skip to content

Commit

Permalink
updated the chisel too tutorial and explaination
Browse files Browse the repository at this point in the history
  • Loading branch information
rcallaby committed May 30, 2024
1 parent e45fb92 commit 6d3fdfa
Showing 1 changed file with 155 additions and 5 deletions.
160 changes: 155 additions & 5 deletions Tools/chisel/chisel.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,163 @@ Chisel offers several advantages that contribute to its effectiveness as a port

* d. Versatile Functionality: Chisel's support for both TCP and UDP protocols, as well as its ability to forward specific ports or ranges, offers flexibility for diverse ethical hacking scenarios.

# Conclusion:
Chisel serves as a valuable tool for ethical hackers, providing secure and efficient port forwarding capabilities. Its features, ease of use, and compatibility across platforms make it an attractive choice for those engaged in penetration testing, vulnerability assessments, and network analysis. By leveraging Chisel's strengths, ethical hackers can enhance their capabilities and effectively identify vulnerabilities, contributing to improved security practices and defenses.
### Usage Tutorial

Certainly! Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. It's often used for penetration testing and secure communication between systems. I'll guide you through the process of using Chisel on both Windows and Linux.

### Usage Tutorial
### Prerequisites
1. **Chisel Binary**: Download the appropriate Chisel binary for your operating system from the [Chisel GitHub releases page](https://github.com/jpillora/chisel/releases).
2. **SSH Access**: Ensure you have SSH access to the remote server if you are using Chisel for SSH tunneling.

### Installation

#### Windows
1. Download the Chisel binary (`chisel.exe`).
2. Place it in a directory included in your system's `PATH` or in any directory where you can easily access it.

#### Linux
1. Download the Chisel binary for Linux.
2. Make the binary executable:
```sh
chmod +x chisel
```
3. Move it to a directory in your `PATH`, such as `/usr/local/bin`:
```sh
sudo mv chisel /usr/local/bin
```

### Basic Usage

Chisel operates in two modes: server and client. The server is set up on a machine that will receive the tunneled connections, while the client initiates the tunnel.

#### Setting up the Server

##### Windows
Run the Chisel server on your desired port. For example, to run it on port 8080:
```powershell
chisel.exe server -p 8080 --reverse
```

##### Linux
The same command can be used on Linux:
```sh
chisel server -p 8080 --reverse
```

The `--reverse` flag allows reverse port forwarding, enabling clients to expose their local services.

#### Setting up the Client

##### Windows
Suppose you want to forward local port 8000 to a remote port 80 through the server:
```powershell
chisel.exe client <server_ip>:8080 R:8000:localhost:80
```

##### Linux
On Linux, the command is the same:
```sh
chisel client <server_ip>:8080 R:8000:localhost:80
```

Here:
- `<server_ip>`: Replace with the IP address of the server.
- `R:8000:localhost:80`: This specifies reverse port forwarding where `8000` on the client will forward to `80` on the client.

### Advanced Usage

#### Forwarding a Remote Service to the Local Machine

Suppose you have a service running on port 22 (SSH) on the client and want to access it from the server.

1. **Server Command**:
```sh
chisel server -p 8080 --reverse
```

2. **Client Command**:
```sh
chisel client <server_ip>:8080 R:2222:localhost:22
```

Now, on the server, you can access the client’s SSH service on port 2222:
```sh
ssh -p 2222 user@localhost
```

#### Forwarding a Local Service to a Remote Machine

If you want to forward a local service (e.g., a web server on port 80) to a remote machine:

1. **Server Command** (if the server should forward the service):
```sh
chisel server -p 8080
```

2. **Client Command**:
```sh
chisel client <server_ip>:8080 80:localhost:80
```

This will forward the local port 80 to the server's port 80.
#### UDP Tunneling
Chisel also supports UDP tunneling. For example, to tunnel a UDP service:
1. **Server Command**:
```sh
chisel server -p 8080 --udp
```
2. **Client Command**:
```sh
chisel client <server_ip>:8080 R:5000:localhost:5000/udp
```
This forwards UDP packets from port 5000 on the client to port 5000 on the server.
### Securing Chisel
Chisel traffic is encrypted using SSH. To enhance security, you can:
1. Use SSH keys instead of passwords.
2. Restrict access using firewall rules.
3. Regularly update Chisel to patch any vulnerabilities.
### Examples
#### Example 1: Forwarding a Local Web Server to a Remote Server
**Server**:
```sh
chisel server -p 8080 --reverse
```
**Client**:
```sh
chisel client <server_ip>:8080 R:8000:localhost:80
```
Access the web server on the client from the server at `http://localhost:8000`.
#### Example 2: Accessing a Remote Database Locally
**Server**:
```sh
chisel server -p 8080
```
**Client**:
```sh
chisel client <server_ip>:8080 3306:localhost:3306
```
Connect to the remote MySQL database running on port 3306 as if it were local.
#### Installation
### Troubleshooting
1. **Connection Refused**: Ensure the server is running and accessible.
2. **Port Conflicts**: Ensure the ports you are using are not in use by other services.
3. **Firewall Rules**: Check that your firewall allows traffic on the specified ports.
#### Example Usage
Chisel is a powerful tool for secure tunneling, suitable for both Windows and Linux. By setting up Chisel servers and clients, you can forward ports and access services across networks securely. Always ensure you understand the security implications and maintain best practices when using tunneling tools.

0 comments on commit 6d3fdfa

Please sign in to comment.