Veil安装失败的解决方法

简介

项目地址:Veil-Framework/Veil: Veil 3.1.X (Check version info in Veil at runtime)
项目依赖地址:Veil-Framework/VeilDependencies: Dependencies for Veil 3


github网络不稳定导致安装中断

解决方法:指定git仓库

打开veil目录下config文件夹中的setup.sh文件(kali下为/usr/share/veil/config/setup.sh

修改为自己的仓库(gitee开始需要审查才能公开、登陆才能查看,但是试了下之前转存的还是可以直接clone下来)

- sudo git clone https://github.com/Veil-Framework/VeilDependencies.git "${dependenciesdir}"` 
+ sudo git clone https://gitee.com/cnlnn/VeilDependencies.git "${dependenciesdir}"

或使用github镜像站加速

sudo git clone https://raw.fastgit.org/Veil-Framework/VeilDependencies.git "${dependenciesdir}"

pip网络不稳定导致安装中断

解决方法:指定pip源

打开setup.sh文件,分别找到以下三行

sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip==19.1.*"

sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future"

sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile"

各行行末添加国内源,例如清华镜像源: "-i" "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"

  ## Use wine based pip to install dependencies
  echo -e "\n\n [*] ${YELLOW}Installing (Wine) Python's PIP pefile${RESET}\n"
- sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip==19.1.*"
+ sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip==19.1.*" "-i" "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

- sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future"
+ sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future" "-i" "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip future... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

- sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile"
+ sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile" "-i" "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip pefile... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

中文编码导致pip install中断

pip install失败截图

安装过程报错

OSError: [Errno 22] Invalid argument
Exception ignored in: <_io.TextIOWrapper name=’‘ mode=’w’ encoding=’cp936’>

veil安装错误代码

Failed to run (wine) Python pip… Exit code: 2
Failed to run (wine) Python pip future… Exit code: 2
Failed to run (wine) Python pip pefile… Exit code: 2

解决方法:切换英文环境

切换到英文环境下安装,暂时没想到别的方法。。。

sudo dpkg-reconfigure locales

python版本过低导致无法安装

安装过程报错

RuntimeError: Python 3.5 or later is required

veil安装错误代码

[ERROR] Failed to run (wine) Python pip future … Exit code:1
[ERROR] Failed to run (wine) Python pip pefile … Exit code:1

解决方法1:指定版本号(推荐)

官方解决方法是指定版本号

修改setup.sh文件

- sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade"
+ sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip==19.1.*"

解决方法2:更换安装顺序

脚本默认安装顺序
pip install –upgrade pip –> pip install future –> pip install pefile
setup.sh未修改前

改成pip install future –> pip install pefile –> pip install –upgrade pip

  echo -e "\n\n [*] ${YELLOW}Installing (Wine) Python's PIP pefile${RESET}\n"
  sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip future... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

  sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip pefile... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

  sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip"
  tmp="$?"
  if [[ "${tmp}" -ne "0" ]]; then
    msg="Failed to run (wine) Python pip... Exit code: ${tmp}"
    errors="${errors}\n${msg}"
    echo -e " ${RED}[ERROR] ${msg}${RESET}\n"
  fi

安装pefile失败

安装pefile失败报错

报错信息如下

Collecting pefile
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/dc/8e/99fde2fe50afebbb1ef6f46508203e66e45c6e3966caacd219152c8a52e1/pefile-2021.5.24.tar.gz (66kB)
100% |################################| 69kB 630kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File ““, line 20, in
File “C:\users\user\Temp\pip-build-q5m_9zs7\pefile\setup.py”, line 86, in
long_description = “\n”.join(_read_doc().split(‘\n’)),
File “C:\users\user\Temp\pip-build-q5m_9zs7\pefile\setup.py”, line 33, in _read_doc
tree = ast.parse(f.read())
File “C:\Python34\lib\ast.py”, line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File ““, line 3789
f’Export directory contains more than 10 repeated entries ‘
^
SyntaxError: invalid syntax


Command “python setup.py egg_info” failed with error code 1 in C:\users\user\Temp\pip-build-q5m_9zs7\pefile

解决方法:指定pefile版本号

可以看到版本更新时间跨度很大,并且这个错误出现也是2021出新版之后,所以只需指定版本到2019.4.18即可安装成功

pefile Release history

修改setup.sh

- sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile"
+ sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "pefile==2019.4.18"

转载请注明来源,欢迎对文章中的引用来源进行考证,文章可能具有时效性,欢迎指出任何有错误、已失效或不够清晰的表达 ,可通过[邮件](mailto:cnlnnn@qq.com)联系垃圾堆主人

文章标题:Veil安装失败的解决方法

字数:1.7k

本文作者:cnlnn

发布时间:2020-04-06, 12:21:19

最后更新:2021-10-01, 20:30:12

原始链接:https://cnlnn.ml/posts/7fb3d092/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。