|
| 1 | +#compdef msfvenom |
| 2 | +# ------------------------------------------------------------------------------ |
| 3 | +# License |
| 4 | +# ------- |
| 5 | +# This file is part of the Metasploit Framework and is released under the MSF |
| 6 | +# License, please see the COPYING file for more details. |
| 7 | +# |
| 8 | +# ------------------------------------------------------------------------------ |
| 9 | +# Description |
| 10 | +# ----------- |
| 11 | +# |
| 12 | +# Completion script for the Metasploit Framework's msfvenom command |
| 13 | +# (http://www.metasploit.com/). |
| 14 | +# |
| 15 | +# ------------------------------------------------------------------------------ |
| 16 | +# Authors |
| 17 | +# ------- |
| 18 | +# |
| 19 | +# * Spencer McIntyre |
| 20 | +# |
| 21 | +# ------------------------------------------------------------------------------ |
| 22 | + |
| 23 | +_msfvenom_encoders_list=( |
| 24 | + 'cmd/generic_sh' |
| 25 | + 'cmd/ifs' |
| 26 | + 'cmd/powershell_base64' |
| 27 | + 'cmd/printf_php_mq' |
| 28 | + 'generic/eicar' |
| 29 | + 'generic/none' |
| 30 | + 'mipsbe/byte_xori' |
| 31 | + 'mipsbe/longxor' |
| 32 | + 'mipsle/byte_xori' |
| 33 | + 'mipsle/longxor' |
| 34 | + 'php/base64' |
| 35 | + 'ppc/longxor' |
| 36 | + 'ppc/longxor_tag' |
| 37 | + 'sparc/longxor_tag' |
| 38 | + 'x64/xor' |
| 39 | + 'x86/add_sub' |
| 40 | + 'x86/alpha_mixed' |
| 41 | + 'x86/alpha_upper' |
| 42 | + 'x86/avoid_underscore_tolower' |
| 43 | + 'x86/avoid_utf8_tolower' |
| 44 | + 'x86/bloxor' |
| 45 | + 'x86/call4_dword_xor' |
| 46 | + 'x86/context_cpuid' |
| 47 | + 'x86/context_stat' |
| 48 | + 'x86/context_time' |
| 49 | + 'x86/countdown' |
| 50 | + 'x86/fnstenv_mov' |
| 51 | + 'x86/jmp_call_additive' |
| 52 | + 'x86/nonalpha' |
| 53 | + 'x86/nonupper' |
| 54 | + 'x86/opt_sub' |
| 55 | + 'x86/shikata_ga_nai' |
| 56 | + 'x86/single_static_bit' |
| 57 | + 'x86/unicode_mixed' |
| 58 | + 'x86/unicode_upper' |
| 59 | +) |
| 60 | + |
| 61 | +_msfvenom_encoder() { |
| 62 | + _describe -t encoders 'available encoders' _msfvenom_encoders_list || compadd "$@" |
| 63 | +} |
| 64 | + |
| 65 | +_arguments \ |
| 66 | + {-a,--arch}"[The architecture to encode as]:architecture:(cmd generic mipsbe mipsle php ppc sparc x64 x86)" \ |
| 67 | + {-b,--bad-chars}"[The list of characters to avoid, example: '\x00\xff']:bad characters" \ |
| 68 | + {-c,--add-code}"[Specify an additional win32 shellcode file to include]:shellcode file:_files" \ |
| 69 | + {-e,--encoder}"[The encoder to use]:encoder:_msfvenom_encoder" \ |
| 70 | + {-f,--format}"[Output format]:output format:(bash c csharp dw dword java js_be js_le num perl pl powershell ps1 py python raw rb ruby sh vbapplication vbscript asp aspx aspx-exe dll elf exe exe-only exe-service exe-small loop-vbs macho msi msi-nouac osx-app psh psh-net psh-reflection vba vba-exe vbs war)" \ |
| 71 | + "--help-formats[List available formats]" \ |
| 72 | + {-h,--help}"[Help banner]" \ |
| 73 | + {-i,--iterations}"[The number of times to encode the payload]:iterations" \ |
| 74 | + {-k,--keep}"[Preserve the template behavior and inject the payload as a new thread]" \ |
| 75 | + {-l,--list}"[List a module type]:module type:(all encoders nops payloads)" \ |
| 76 | + {-n,--nopsled}"[Prepend a nopsled of length size on to the payload]:nopsled length" \ |
| 77 | + {-o,--options}"[List the payload's standard options]" \ |
| 78 | + "--platform[The platform to encode for]:target platform:(android bsd bsdi java linux netware nodejs osx php python ruby solaris unix win)" \ |
| 79 | + {-p,--payload}"[Payload to use. Specify a '-' or stdin to use custom payloads]:payload" \ |
| 80 | + {-s,--space}"[The maximum size of the resulting payload]:length" \ |
| 81 | + {-x,--template}"[Specify an alternate executable template]:template file:_files" |
0 commit comments