热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

20191211:kalilinux工具Msfvenom命令自动补全

msfvenom大家都不陌生,在我们使用MSF进行权限维持,内网渗透的时候都会用到,支持的语言的种类很多。大家都知道我们在使用msfvenom的时候需要手动输入很多参数,这些参

msfvenom大家都不陌生,在我们使用MSF进行权限维持,内网渗透的时候都会用到,支持的语言的种类很多。大家都知道我们在使用msfvenom 的时候需要手动输入很多参数,这些参数需要记忆,或记在其它地方,用的时候在查看使用哪个参数,哪条命令,非常的不方便。现在分享一个msfvenom命令自动不全的方法

1,安装oh-my-zsh

官网 https://ohmyz.sh/

官网发的安装命令 

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

或者 sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

因为kali虚拟机里无法访问https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh,所以我把网站里的脚本命令全都复制出来,新建了一个脚本直接执行,也可以安装,以下红色字体为脚本代码,如有需要请复制

#!/bin/sh
#
# This script should be run via curl:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or wget:
# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
# wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
# sh install.sh
#
# You can tweak the install behavior by setting variables when running the script. For
# example, to change the path to the Oh My Zsh repository:
# ZSH=~/.zsh sh install.sh
#
# Respects the following environment variables:
# ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
# REPO - name of the GitHub repo to install from (default: ohmyzsh/ohmyzsh)
# REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
# BRANCH - branch to check out immediately after install (default: master)
#
# Other options:
# CHSH - 'no' means the installer will not change the default shell (default: yes)
# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes)
#
# You can also pass some arguments to the install script to set some these options:
# --skip-chsh: has the same behavior as setting CHSH to 'no'
# --unattended: sets both CHSH and RUNZSH to 'no'
# For example:
# sh install.sh --unattended
#
set -e
# Default settings
ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
# Other options
CHSH=${CHSH:-yes}
RUNZSH=${RUNZSH:-yes}
command_exists() {
command -v "$@" >/dev/null 2>&1
}
error() {
echo ${RED}"Error: $@"${RESET} >&2
}
setup_color() {
# Only use colors if connected to a terminal
if [ -t 1 ]; then
RED=$(printf '\033[31m')
GREEN=$(printf '\033[32m')
YELLOW=$(printf '\033[33m')
BLUE=$(printf '\033[34m')
BOLD=$(printf '\033[1m')
RESET=$(printf '\033[m')
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
RESET=""
fi
}
setup_ohmyzsh() {
# Prevent the cloned repository from having insecure permissions. Failing to do
# so causes compinit() calls to fail with "command not found: compdef" errors
# for users with insecure umasks (e.g., "002", allowing group writability). Note
# that this will be ignored under Cygwin by default, as Windows ACLs take
# precedence over umasks except for filesystems mounted with option "noacl".
umask g-w,o-w
echo "${BLUE}Cloning Oh My Zsh...${RESET}"
command_exists git || {
error "git is not installed"
exit 1
}
if [ "$OSTYPE" = cygwin ] && git --version | grep -q msysgit; then
error "Windows/MSYS Git is not supported on Cygwin"
error "Make sure the Cygwin git package is installed and is first on the \$PATH"
exit 1
fi
git clone -c core.eol=lf -c core.autocrlf=false \
-c fsck.zeroPaddedFilemode=ignore \
-c fetch.fsck.zeroPaddedFilemode=ignore \
-c receive.fsck.zeroPaddedFilemode=ignore \
--depth=1 --branch "$BRANCH" "$REMOTE" "$ZSH" || {
error "git clone of oh-my-zsh repo failed"
exit 1
}
echo
}
setup_zshrc() {
# Keep most recent old .zshrc at .zshrc.pre-oh-my-zsh, and older ones
# with datestamp of installation that moved them aside, so we never actually
# destroy a user's original zshrc
echo "${BLUE}Looking for an existing zsh config...${RESET}"
# Must use this exact name so uninstall.sh can find it
OLD_ZSHRC=~/.zshrc.pre-oh-my-zsh
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
if [ -e "$OLD_ZSHRC" ]; then
OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"
if [ -e "$OLD_OLD_ZSHRC" ]; then
error "$OLD_OLD_ZSHRC exists. Can't back up ${OLD_ZSHRC}"
error "re-run the installer again in a couple of seconds"
exit 1
fi
mv "$OLD_ZSHRC" "${OLD_OLD_ZSHRC}"
echo "${YELLOW}Found old ~/.zshrc.pre-oh-my-zsh." \
"${GREEN}Backing up to ${OLD_OLD_ZSHRC}${RESET}"
fi
echo "${YELLOW}Found ~/.zshrc.${RESET} ${GREEN}Backing up to ${OLD_ZSHRC}${RESET}"
mv ~/.zshrc "$OLD_ZSHRC"
fi
echo "${GREEN}Using the Oh My Zsh template file and adding it to ~/.zshrc.${RESET}"
cp "$ZSH/templates/zshrc.zsh-template" ~/.zshrc
sed "/^export ZSH=/ c\\
export ZSH=\"$ZSH\"
" ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
echo
}
setup_shell() {
# Skip setup if the user wants or stdin is closed (not running interactively).
if [ $CHSH = no ]; then
return
fi
# If this user's login shell is already "zsh", do not attempt to switch.
if [ "$(basename "$SHELL")" = "zsh" ]; then
return
fi
# If this platform doesn't provide a "chsh" command, bail out.
if ! command_exists chsh; then
cat <<-EOF
I can&#39;t change your shell automatically because this system does not have chsh.
${BLUE}Please manually change your default shell to zsh${RESET}
EOF
return
fi
echo "${BLUE}Time to change your default shell to zsh:${RESET}"
# Prompt for user choice on changing the default login shell
printf "${YELLOW}Do you want to change your default shell to zsh? [Y/n]${RESET} "
read opt
case $opt in
y*|Y*|"") echo "Changing the shell..." ;;
n*|N*) echo "Shell change skipped."; return ;;
*) echo "Invalid choice. Shell change skipped."; return ;;
esac
# Check if we&#39;re running on Termux
case "$PREFIX" in
*com.termux*) termux=true; zsh=zsh ;;
*) termux=false ;;
esac
if [ "$termux" != true ]; then
# Test for the right location of the "shells" file
if [ -f /etc/shells ]; then
shells_file=/etc/shells
elif [ -f /usr/share/defaults/etc/shells ]; then # Solus OS
shells_file=/usr/share/defaults/etc/shells
else
error "could not find /etc/shells file. Change your default shell manually."
return
fi
# Get the path to the right zsh binary
# 1. Use the most preceding one based on $PATH, then check that it&#39;s in the shells file
# 2. If that fails, get a zsh path from the shells file, then check it actually exists
if ! zsh=$(which zsh) || ! grep -qx "$zsh" "$shells_file"; then
if ! zsh=$(grep &#39;^/.*/zsh$&#39; "$shells_file" | tail -1) || [ ! -f "$zsh" ]; then
error "no zsh binary found or not present in &#39;$shells_file&#39;"
error "change your default shell manually."
return
fi
fi
fi
# We&#39;re going to change the default shell, so back up the current one
if [ -n "$SHELL" ]; then
echo $SHELL > ~/.shell.pre-oh-my-zsh
else
grep "^$USER:" /etc/passwd | awk -F: &#39;{print $7}&#39; > ~/.shell.pre-oh-my-zsh
fi
# Actually change the default shell to zsh
if ! chsh -s "$zsh"; then
error "chsh command unsuccessful. Change your default shell manually."
else
export SHELL="$zsh"
echo "${GREEN}Shell successfully changed to &#39;$zsh&#39;.${RESET}"
fi
echo
}
main() {
# Run as unattended if stdin is closed
if [ ! -t 0 ]; then
RUNZSH=no
CHSH=no
fi
# Parse arguments
while [ $# -gt 0 ]; do
case $1 in
--unattended) RUNZSH=no; CHSH=no ;;
--skip-chsh) CHSH=no ;;
esac
shift
done
setup_color
if ! command_exists zsh; then
echo "${YELLOW}Zsh is not installed.${RESET} Please install zsh first."
exit 1
fi
if [ -d "$ZSH" ]; then
cat <<-EOF
${YELLOW}You already have Oh My Zsh installed.${RESET}
You&#39;ll need to remove &#39;$ZSH&#39; if you want to reinstall.
EOF
exit 1
fi
setup_ohmyzsh
setup_zshrc
setup_shell
printf "$GREEN"
cat <<-&#39;EOF&#39;
__ __
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us on https://twitter.com/ohmyzsh
p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh
EOF
printf "$RESET"
if [ $RUNZSH = no ]; then
echo "${YELLOW}Run zsh to try it out.${RESET}"
exit
fi
exec zsh -l
}
main "$@"

创建脚本文件vim oh-my-zsh

之后,添加脚本执行权限,chmod a+x&#160;

然后./oh-my-zsh执行脚本

2,脚本执行完成,会出现以下界面,oh-my-zsh需要依赖zsh,所以系统没安装zsh的话,需要安装下依赖

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

3,oh-my-zsh需要依赖zsh,如果系统下没安装zsh,可以使用apt进行安装,apt-get install zsh,因为kali系统默认安装有所以不需要安装

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

&#160;4,安装自动不全脚本,运行命令:git clone https://github.com/Green-m/msfvenom-zsh-completion ~/.oh-my-zsh/custom/plugins/msfvenom/

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

&#160;查看是否已下载好_msfvenom 文件,ls ~/.oh-my-zsh/custom/plugins/msfvenom&#160;

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

使用随便一种文本编辑器打开 ~/.zshrc 文件,我使用的vim编辑器打开添加

vim ~/.zshrc

找到 plugins=(git) 将 msfvenom 添加到里面 plugins=(gitmsfvenom)

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

然后在最后添加

fpath=(~/.zsh/completion $fpath)($fpath 通过添加来包含您的目录~/.zshrc)

autoload -Uz compinit && compinit -i (确保 compinit 已加载或通过添加~/.zshrc)

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

之后保存退出编辑界面

5,实现了msfvenom的自动不全,需要zsh的shell下执行

首先输入zsh进入zsh的shell下

然后输入msfvenom - ,之后按TAB就会出现提示

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

msfvenom -l

2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

&#160;

&#160;msfvenom -p windows/

&#160;2019-12-11:kali linux工具Msfvenom 命令自动补全 - 文章图片

&#160;

&#160;

&#160;


推荐阅读
  • Android中高级面试必知必会,积累总结
    本文介绍了Android中高级面试的必知必会内容,并总结了相关经验。文章指出,如今的Android市场对开发人员的要求更高,需要更专业的人才。同时,文章还给出了针对Android岗位的职责和要求,并提供了简历突出的建议。 ... [详细]
  • 和数|这一点_5 个让日常编码更简单的 Python 库
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了5个让日常编码更简单的Python库相关的知识,希望对你有一定的参考价值。今天我们一起来研究一些非常有用的第三方模 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • CentOS 7部署KVM虚拟化环境之一架构介绍
    本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
  • 寻求更强大的身份和访问管理(IAM)平台的企业正在转向云,并接受身份即服务(IDaaS)的灵活性。要为IAM选择正确的场外解决方案,业务管理人员和IT专业人员必须在实施之前评估安全 ... [详细]
  • 初识java关于JDK、JRE、JVM 了解一下 ... [详细]
  • Android系统启动过程分析一、Android平台架构首先贴一张Android系统架构图方便理解整个Android架构,这可以让我们从整体上对整个启动流程有个大概认知。可以看出整 ... [详细]
  • Android NDK开发的一点尝试
    写在前面笔者是一个“原始”的C++开发者,对Java编程虽说不上抵触但也没有C++那么顺手。而且,作为一个游戏引擎,不管是在什么地方,效率总是第一位的,尤其是在移动平台这样资源吃紧 ... [详细]
  • nvm如何改node默认版本
    小编给大家分享一下nvm如何改node默认版本,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!nvm改node默认版 ... [详细]
  • Centos7安装高版本zshzim框架安装powerlevel10k
    1.安装高版本zsh1.1卸载低版本zshsudoyumremovezsh-y1.2下载源码源码:https:zsh.sourceforge.ioArcsour ... [详细]
  • 本篇博文面向Linux用户,在Linux下(0x00为什么需要有两个版本的PythonPython2和Python3不兼容是每个接触过Python的那就把Python ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
author-avatar
小小小菜鸡
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有