fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmReformat share/**.fish with newlines collapsed78c948282

master
4.1 KiB74 linesraw
1function __fish_msf_db_running
2    msfdb status 2>/dev/null | string match -q -r 'Database started|Active: active'
3end
4
5function __fish_complete_msf_payloads
6    if not set -q __fish_msf_cached_payloads; and __fish_msf_db_running
7        set -g __fish_msf_cached_payloads (msfvenom -l payloads | string replace -f -r '^\s*([[:lower:]]\S*)\s+(\S.*)' '$1\t$2' | string collect)
8    end
9    echo $__fish_msf_cached_payloads
10end
11
12function __fish_complete_msf_formats
13    if not set -q __fish_msf_cached_formats; and __fish_msf_db_running
14        set -g __fish_msf_cached_formats (msfvenom -l formats | string replace -f -r '^\s*([[:lower:]]\S*)' '$1' | string collect)
15    end
16    echo $__fish_msf_cached_formats
17end
18
19function __fish_complete_msf_encoders
20    if not set -q __fish_msf_cached_encoders; and __fish_msf_db_running
21        set -g __fish_msf_cached_encoders (msfvenom -l encoders | string replace -f -r '^\s*([[:lower:]]\S*)\s+\S+\s+(\S.*)' '$1\t$2' | string collect)
22    end
23    echo $__fish_msf_cached_encoders
24end
25
26function __fish_complete_msf_encrypt
27    if not set -q __fish_msf_cached_encrypt; and __fish_msf_db_running
28        set -g __fish_msf_cached_encrypt (msfvenom -l encrypt | string replace -f -r '^\s*([[:lower:]]\S*)' '$1' | string collect)
29    end
30    echo $__fish_msf_cached_encrypt
31end
32
33function __fish_complete_msf_archs
34    if not set -q __fish_msf_cached_archs; and __fish_msf_db_running
35        set -g __fish_msf_cached_archs (msfvenom -l archs | string replace -f -r '^\s*([[:lower:]]\S*)' '$1' | string collect)
36    end
37    echo $__fish_msf_cached_archs
38end
39
40function __fish_complete_msf_platforms
41    if not set -q __fish_msf_cached_platforms; and __fish_msf_db_running
42        set -g __fish_msf_cached_platforms (msfvenom -l platforms | string replace -f -r '^\s*([[:lower:]]\S*)' '$1' | string collect)
43    end
44    echo $__fish_msf_cached_platforms
45end
46
47complete -c msfvenom -f
48
49complete -c msfvenom -s l -l list -xa 'payloads encoders nops platforms archs encrypt formats all' -d 'List all modules for type'
50complete -c msfvenom -s p -l payload -xa "(__fish_complete_msf_payloads)" -d 'Payload to use'
51complete -c msfvenom -l list-options -d 'List options for payload'
52complete -c msfvenom -s f -l format -xa "(__fish_complete_msf_formats)" -d 'Output format'
53complete -c msfvenom -s e -l encoder -xa "(__fish_complete_msf_encoders)" -d 'The encoder to use'
54complete -c msfvenom -l service-name -x -d 'Service name to use when generating a service binary'
55complete -c msfvenom -l sec-name -x -d 'Section name when generating Windows binaries'
56complete -c msfvenom -l smallest -d 'Generate the smallest possible payload'
57complete -c msfvenom -l encrypt -xa "(__fish_complete_msf_encrypt)" -d 'Type of encryption to apply to the shellcode'
58complete -c msfvenom -l encrypt-key -x -d 'A key to be used for --encrypt'
59complete -c msfvenom -l encrypt-iv -x -d 'An initialization vector for --encrypt'
60complete -c msfvenom -s a -l arch -xa "(__fish_complete_msf_archs)" -d 'The architecture to use'
61complete -c msfvenom -l platform -xa "(__fish_complete_msf_platforms)" -d 'The platform to use'
62complete -c msfvenom -s o -l out -F -d 'Save the payload to a file'
63complete -c msfvenom -s b -l bad-chars -x -d 'Characters to avoid'
64complete -c msfvenom -s n -l nopsled -x -d 'Prepend a nopsled'
65complete -c msfvenom -l pad-nops -d 'Use nopsled size as total payload size'
66complete -c msfvenom -s s -l space -x -d 'Maximum size of the resulting payload'
67complete -c msfvenom -l encoder-space -x -d 'Maximum size of the encoded payload'
68complete -c msfvenom -s i -l iterations -x -d 'Number of times to encode the payload'
69complete -c msfvenom -s c -l add-code -F -d 'Additional win32 shellcode file to include'
70complete -c msfvenom -s x -l template -F -d 'Custom executable file to use as a template'
71complete -c msfvenom -s k -l keep -d 'Inject the payload as a new thread (for template)'
72complete -c msfvenom -s v -l var-name -x -d 'Custom variable name for certain output formats'
73complete -c msfvenom -s t -l timeout -x -d 'Number of seconds to wait when reading the payload'
74complete -c msfvenom -s h -l help -d 'Show help message'