Skip to content

Commit

Permalink
Enhancement , Bug Fix (#5)
Browse files Browse the repository at this point in the history
* minor changes

* fixed issues

* Multiple Fixes

* dependency fix
  • Loading branch information
tarunKoyalwar committed Jun 11, 2022
1 parent 8aee6f5 commit c5633bb
Show file tree
Hide file tree
Showing 20 changed files with 441 additions and 396 deletions.
67 changes: 56 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,55 @@ These are oversimplified features to name from my blog.
- Stop /Resume(BETA)
- No Compatiblity issues


The driving forces behind talosplus are **variables** and **directives** . These directives and variables abstract complex bash syntaxes and solve challanges with little syntax.

## Directives

- Refer Below Table for available directives and their use

| Directive | Syntax | Description |
| -- | -- | -- |
| **#dir** | `#dir:/path/to/directory` | Run Given Command in this directory |
| **#from** | `#from:@varname` | Get Data from variable(`@varname`) and pass as stdin to cmd |
| **#as**| `#as:@varname` | Export Output(Stdout Only) of Command to variable (`@varname`) |
| **#for** | `#for:@arr:@i` | For each line(`@i`) in variable(`@arr`) run new command (Similar to **interlace**) |
| **#ignore** | `#ignore` | Ignore Output of this command While showing Output |


## Variables

Variables are like buffers/env-variable etc starting with `@` and are handled by golang and are thread-safe . All variables exported in script are saved to MongoDB thus it is possible to get output of a specific command in the middle of execution. Talosplus tries to ignore `Everything is a file` Linux Philosophy by abstracting file system and creating and deleting files at runtime based on the need. Below Table Contains Some operations that can be performed on variables.

A Particular operation can be done on variable by supplying operator within `{}`

|Operator| Use Case | Description |
| -- | -- | -- |
| **add** | `#as:@gvar{add}` | Append Output of command to `@gvar` variable |
| **unique** | `#as:@gvar{unique}` | Append output of command to `@gvar` but all values are unique |
| **file** | `@inscope{file}` | Create a Temp File with `@inscope` variable data and return path of that temp file |
| **!file** | `@outscope{!file}` | Same as `file` but it can be empty |



- Special Cases

| Syntax | Example | Description |
| -- | -- | -- |
| `@outfile` | `subfinder ... -o @outfile` | Create a temp file(`@outfile`) and use content of file as output instead of stdout |
| `@tempfile` | - | Create a temp file and return its path |
| `@env` | `@env:DISCORD_TOKEN` | Get value of enviournment variable (Can also be done using `$`) |

# Installation Instructions

- Install MongoDB.
- Configure MongoDB Atlas or Install [MongoDB](https://www.mongodb.com/docs/manual/installation/).

- Install `libx11-dev` (Provides Clipboard Access)

- On Debian Based distro ```sudo apt install libx11-dev```

- On ArchLinux Based distro ```sudo pacman -S libx11```

- Download Binary From [Releases](https://github.com/tarunKoyalwar/talosplus/releases) .

- Build From Source .

Expand All @@ -82,7 +126,11 @@ go install github.com/tarunKoyalwar/talosplus/cmd/talosplus@latest
~~~


Refer to Blog [Part 3](https://medium.com/@zealousme/create-your-ultimate-bug-bounty-automation-without-nerdy-bash-skills-part-3-7ee2b353a781) for step by step instructions in detail.
Do Star the repo to show your support.
Follow me on [github](https://github.com/tarunKoyalwar) / [twitter](https://twitter.com/KoyalwarTarun) to get latest updates on Talosplus.


Refer to Blog [Part 3](https://medium.com/@zealousme/create-your-ultimate-bug-bounty-automation-without-nerdy-bash-skills-part-3-7ee2b353a781) for step by step instructions on using `talosplus` command in detail with examples.


# Limitations
Expand All @@ -100,16 +148,13 @@ Read Blog or Refer to subenum.sh file before running any script file.

# Usage

```sh
talosplus -h
```

This will display help for the tool
Check Below Sample Video which Shows How I use talosplus for Subdomain Enumeration Automation using [subenum.sh](/examples/subenum.sh)


[![asciicast](https://asciinema.org/a/qHeRefcO6WOPrWuNAnpcuICLf.svg)](https://asciinema.org/a/qHeRefcO6WOPrWuNAnpcuICLf)


<p align="center" >
<img src="static/taloshelp.png" >
</br>
</p>


Talosplus has every feature that would make it easy to write and run bash scripts .
Expand Down
6 changes: 6 additions & 0 deletions cmd/talosplus/subcmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
ShowOutput = false
DryRun = false
blacklist = []string{}
Nocolor = false
)

var RunScript cobra.Command = cobra.Command{
Expand Down Expand Up @@ -68,6 +69,10 @@ Settings Like Purge, CacheDIR , pname etc can also be set using "get|set"
shell.Settings.ProjectExportName = DefaultSettings.ActiveColl + "Exports"
shell.Settings.Purge = Purge

// Set Verbosity
ioutils.Cout.Verbose = Verbose
ioutils.Cout.DisableColor = Nocolor

// check env for cachedir
cdirenv := os.Getenv("TALOS_CACHEDIR")
if cdirenv != "" {
Expand Down Expand Up @@ -150,6 +155,7 @@ func init() {
RunScript.Flags().BoolVar(&ShowOutput, "show", false, "Show Output of Each Command")
RunScript.Flags().BoolVar(&Purge, "purge", false, "Purge Cached Data")
RunScript.Flags().BoolVarP(&Verbose, "verbose", "v", false, "Verbose Output (Includes Warn,Info)")
RunScript.Flags().BoolVar(&Nocolor, "no-color", false, "Disable Colored Output")
RunScript.Flags().BoolVar(&DryRun, "dryrun", false, "Do Everything Except Running the commands")
RunScript.Flags().StringSliceVarP(&blacklist, "blacklist", "b", []string{}, "These variables will not be used from db and cmds will be rerun")

Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.18
require (
github.com/disgoorg/disgo v0.10.2
github.com/disgoorg/snowflake/v2 v2.0.0
github.com/muesli/termenv v0.12.0
github.com/spf13/cobra v1.4.0
go.mongodb.org/mongo-driver v1.9.1
golang.design/x/clipboard v0.6.2
Expand All @@ -16,7 +17,11 @@ require (
github.com/golang/snappy v0.0.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
Expand All @@ -28,6 +33,6 @@ require (
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
golang.org/x/mobile v0.0.0-20210716004757-34ab1303b554 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/text v0.3.6 // indirect
)
15 changes: 13 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc=
github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b h1:qYTY2tN72LhgDj2rtWG+LI6TXFl2ygFQQ4YezfVaGQE=
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b/go.mod h1:/pA7k3zsXKdjjAiUhB5CjuKib9KJGCaLvZwtxGC8U0s=
Expand Down Expand Up @@ -83,8 +93,9 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
Loading

0 comments on commit c5633bb

Please sign in to comment.