pwntools是一个 CTF 框架和漏洞利用开发库,用 Python 开发,由 rapid 设计,旨在让使用者简单快速的编写 exploit。

网上针对 Mac OS 的安装教程大多都是基于 pip 安装的方式,无果,官方 Github 也没有相关的安装指南,文档于2016年就未再给出新的解决方案。Apple Store 在 2017 年在 Homebrew 提供了对 pwntools 的软件包的支持,给出了如下的解决方案。

  1. Press Command+Space and type Terminal and press enter/return key.
  2. Run in Terminal app:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

    and press enter/return key.

    If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
  3. Run:

    brew install pwntools

Done! You can now use pwntools.

针对上述解决方案,我尝试着进行了安装,未果,原因可能是因为 Mac OS 版本太低的问题,也通过 Python 的pip 安装,brew 安装的方式去尝试,都是失败,自己尝试编译源代码还是失败,最后查了一下资料,原来是缺少 Capstone,最终的解决方案在 stackoverflow 上找到了。

Capstone 是一个轻量级的多平台多架构支持的反汇编框架。支持包括 ARM,ARM64,MIPS 和 x86/x64 平台。

最终的解决方案如下:

capstone==3.0.5 still tries to build for both i386 and x86_64, this is already fixed on master and will be released with the next version. Looking at the Makefile, there are two possibilities:

  1. Turn off MACOS_UNIVERSAL

    $ MACOS_UNIVERSAL=no pip install capstone
  2. Install the development version from current master branch, with LIBARCHS already adapted for Mojave:

$ pip install "git+https://github.com/aquynh/capstone.git#egg=capstone&subdirectory=bindings/python"

Make sure you use quotes in the last command or escape the ampersand (&), otherwise bash will cut the command and run in background instead.

Once capstone is installed, you will have to deal with unicorn in the same manner and finally should be able to install pwntools. I didn't test it anymore, but the one-liner for the installation will be

$ MACOS_UNIVERSAL=no pip install pwntools

参考文献

Mac OSX(Mac OS10.11) 安装 pwntools 失败的最新解决方案的更多相关文章

  1. XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装Xcode4.6.3(有图有真相)

    网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 在安装Xcode前, ...

  2. XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装XE6的PAServer(有图有真相)

    XE6移动开发环境搭建之IOS篇(7):在Mac OSX 10.8中安装XE6的PAServer(有图有真相) 2014-08-22 21:06 网上能找到的关于Delphi XE系列的移动开发环境的 ...

  3. XE6移动开发环境搭建之IOS篇(8):在Mac OSX 10.8中安装XE6的PAServer(有图有真相)

    网上能找到的关于Delphi XE系列的移动开发环境的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 安装PAServer ...

  4. 在Mac OSX 10.10 上安装opencv

    http://blog.csdn.net/wdkirchhoff/article/details/41910553 在Mac OSX上如果想使用OpenCV,可以通过自己手动编译源码的方式,但比较繁琐 ...

  5. Mac OSX 下用 Homebrew 安装 MongoDB 并配置到 WebStorm 中

    1. 安装 Ruby OSX 操作系统内置 Ruby,但如果没有 Ruby,则需先输入以下命令安装能够进行多版本ruby环境安装.管理和切换的命令行工具 RVM. 1.1 安装 RVM 打开终端输入以 ...

  6. MAC OSX 10.10 下安装PHP环境

    Apache和PHP已经在系统里面预装好了,只要你开启即可使用.这篇文章给大家介绍如何开启并设置好PHP开发环境. 1.开启默认Apache服务 打开终端命令行,输入如下命令就会开启Apache了.然 ...

  7. MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法

    http://blog.csdn.NET/wave_1102/article/details/37730589 今天在Mac下用pip安装lxml,总是报如下错误: etree_defs.h::: f ...

  8. 解决 Mac OS X 10.11 安装 sip 没有权限的问题

    在搭建 PYQT 的过程中我遇上了一个非常恶心的问题,在安装 sip 的时候编译源代码之后的安装过程中一直提示我:Operation not permitted ,我甚至重装了系统也无济于事,终于通过 ...

  9. Mac OSX 正确地同时安装Python 2.7 和Python3

    出处:http://www.jianshu.com/p/51811fa24752 python3 默认安装位置:/usr/local/Cellar/python3

随机推荐

  1. 深入理解JVM虚拟机(二):JDK 内存类的异常分析

    JVM数据存储 堆存储(Heap):对象存储,实际上就是JAVA的数据存储 方法堆栈(Method Stack):存储方法调用的关系. 永久代(Perm):在JDK1.6及之前,常量数据存储于此区域 ...

  2. [转]Oracle 11g R2 RAC高可用连接特性 – SCAN详解

    原文地址:http://czmmiao.iteye.com/blog/2124373   昨天帮朋友解决11g RAC SCAN问题,当时为这朋友简单解答了一些SCAN特性相关的问题,但我知道这仅仅是 ...

  3. 使用Apache服务部署静态网站2019-7-5

    使用Apache服务部署静态网站 第1步:把镜像挂载到系统中 第2步:使用vim文件编辑器创建YUM仓库的配置文件 [root@study ~]# vim /etc/yum.repos.d/abc.r ...

  4. Jmeter之BeanShell

    在Jmeter中各种分类组件中都有相应的BeanShell组件,这里简单的说明一下Beanshell的使用. 一.概念 BeanShell是一种符合Java语法的脚本语言,也有自己的一些特定语法 二. ...

  5. CF798D Mike and distribution

    CF798D Mike and distribution 洛谷评测传送门 题目描述 Mike has always been thinking about the harshness of socia ...

  6. ionic4之ion-sliders

    <ion-content class="details_"> <img class="courimg_" src="assets/i ...

  7. 在线程内关闭thread handle,导致server crash

    很多年以前了,那时tester发现一个server crash,通过测试pager功能很多次,可以把server搞崩溃. 一般来说,能再现的bug都不难改,不过这次因为要跑很多次test,才能再现cr ...

  8. 关于XSS攻击

    1.XSS XSS(Cross Site Scripting)攻击全称跨站脚本攻击,为了不与CSS(Cascading Style Sheets)混淆,故将跨站脚本攻击缩写为XSS,XSS是一种经常出 ...

  9. systemdump相关

    /vendor/sprd/open-source/tools/crashcat sysdump.core.* > dump.bincrash -m phys_base=0x80000000 du ...

  10. 数据仓库009 - SQL命令实战 - where GROUP BY join 部门综合案例

    一.where条件 WHERE 子句中主要的运算符,可以在 WHERE 子句中使用,如下表: 运算符 描述 = 等于 <> 不等于.注释:在 SQL 的一些版本中,该操作符可被写成 != ...