From 078fdaada7688eae4054f5f2392a76c9961bacba Mon Sep 17 00:00:00 2001 From: Ryan Good Date: Fri, 1 May 2020 21:51:35 -0400 Subject: [PATCH] Changes commands to be more uniform/readable (#58) --- pipeline/tools/amass.yaml | 6 +++--- pipeline/tools/aquatone.yaml | 6 +++--- pipeline/tools/go.yaml | 4 +++- pipeline/tools/gobuster.yaml | 8 +++++--- pipeline/tools/luigi-service.yaml | 4 ++-- pipeline/tools/masscan.yaml | 4 ++-- pipeline/tools/recursive-gobuster.yaml | 6 +++--- pipeline/tools/searchsploit.yaml | 8 ++++---- pipeline/tools/seclists.yaml | 4 ++-- pipeline/tools/subjack.yaml | 8 +++++--- pipeline/tools/tko-subs.yaml | 6 ++++-- pipeline/tools/webanalyze.yaml | 8 +++++--- 12 files changed, 41 insertions(+), 31 deletions(-) diff --git a/pipeline/tools/amass.yaml b/pipeline/tools/amass.yaml index 62da1bd..c5b91e5 100644 --- a/pipeline/tools/amass.yaml +++ b/pipeline/tools/amass.yaml @@ -1,11 +1,11 @@ installed: false -dependencies: ["go"] +dependencies: [go] go: &gotool !get_tool_path "{go}" amass: &amass !get_tool_path "{amass}" commands: -- !join [*gotool, "get -u github.com/OWASP/Amass/v3/..."] -- !join ["cp ~/go/bin/amass", *amass] +- !join [*gotool, get -u github.com/OWASP/Amass/v3/...] +- !join [cp ~/go/bin/amass, *amass] shell: true environ: {"GO111MODULE": "on"} \ No newline at end of file diff --git a/pipeline/tools/aquatone.yaml b/pipeline/tools/aquatone.yaml index 970c4ed..513c4f4 100644 --- a/pipeline/tools/aquatone.yaml +++ b/pipeline/tools/aquatone.yaml @@ -5,10 +5,10 @@ aquatone: &aqua !get_tool_path "{aquatone}" commands: - mkdir /tmp/aquatone - wget -q https://github.com/michenriksen/aquatone/releases/download/v1.7.0/aquatone_linux_amd64_1.7.0.zip -O /tmp/aquatone/aquatone.zip -- !join [bash, -c, "'if [[ ! $(which unzip) ]]; then sudo apt install -y zip; fi'"] +- bash -c 'if [[ ! $(which unzip) ]]; then sudo apt install -y zip; fi' - unzip /tmp/aquatone/aquatone.zip -d /tmp/aquatone -- !join [mv, /tmp/aquatone/aquatone, *aqua] +- !join [mv /tmp/aquatone/aquatone, *aqua] - rm -rf /tmp/aquatone -- !join [bash, -c, "'found=false; for loc in {/usr/bin/google-chrome,/usr/bin/google-chrome-beta,/usr/bin/google-chrome-unstable,/usr/bin/chromium-browser,/usr/bin/chromium}; do if [[ $(which $loc) ]]; then found=true; break; fi ; done; if [[ $found = false ]]; then sudo apt install -y chromium-browser ; fi'"] +- bash -c 'found=false; for loc in {/usr/bin/google-chrome,/usr/bin/google-chrome-beta,/usr/bin/google-chrome-unstable,/usr/bin/chromium-browser,/usr/bin/chromium}; do if [[ $(which $loc) ]]; then found=true; break; fi ; done; if [[ $found = false ]]; then sudo apt install -y chromium-browser ; fi' shell: true \ No newline at end of file diff --git a/pipeline/tools/go.yaml b/pipeline/tools/go.yaml index 0b9869f..e99c6bd 100644 --- a/pipeline/tools/go.yaml +++ b/pipeline/tools/go.yaml @@ -1,10 +1,12 @@ installed: false dependencies: +home: &home !get_default "{home}" go: &gotool !get_tool_path "{go}" +bashrc: &bashrc !join_path [*home, "/.bashrc;"] commands: - wget -q https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz -O /tmp/go.tar.gz - sudo tar -C /usr/local -xvf /tmp/go.tar.gz -- !join [bash, -c, "'if [ ! $(echo ${PATH} | grep $(dirname", *gotool, ")) ]; then echo PATH=${PATH}:/usr/local/go/bin >> ~/.bashrc; fi'"] +- !join ["bash -c 'if [ ! $(echo ${PATH} | grep $(dirname", *gotool, ")) ]; then echo PATH=${PATH}:/usr/local/go/bin >>", *bashrc, "fi'"] shell: true \ No newline at end of file diff --git a/pipeline/tools/gobuster.yaml b/pipeline/tools/gobuster.yaml index 9ab1a68..5cef7f3 100644 --- a/pipeline/tools/gobuster.yaml +++ b/pipeline/tools/gobuster.yaml @@ -1,9 +1,11 @@ installed: false -dependencies: ["go", "seclists"] +dependencies: [go, seclists] +home: &home !get_default "{home}" go: &gotool !get_tool_path "{go}" +go_home: &gohome !join_path [*home, "/go/src/github.com/OJ/gobuster &&"] commands: -- !join [*gotool, get, github.com/OJ/gobuster] -- !join [(cd, ~/go/src/github.com/OJ/gobuster, "&&", *gotool, "build &&", *gotool, install)] +- !join [*gotool, get github.com/OJ/gobuster] +- !join [(cd, *gohome, *gotool, build &&, *gotool, install)] shell: true \ No newline at end of file diff --git a/pipeline/tools/luigi-service.yaml b/pipeline/tools/luigi-service.yaml index 9b9ca3d..d92cf66 100644 --- a/pipeline/tools/luigi-service.yaml +++ b/pipeline/tools/luigi-service.yaml @@ -3,8 +3,8 @@ dependencies: service-file: &svcfile !get_tool_path "{luigid}" commands: -- !join [sudo, cp, *svcfile, /lib/systemd/system/luigid.service] -- !join [sudo, cp, *svcfile, $(which luigid), /usr/local/bin] +- !join [sudo cp, *svcfile, /lib/systemd/system/luigid.service] +- !join [sudo cp, *svcfile, $(which luigid), /usr/local/bin] - sudo systemctl daemon-reload - sudo systemctl start luigid.service - sudo systemctl enable luigid.service diff --git a/pipeline/tools/masscan.yaml b/pipeline/tools/masscan.yaml index e9e5831..3c7e20a 100644 --- a/pipeline/tools/masscan.yaml +++ b/pipeline/tools/masscan.yaml @@ -5,8 +5,8 @@ masscan: &masscan !get_tool_path "{masscan}" commands: - git clone https://github.com/robertdavidgraham/masscan /tmp/masscan - make -s -j -C /tmp/masscan -- !join [mv, /tmp/masscan/bin/masscan, *masscan] +- !join [mv /tmp/masscan/bin/masscan, *masscan] - rm -rf /tmp/masscan -- !join [sudo, setcap, CAP_NET_RAW+ep, *masscan] +- !join [sudo setcap CAP_NET_RAW+ep, *masscan] shell: true \ No newline at end of file diff --git a/pipeline/tools/recursive-gobuster.yaml b/pipeline/tools/recursive-gobuster.yaml index 572fea5..a011d84 100644 --- a/pipeline/tools/recursive-gobuster.yaml +++ b/pipeline/tools/recursive-gobuster.yaml @@ -1,10 +1,10 @@ installed: false -dependencies: ["go"] +dependencies: [go] recursive-parent: &recpar !get_parent "{recursive-gobuster}" commands: -- !join [bash, -c, "'if [ -d", *recpar, "]; then cd", *recpar, +- !join ["bash -c 'if [ -d", *recpar, "]; then cd", *recpar, "&& git fetch --all && git pull; else git clone https://github.com/epi052/recursive-gobuster.git", - *recpar, "; fi'"] + *recpar, ; fi'] shell: true \ No newline at end of file diff --git a/pipeline/tools/searchsploit.yaml b/pipeline/tools/searchsploit.yaml index 38b82ab..0ccf79b 100644 --- a/pipeline/tools/searchsploit.yaml +++ b/pipeline/tools/searchsploit.yaml @@ -9,11 +9,11 @@ homesploit: &homesploit !join_path [*home, ".searchsploit_rc"] sed-command: &sedcom !join_empty ["'s#/opt#", *tools, "#g'"] commands: -- !join [bash, -c, "'if [ -d /usr/share/exploitdb ]; then ln -fs /usr/share/exploitdb", +- !join ["bash -c 'if [ -d /usr/share/exploitdb ]; then ln -fs /usr/share/exploitdb", *exploitdb, "&& sudo ln -fs $(which searchsploit)", *searchsploit, "; elif [ -d", *exploitdb, "]; then cd", *exploitdb, - "&& git fetch --all && git pull; else git clone https://github.com/offensive-security/exploitdb.git", *exploitdb, "; fi'"] -- !join [bash, -c, "'if [ -f", *ss_rc, "]; then cp -n", *ss_rc, *home, "; fi'"] -- !join [bash, -c, "'if [ -f", *homesploit, "]; then sed -i", *sedcom, *homesploit, "; fi'"] + "&& git fetch --all && git pull; else git clone https://github.com/offensive-security/exploitdb.git", *exploitdb, ; fi'] +- !join ["bash -c 'if [ -f", *ss_rc, "]; then cp -n", *ss_rc, *home, ; fi'] +- !join ["bash -c 'if [ -f", *homesploit, "]; then sed -i", *sedcom, *homesploit, ; fi'] shell: true \ No newline at end of file diff --git a/pipeline/tools/seclists.yaml b/pipeline/tools/seclists.yaml index 48aa08c..ddf5306 100644 --- a/pipeline/tools/seclists.yaml +++ b/pipeline/tools/seclists.yaml @@ -3,8 +3,8 @@ depencencies: seclists-file: &secfile !get_tool_path "{seclists}" commands: - - !join [bash, -c, "'if [[ -d /usr/share/seclists ]];", "then ln -s /usr/share/seclists", + - !join ["bash -c 'if [[ -d /usr/share/seclists ]]; then ln -s /usr/share/seclists", *secfile, "; elif [[ -d", *secfile, "]] ; then cd", *secfile, "&& git fetch --all && git pull;", - "else git clone https://github.com/danielmiessler/SecLists.git", *secfile, "; fi'"] + else git clone https://github.com/danielmiessler/SecLists.git, *secfile, ; fi'] shell: true \ No newline at end of file diff --git a/pipeline/tools/subjack.yaml b/pipeline/tools/subjack.yaml index 6e8f45f..04d45ee 100644 --- a/pipeline/tools/subjack.yaml +++ b/pipeline/tools/subjack.yaml @@ -1,9 +1,11 @@ installed: false -dependencies: ["go"] +dependencies: [go] go: &gotool !get_tool_path "{go}" +home: &home !get_default "{home}" +subjack_home: &subjhome !join_path [*home, "/go/src/github.com/haccer/subjack &&"] commands: -- !join [*gotool, get, github.com/haccer/subjack] -- !join ["(cd ~/go/src/github.com/haccer/subjack &&", *gotool, "install)"] +- !join [*gotool, get github.com/haccer/subjack] +- !join [(cd, *subjhome, *gotool, install)] shell: true \ No newline at end of file diff --git a/pipeline/tools/tko-subs.yaml b/pipeline/tools/tko-subs.yaml index 3296919..be2f4be 100644 --- a/pipeline/tools/tko-subs.yaml +++ b/pipeline/tools/tko-subs.yaml @@ -1,9 +1,11 @@ installed: false -dependencies: ["go"] +dependencies: [go] go: &gotool !get_tool_path "{go}" +home: &home !get_default "{home}" +tko_home: &tkohome !join_path [*home, "go/src/github.com/anshumanbh/tko-subs &&"] commands: - !join [*gotool, get, github.com/anshumanbh/tko-subs] -- !join ["(cd ~/go/src/github.com/anshumanbh/tko-subs && ", *gotool, "build && ", *gotool, "install)"] +- !join [(cd, *tkohome, *gotool, "build &&", *gotool, "install)"] shell: true diff --git a/pipeline/tools/webanalyze.yaml b/pipeline/tools/webanalyze.yaml index 8ff0012..6da2fad 100644 --- a/pipeline/tools/webanalyze.yaml +++ b/pipeline/tools/webanalyze.yaml @@ -1,9 +1,11 @@ installed: false -dependencies: ["go"] +dependencies: [go] +home: &home !get_default "{home}" go: &gotool !get_tool_path "{go}" +webanalyze_home: &webhome !join_path [*home, "/go/src/github.com/rverton/webanalyze &&"] commands: -- !join [*gotool, get, github.com/rverton/webanalyze/...] -- !join ["(cd ~/go/src/github.com/rverton/webanalyze &&", *gotool, "build &&", *gotool, "install)"] +- !join [*gotool, get github.com/rverton/webanalyze/...] +- !join [(cd, *webhome, *gotool, "build &&", *gotool, install)] shell: true