From f5832ad0633f42b9fc7368e92d70aad8055baafd Mon Sep 17 00:00:00 2001 From: sandeep <8293321+ehsandeep@users.noreply.github.com> Date: Sat, 3 Sep 2022 15:08:53 +0530 Subject: [PATCH] Revert "add {{}} markers to field formatting (#57)" This reverts commit 160538adc43aace19a01b8ba3b3082383ea77b0d. --- README.md | 10 +++++----- runner/options.go | 2 +- runner/runner.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6e8b0b6c..7961cdb9 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ CONFIG: OUTPUT: -o, -output string output file to write found results - -f, -field string field to display in output ({{ip}},{{port}},{{host}}) (default "{{ip}}:{{port}}") + -f, -field string field to display in output (ip,port,host) (default "ip:port") -j, -json write output in JSONL(ines) format -r, -raw write raw output as received by the remote api -l, -limit int limit the number of results to return (default 100) @@ -262,10 +262,10 @@ echo 51.83.59.99/24 | uncover ### Field Filters -`-f, -field` flag can be used to indicate which fields to return, currently, `{{ip}}`, `{{port}}`, and `{{host}}` are supported and can be used to return desired fields. +`-f, -field` flag can be used to indicate which fields to return, currently, `ip`, `port`, and `host` are supported and can be used to return desired fields. ```console -uncover -q jira -f {{host}} -silent +uncover -q jira -f host -silent ec2-44-198-22-253.compute-1.amazonaws.com ec2-18-246-31-139.us-west-2.compute.amazonaws.com @@ -280,11 +280,11 @@ ec2-34-241-80-255.eu-west-1.compute.amazonaws.com ### Field Formatting -**uncover** has a `-f, -field` flag that can be used to customize the output format. For example, in the case of `uncover -f https://{{ip}}:{{port}}/version`, {{ip}}:{{port}} will be replaced with results in the output while keeping the format defined, It can also be used to specify a known scheme/path/file in order to prepare the output so that it can be immediately passed as input to other tools in the pipeline. +**uncover** has a `-f, -field` flag that can be used to customize the output format. For example, in the case of `uncover -f https://ip:port/version`, ip:port will be replaced with results in the output while keeping the format defined, It can also be used to specify a known scheme/path/file in order to prepare the output so that it can be immediately passed as input to other tools in the pipeline. ```console -echo kubernetes | uncover -f https://{{ip}}:{{port}}/version -silent +echo kubernetes | uncover -f https://ip:port/version -silent https://35.222.229.38:443/version https://52.11.181.228:443/version diff --git a/runner/options.go b/runner/options.go index 9a899521..276bb2d5 100644 --- a/runner/options.go +++ b/runner/options.go @@ -80,7 +80,7 @@ func ParseOptions() *Options { flagSet.CreateGroup("output", "Output", flagSet.StringVarP(&options.OutputFile, "output", "o", "", "output file to write found results"), - flagSet.StringVarP(&options.OutputFields, "field", "f", "{{ip}}:{{port}}", "field to display in output ({{ip}},{{port}},{{host}})"), + flagSet.StringVarP(&options.OutputFields, "field", "f", "ip:port", "field to display in output (ip,port,host)"), flagSet.BoolVarP(&options.JSON, "json", "j", false, "write output in JSONL(ines) format"), flagSet.BoolVarP(&options.Raw, "raw", "r", false, "write raw output as received by the remote api"), flagSet.IntVarP(&options.Limit, "limit", "l", 100, "limit the number of results to return"), diff --git a/runner/runner.go b/runner/runner.go index fb725c41..2caae7f4 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -177,9 +177,9 @@ func (r *Runner) Run(ctx context.Context, query ...string) error { default: port := fmt.Sprint(result.Port) replacer := strings.NewReplacer( - "{{ip}}", result.IP, - "{{host}}", result.Host, - "{{port}}", port, + "ip", result.IP, + "host", result.Host, + "port", port, ) outData := replacer.Replace(r.options.OutputFields) searchFor := []string{result.IP, port}