Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
freb committed Aug 11, 2019
1 parent 1574958 commit 520b2e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# cloud-cmd

cloud-cmd was forked from the wonderful `tomsteele/cloud-proxy` project. Where the goal of cloud-proxy was to provide multiple cloud instances for SOCKS proxies, the cloud-cmd provides a convenient way to divide commands among multiple cloud instances.
cloud-cmd was forked from the wonderful `tomsteele/cloud-proxy` project. Where the goal of cloud-proxy was to provide multiple cloud instances for SOCKS proxies, cloud-cmd provides a convenient way to divide commands among multiple cloud instances.

The primary use case, at least currently, is to split an Nmap scan across multiple cloud instances. During penetration testing engagements we sometimes encounter targets that blacklist you or otherwise change their bahaviour when they detect they are being port scanned (such as show all ports as open...I'm looking at you SonicWall).

This is accomplished with a few bits of functionality, some of which the user has control over, and others which rely on hardcoded functionality. For instance, the command that gets passed to each cloud instance is configurable by the caller using Go `text/template` syntax passed to the `-cmd` flag. But one of the variables availble to the template relies on hard-coded functionality in cloud-cmd--the `-ports` flag. This flag takes a valid nmap port list (e.g. the top 5 TCP ports `21-23,80,443`) but breaks the list into equal size chunks anded passes them into the command template for each cloud instance as the `{{.ports}}` variable.
This is accomplished with a few bits of functionality, some of which the user has control over, and others which rely on hardcoded functionality. For instance, the command that gets passed to each cloud instance is configurable by the caller using Go `text/template` syntax passed to the `-cmd` flag. But one of the variables availble to the template relies on hard-coded functionality in cloud-cmd--the `-ports` flag. This flag takes a valid nmap port list (e.g. the top 5 TCP ports `21-23,80,443`) but breaks the list into equal size chunks and passes them into the command template for each cloud instance as the `{{.ports}}` variable.

There are 4 built-in variables that are passed to the command template so far: `{{.ports}}`, `{{.index}}`, `{{.ip}}`, and `{{.name}}`. Any shell command that can be successfully divided accross all cloud instances using these variables is fair game. Commands requiring additional splitting/dividing functionality (similar to the `-ports` flag and template variable) would need to have them added to cloud-cmd. As an example, if instead of dividing the ports accross the cloud instances for the same set of scan targets you wanted to scall the same ports but divide up the targets, we'd need to add a new flag and functionality for dividing something like a comma-separate list into different chunks.
There are 4 built-in variables that are passed to the command template so far: `{{.ports}}`, `{{.index}}`, `{{.ip}}`, and `{{.name}}`. Any shell command that can be successfully divided accross all cloud instances using these variables is fair game. Commands requiring additional splitting/dividing functionality (similar to the `-ports` flag and template variable) would need to have them added to cloud-cmd. As an example, if instead of dividing the ports accross the cloud instances for the same set of scan targets you wanted to scan the same ports but divide up the targets, we'd need to add a new flag and functionality for dividing something like a comma-separate list into different chunks.

# Usage

In order to deploy instances, you must provide your Digital Ocean API key either either with the flag `-token`, or with the environment variable `DOTOKEN`.
In order to deploy instances, you must provide your Digital Ocean API key either with the `-token` flag, or with the environment variable `DOTOKEN`.

In order to launch the instances and connect to them, you must provide the path to an SSH private key who's public key and signature are already configured in your Digital Ocean account using the `key-location`. It is OK if the private key is encrypted, you will be prompted for the password before the tool proceeds.
In order to launch the instances and connect to them, you must provide the path to an SSH private key who's public key and signature are already configured in your Digital Ocean account. Do this using the `-key-location` flag. It is OK if the private key is encrypted, you will be prompted for the password before the tool proceeds.

Provide the number of cloud instances you want to launch with the `-count` flag.

Expand All @@ -21,7 +21,7 @@ Provide the command you want to run with the `-cmd` flag. The command uses Go `t
- `{{.index}}`: the number/index marking the order that instances was launched, starting at 1.
- `{{.ip}}`: The public IPv4 address of the cloud instance.
- `{{.name}}`: The name assigned to the instance by Digital Ocean, which also happens to be the configured hostname.
- `{{.ports}}`: One slice of total ports specified with the `-ports` flag.
- `{{.ports}}`: One slice of the total list of ports that was specified with the `-ports` flag.


If successfull completion of the command requires some packages be installed first, pass a comma-separated list of packages to the `-pkg` flag.
Expand Down

0 comments on commit 520b2e2

Please sign in to comment.