From a50de8520679d8f9ab39b62fa4102f7961c481d3 Mon Sep 17 00:00:00 2001 From: delorean Date: Sat, 31 Aug 2024 20:55:33 -0500 Subject: [PATCH] argument changes, readme, etc --- README.md | 21 +++++++++++---------- common/config.go | 6 ++++-- common/console.go | 21 ++++++++++----------- common/exec.go | 14 ++++++++------ 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 075fe7d..0f4e2a3 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,24 @@ -# potknocker - -> scans for ssh/ftp honeypots and loads arbitrary payloads onto them, like zip bombs -

-"pinche sombreros blancos..." +"pinche blancosombreros..."

+# potknocker + +> scans for ssh/ftp honeypots and loads arbitrary payloads onto them, such as zip bombs + + ## usage ``` -! -r target specific cidr range [0.0.0.0/0] + -r target specific cidr range [0.0.0.0/0] -l list of target cidr's (individual ip = /32) -! -ssh target ssh honeypots -! -ftp target ftp honeypots -! -p payload file to upload + -ssh target ssh honeypots + -ftp target ftp honeypots + -p payload file to upload -c shell command to run after uploading ssh payload -t threads [25] - -s silence connection attempt logs + -s silence connection attempt verbosity ``` diff --git a/common/config.go b/common/config.go index f8c4d15..e3ae30c 100644 --- a/common/config.go +++ b/common/config.go @@ -42,8 +42,10 @@ func LoadConf() { fatal("are you targeting ssh (-ssh) or ftp (-ftp)?") } - if _, err := os.Stat(*payload); err != nil { - fatal("payload '" + *payload + "' not found") + if *payload != "" { + if _, err := os.Stat(*payload); err != nil { + fatal("payload '" + *payload + "' not found") + } } targetcidr := "" diff --git a/common/console.go b/common/console.go index b490e66..0d3c820 100644 --- a/common/console.go +++ b/common/console.go @@ -37,21 +37,22 @@ func usage() { Banner() fmt.Fprintf(os.Stderr, ` potknocker - the block party on honeypot street -%s!%s -r %starget specific cidr range [0.0.0.0/0]%s - -l %slist of target cidr's (individual ip = /32)%s -%s!%s -ssh %starget ssh honeypots%s -%s!%s -ftp %starget ftp honeypots -%s!%s -p %spayload file to upload%s - -c %sshell command to run after uploading ssh payload%s +%s!%s -r %starget specific cidr range [0.0.0.0/0] +%s!%s -l %slist of target cidr's (individual ip = /32)%s + -p %spayload file to upload to the pot%s + -c %sshell commands to run on the pot +%s!%s -ssh %starget ssh honeypots +%s!%s -ftp %starget ftp honeypots%s -t %sthreads [25]%s -s %ssilence attempt logs%s -`, colorRed, colorCyan, colorPurple, colorCyan, colorPurple, colorCyan, colorYellow, colorCyan, colorPurple, - colorCyan, colorYellow, colorCyan, colorPurple, colorRed, colorCyan, colorPurple, colorCyan, colorPurple, - colorCyan, colorPurple, colorCyan, colorPurple, colorReset) +`, colorRed, colorCyan, colorPurple, colorRed, colorCyan, colorPurple, colorCyan, colorPurple, colorCyan, + colorPurple, colorRed, colorCyan, colorPurple, colorRed, colorCyan, colorPurple, colorCyan, colorPurple, + colorCyan, colorPurple, colorReset) } func Banner() { fmt.Fprintf(os.Stderr, ` + %s"i see a silly goose"%s ___________ ____ ______/ \__// \__/____\ _/ \_/ //____\\ @@ -67,8 +68,6 @@ func Banner() { /____ / / \ / \______\_________/ - -%spotknocker - doing burnouts down honeypot street%s sincerely, ~delorean `, colorRed, colorReset) diff --git a/common/exec.go b/common/exec.go index daf4a38..63ca4b4 100644 --- a/common/exec.go +++ b/common/exec.go @@ -13,12 +13,14 @@ func thread(addrs <-chan string, tab chan<- interface{}) { } if c, err := connssh(addr); err == nil { success("connected to " + addr + " - " + string(c.ServerVersion())) - if err = loadpl(c); err == nil { - success("wrote payload to " + c.RemoteAddr().String()) - if Params.Command != "" { - if err = runcmd(c, Params.Command); err == nil { - success("executed command on " + c.LocalAddr().String() + " as " + c.User()) - } + if Params.Payload != "" { + if err = loadpl(c); err == nil { + success("wrote payload to " + c.RemoteAddr().String()) + } + } + if Params.Command != "" { + if err = runcmd(c, Params.Command); err == nil { + success("executed command on " + c.LocalAddr().String() + " as " + c.User()) } } c.Close()