fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
320ebb685
master
1# Completions for nmap (https://www.nmap.org) 2 3complete -c nmap -f -a"(__fish_print_hostnames)" 4 5# TARGET SPECIFICATION 6complete -c nmap -o iL -F -d'Input target from file' 7complete -c nmap -o iR -x -d'Choose random targets' 8complete -c nmap -l exclude -x -a"(__fish_print_hostnames)" -d'Exclude hosts/networks' 9complete -c nmap -l excludefile -r -d'Exclude list from file' 10 11# HOST DISCOVERY 12complete -c nmap -o sL -d'Scan: List Scan' 13complete -c nmap -o sn -d'Scan: No port scan' 14complete -c nmap -o Pn -d'Probe: No Ping' 15complete -c nmap -o PS -x -d'Probe: TCP Syn Ping' 16complete -c nmap -o PA -x -d'Probe: TCP ACK Ping' 17complete -c nmap -o PU -x -d'Probe: UDP Ping' 18complete -c nmap -o PY -x -d'Probe: SCTP INIT Ping' 19complete -c nmap -o PE -d'Probe: ICMP Echo Ping' 20complete -c nmap -o PP -d'Probe: ICMP timestamp request' 21complete -c nmap -o PM -d'Probe: ICMP netmask Ping' 22complete -c nmap -o PO -x -d'Probe: IP Protocol Ping' 23complete -c nmap -o PR -d'Probe: ARP Ping' 24complete -c nmap -l disable-arp-ping -d'No ARP or ND Ping' 25complete -c nmap -l traceroute -d'Trace path to host' 26complete -c nmap -s n -d'No DNS resolution' 27complete -c nmap -s R -d'DNS resolution for all targets' 28complete -c nmap -l system-dns -d'Use system DNS resolver' 29complete -c nmap -l dns-servers -x -a"(__fish_print_hostnames)" -d'Servers to use for reverse DNS queries' 30 31# PORT SCANNING TECHNIQUES 32complete -c nmap -o sS -d'Scan: TCP SYN' 33complete -c nmap -o sT -d'Scan: TCP connect' 34complete -c nmap -o sU -d'Scan: UDP' 35complete -c nmap -o sY -d'Scan: SCTP INIT' 36complete -c nmap -o sN -d'Scan: TCP NULL' 37complete -c nmap -o sF -d'Scan: FIN' 38complete -c nmap -o sX -d'Scan: Xmas' 39complete -c nmap -o sA -d'Scan: ACK' 40complete -c nmap -o sW -d'Scan: Window' 41complete -c nmap -o sM -d'Scan: Mainmon' 42complete -c nmap -l scanflags -d'Custom TCP scan flags' 43complete -c nmap -o sZ -d'Scan: SCTP COOKIE ECHO' 44complete -c nmap -o sI -x -a"(__fish_print_hostnames)" -d'Scan: Idle Scan' 45complete -c nmap -o sO -d'Scan: IP protocol' 46complete -c nmap -s b -x -a"(__fish_print_hostnames)" -d'FTP bounce scan' 47 48# PORT SPECIFICATION AND SCAN ORDER 49complete -c nmap -s p -d'Only scan specified ports' 50complete -c nmap -l exclude-ports -d'Exclude the specified ports from scanning' 51complete -c nmap -s F -d'Fast (limited port) scan' 52complete -c nmap -s r -d"Don't randomize ports" 53complete -c nmap -l port-ratio -x -d'Scan ports with ratio greater then' 54complete -c nmap -l top-ports -x -d'Scan the n highest-ratio ports' 55 56# SERVICE AND VERSION DETECTION 57complete -c nmap -o sV -d'Scan: Version' 58complete -c nmap -l allports -d"Don't exclude any ports from version detection" 59complete -c nmap -l version-intensity -x -d'Set version scan intensity' 60complete -c nmap -l version-light -d'Enable light mode' 61complete -c nmap -l version-all -d'Try every single probe' 62complete -c nmap -l version-trace -d'Trace version scan activity' 63 64# OS DETECTION 65complete -c nmap -s O -d'Enable OS detection' 66complete -c nmap -l osscan-limit -d'Limit OS detection to promising targets' 67complete -c nmap -l osscan-guess -d'Guess OS detection results' 68complete -c nmap -l fuzzy -d'Guess OS detection results' 69complete -c nmap -l max-os-tries -d'Set the maximum number of OS detection tries against a target' 70 71# NMAP SCRIPTING ENGINE (NSE) 72complete -c nmap -o sC -d'Scan: Scripts (default)' 73function __fish_complete_nmap_script 74set -l now( date "+%s" ) 75 76# cache completion for 5 minutes (`nmap --script-help all` is slow) 77# must use `math` because of differences between BSD and GNU `date` 78if test -z " $__fish_nmap_script_completion_cache " -o ( math $now -5 "*" 60 ) -gt " $__fish_nmap_script_completion_cache_time " 79set -g __fish_nmap_script_completion_cache_time$now 80set -g __fish_nmap_script_completion_cache"" 81set -l cmd 82for lin ( nmap --script-help all2> /dev/null| grep -A2 -B1 Categories:| grep -v'^\\(--\\|Categories:\\|https:\\)' ) 83if string match -q -v --regex"^ " $l 84set cmd$l 85else 86set __fish_nmap_script_completion_cache$__fish_nmap_script_completion_cache \n $cmd \t ( string trim -l$l ) 87end 88end 89for catin all auth broadcast brute default discovery dos exploit external fuzzer intrusive malware safe version vuln 90set __fish_nmap_script_completion_cache$__fish_nmap_script_completion_cache \n $cat \t Category\n 91end 92end 93echo -e$__fish_nmap_script_completion_cache 94end 95complete -c nmap -l script -r -a"(__fish_stripprefix='^--script=' __fish_complete_list , __fish_complete_nmap_script)" 96complete -c nmap -l script -r -d'Runs a script scan' 97complete -c nmap -l script-args -d'provide arguments to NSE scripts' 98complete -c nmap -l script-args-file -r -d'load arguments to NSE scripts from a file' 99complete -c nmap -l script-help -r -a"(__fish_stripprefix='^--script-help=' __fish_complete_list , __fish_complete_nmap_script)" 100complete -c nmap -l script-help -r -d"Shows help about scripts" 101complete -c nmap -l script-trace 102complete -c nmap -l script-updatedb 103 104# TIMING AND PERFORMANCE 105complete -c nmap -l min-hostgroup -l max-hostgroup -x -d'Adjust parallel scan group size' 106complete -c nmap -l min-parallelism -l max-parallelism -x -d'Adjust probe parallelization' 107complete -c nmap -l min-rtt-timeout -l max-rtt-timeout -l initial-rtt-timeout -x -d'Adjust probe timeouts' 108complete -c nmap -l max-retries -x -d'Specify the maximum number of port scan probe retransmissions' 109complete -c nmap -l host-timeout -d'to skip slow hosts' 110complete -c nmap -l script-timeout -x 111complete -c nmap -l scan-delay -l max-scan-delay -x -d'Adjust delay between probes' 112complete -c nmap -l min-rate -l max-rate -x -d'Directly control the scanning rate' 113complete -c nmap -l defeat-rst-ratelimit -d'ignore ICMP-RST rate limits' 114complete -c nmap -l defeat-icmp-ratelimit -d'ignore ICMP unreachable in UDP' 115complete -c nmap -l nsock-engine -x -d'Enforce use of a given nsock IO multiplexing engine' -a"epoll kqueue poll select" 116function __fish_complete_nmap_timing-template 117set -l i0 118for tin paranoid sneaky polite normal aggressive insane 119printf "%i\t%s timing\n" $i $t 120printf "%s\tTemplate %i\n" $t $i 121set i( math $i +1 ) 122end 123end 124complete -c nmap -s T -x -a"(__fish_complete_nmap_timing-template)" -d'Set a timing template' 125 126# FIREWALL/IDS EVASION AND SPOOFING 127complete -c nmap -s f -d'fragment packets' -n"not __fish_contains_opt -s f" 128complete -c nmap -s f -d'use 16 bytes per fragment' -n"__fish_contains_opt -s f" 129complete -c nmap -l mtu -d'use specified mtu' -n"__fish_contains_opt -s f" 130complete -c nmap -s D -x -d'Cloak a scan with decoys' 131complete -c nmap -s S -x -d'Spoof source address' 132complete -c nmap -s e -x -d'Use specified interface' -a"(__fish_print_interfaces)" 133complete -c nmap -l source-port -s g -x -d'Spoof source port number' 134complete -c nmap -l data -x -d'Append custom binary data to sent packets' 135complete -c nmap -l data-string -x -d'Append custom string to sent packets' 136complete -c nmap -l data-length -x -d'Append random data to sent packets' 137function __fish_complete_nmap_ip-options 138printf "S\tstrict source routing\n" # may be followed by ip addresses 139printf "R\trecord route\n" # may be followed by ip addresses 140printf "L\tloose source routing\n" # may be followed by ip addresses 141printf "T\trecord internet timestamps\n" 142printf "U\trecord timestamps and ip addresses\n" 143end 144complete -c nmap -l ip-options -x -a"(__fish_complete_nmap_ip-options)" -d'Send packets with specified ip options' 145complete -c nmap -l ttl -x -d'Set IP time-to-live field' 146complete -c nmap -l randomize-hosts -d'Randomize target host order' 147complete -c nmap -l spoof-mac -x -d'Spoof MAC address' 148complete -c nmap -l proxies -x -d'Relay TCP connections through a chain of proxies' 149complete -c nmap -l badsum -d'Send packets with bogus TCP/UDP checksums' 150complete -c nmap -l adler32 -d'Use deprecated Adler32 instead of CRC32C for SCTP checksums' 151 152# OUTPUT 153complete -c nmap -o oN -r -d'normal output' 154complete -c nmap -o oX -r -d'XML output' 155complete -c nmap -o oS -r -d'ScRipT KIdd|3 oUTpuT' 156complete -c nmap -o oG -r -d'grepable output' 157complete -c nmap -o oA -r -d'Output in the three major formats' 158complete -c nmap -s v -d'Increase/Set verbosity level' 159complete -c nmap -s d -d'Increase/Set debugging level' -a'0 1 2 3 4 5 6 7 8 9' 160complete -c nmap -l reason -d'Host and port state reasons' 161complete -c nmap -l stats-every -x -d'Print periodic timing stats' 162complete -c nmap -l packet-trace -d'Trace packets and data sent and received' 163complete -c nmap -l open -d'Show only open (or possibly open) ports' 164complete -c nmap -l iflist -d'List interfaces and routes' 165complete -c nmap -l append-output -d'Append to rather than clobber output files' 166complete -c nmap -l resume -r -d'Resume aborted scan' 167complete -c nmap -l stylesheet -r -d'Set XSL stylesheet to transform XML output' 168complete -c nmap -l webxml -d'Load stylesheet from Nmap.Org' 169complete -c nmap -l no-stylesheet -d'Omit XSL stylesheet declaration from XML' 170 171# MISCELLANEOUS OPTIONS 172complete -c nmap -s6 -d'Enable IPv6 scanning' 173complete -c nmap -s A -d'Aggressive scan options' 174complete -c nmap -l datadir -x -a"(__fish_complete_directories)" -d'Specify custom Nmap data file location' 175complete -c nmap -l servicedb -r -d'Specify custom services file' 176complete -c nmap -l versiondb -r -d'Specify custom service probes file' 177complete -c nmap -l send-eth -d'Use raw ethernet sending' 178complete -c nmap -l send-ip -d'Send at raw IP level' 179complete -c nmap -l privileged -d'Assume that the user is fully privileged' 180complete -c nmap -l unprivileged -d'Assume that the user lacks raw socket privileges' 181complete -c nmap -l release-memory -d'Release memory before quitting' 182complete -c nmap -s V -l version -d'Print version number' 183complete -c nmap -s h -l help -d'Print help summary page'