PeterMosmans / security-scripts

A collection of security related Python and Bash shell scripts. Analyze hosts on generic security vulnerabilities. Wrapper around popular tools like nmap (portscanner), nikto (webscanner) and testssl.sh (SSL/TLS scanner)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script not working with CentOS 5 / bash 3.2

mkevenaar opened this issue · comments

./analyze_hosts.sh: line 24: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 25: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 26: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 27: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 28: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 31: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 32: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 33: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 34: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 35: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 36: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 37: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 56: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 57: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 58: declare: -c: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
analyze_hosts version 0.80 (30-01-2014)./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
(c) 2012-2014 Peter Mosmans [Go Forward]./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
Licensed under the Mozilla Public License 2.0
usage: ./analyze_hosts.sh [OPTION]... [HOST]

Scanning options:
-a, --all perform all basic scans
--max perform all advanced scans (more thorough)
-b, --basic perform basic scans (fingerprint, ssl, trace)
results of HOST matches regexp FILTER
--dns test for recursive query
-f perform web fingerprinting (all webports)
--fingerprint perform all web fingerprinting methods
-h, --header show webserver headers (all webports)
-n, --nikto nikto webscan (all webports)
-p nmap portscan (top 1000 ports)
--ports nmap portscan (all ports)
-s check SSL configuration
--ssl perform all SSL configuration checks
--timeout=SECONDS change timeout for sslscan (default=30)
--ssh perform SSH configuration checks
-t check webserver for HTTP TRACE method
--trace perform all HTTP TRACE method checks
-w, --whois perform WHOIS lookup for (hostname and) IP address
-W confirm WHOIS results before continuing scan
--filter=FILTER only proceed with scan of HOST if WHOIS
--wordlist=filename scan webserver for existence of files in filename

Port selection (comma separated list):
--webports=PORTS use PORTS for web scans (default 80,443)
--sslports=PORTS use PORTS for ssl scans (default 443,993,995)

Logging and input file:
-d, --directory=DIR location of temporary files (default /tmp)
-i, --inputfile=FILE use a file containing hostnames
-l, --log log each scan in a separate logfile
--nocolor don't use fancy colors in screen output
-o, --output=FILE concatenate all results into FILE
-q, --quiet quiet
-v, --verbose show server responses

-u update this script (if it's a cloned repository)
--update force update (overwrite all local modifications)
--version print version information and exit

./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
BLUE: status messages./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
GREEN: secure settings./analyze_hosts.sh: line 65: ((: 0&: syntax error: operand expected (error token is "&")
RED: possible vulnerabilities
[HOST] can be a single (IP) address, an IP range, eg. 127.0.0.1-255
or multiple comma-separated addressess

example: ./analyze_hosts.sh -a --filter Amazon www.google.com

Thanks for the heads-up. I' ll create a separate branch for Bash => 4, and incorporate compatibility fixes into the master branch.

Python is the main, currently developed branch. Closing this issue, as the Bash version is no longer maintained