diff options
-rw-r--r-- | debian/README.Debian | 4 | ||||
-rw-r--r-- | debian/changelog | 74 | ||||
-rw-r--r-- | debian/clean | 2 | ||||
-rw-r--r-- | debian/control | 71 | ||||
-rw-r--r-- | debian/copyright | 101 | ||||
-rw-r--r-- | debian/gbp.conf | 2 | ||||
-rw-r--r-- | debian/patches/0001-Remove-check-for-unneeded-development-headers.patch | 25 | ||||
-rw-r--r-- | debian/patches/0002-Do-not-pollute-usr-bin-with-random-scripts.patch | 37 | ||||
-rw-r--r-- | debian/patches/0003-Do-not-install-documentation-to-usr-lib-python3.patch | 22 | ||||
-rw-r--r-- | debian/patches/0004-Use-python3-in-doctests.patch | 68 | ||||
-rw-r--r-- | debian/patches/0005-Disable-automatic-update-check.patch | 30 | ||||
-rw-r--r-- | debian/patches/series | 5 | ||||
-rw-r--r-- | debian/python-pwntools-doc.doc-base | 10 | ||||
-rw-r--r-- | debian/python-pwntools-doc.docs | 4 | ||||
-rwxr-xr-x | debian/rules | 16 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/source/lintian-overrides | 5 | ||||
-rw-r--r-- | debian/watch | 4 |
18 files changed, 481 insertions, 0 deletions
diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..f8f08f0 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,4 @@ +The Debianized version of pwntools does not install the various helper +scripts in /usr/bin to prevent namespace pollution. Please access all +tools via the main "pwn" CLI command. + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c965656 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,74 @@ +pwntools (4.11.1-1) unstable; urgency=medium + + * New upstream version 4.11.1 + * Refresh patches + * Update d/copyright + + -- Timo Röhling <roehling@debian.org> Wed, 15 Nov 2023 17:55:27 +0100 + +pwntools (4.11.0-1) unstable; urgency=medium + + * New upstream version 4.11.0 + * Switch to pybuild-plugin-pyproject + + -- Timo Röhling <roehling@debian.org> Sat, 16 Sep 2023 11:25:25 +0200 + +pwntools (4.10.0-1) unstable; urgency=medium + + * New upstream version 4.10.0 + * Bump Standards-Version to 4.6.2 + + -- Timo Röhling <roehling@debian.org> Mon, 12 Jun 2023 13:38:14 +0200 + +pwntools (4.9.0-1) unstable; urgency=medium + + * Use mode=git for d/watch + * New upstream version 4.9.0 + * Refresh patches + - Drop 0004-Use-sphinx.ext.napoleon-instead-of-sphinxcontrib.nap.patch + (fixed upstream) + - Drop 0007-Workaround-for-RWX-segment-warnings-in-GNU-ld.patch + (fixed upstream) + + -- Timo Röhling <roehling@debian.org> Mon, 02 Jan 2023 21:16:46 +0100 + +pwntools (4.9.0~beta0-2) unstable; urgency=medium + + [ Debian Janitor ] + * debian/copyright: use spaces rather than tabs to start continuation lines. + * Set field Upstream-Name in debian/copyright. + + -- Jelmer Vernooij <jelmer@debian.org> Fri, 14 Oct 2022 12:28:22 +0100 + +pwntools (4.9.0~beta0-1) unstable; urgency=medium + + * Fix d/watch + * New upstream version 4.9.0~beta0 + - Fix ELF.libc_start_main_return with glibc 2.34+ + * Workaround for RWX segment warnings in GNU ld + * Update Recommends and Suggests + + -- Timo Röhling <roehling@debian.org> Thu, 29 Sep 2022 21:25:57 +0200 + +pwntools (4.8.0-2) unstable; urgency=medium + + * Bump Standards-Version to 4.6.1 + * Make sphinx build date deterministic + * Remove broken auto-generated autopkgtest + * Add suggestions for useful tools + * Fix d/clean + * Add lintian overrides for test binaries + + -- Timo Röhling <roehling@debian.org> Thu, 08 Sep 2022 13:02:40 +0200 + +pwntools (4.8.0-1) unstable; urgency=medium + + * New upstream version 4.8.0 + + -- Timo Röhling <roehling@debian.org> Wed, 27 Apr 2022 01:08:26 +0200 + +pwntools (4.7.0-1) unstable; urgency=medium + + * Initial release. (Closes: #1002935) + + -- Timo Röhling <roehling@debian.org> Mon, 11 Apr 2022 20:24:37 +0200 diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..1e93fe6 --- /dev/null +++ b/debian/clean @@ -0,0 +1,2 @@ +docs/build/ +*.egg-info/ diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..9638fac --- /dev/null +++ b/debian/control @@ -0,0 +1,71 @@ +Source: pwntools +Maintainer: Debian Python Team <team+python@tracker.debian.org> +Uploaders: Timo Röhling <roehling@debian.org> +Section: python +Priority: optional +Build-Depends: + debhelper-compat (= 13), + dh-python, + dh-sequence-python3, + dh-sequence-sphinxdoc <!nodoc>, + pandoc, + pybuild-plugin-pyproject, + python3-all, + python3-capstone, + python3-colored-traceback, + python3-dateutil, + python3-intervaltree, + python3-mako, + python3-packaging, + python3-paramiko, + python3-pip, + python3-psutil, + python3-pyelftools, + python3-pygments, + python3-requests, + python3-ropgadget, + python3-rpyc, + python3-serial, + python3-setuptools, + python3-socks, + python3-sortedcontainers, + python3-sphinx <!nodoc>, + python3-sphinxcontrib.autoprogram <!nodoc>, + python3-unicorn, +Standards-Version: 4.6.2 +Vcs-Git: https://salsa.debian.org/python-team/packages/pwntools.git +Vcs-Browser: https://salsa.debian.org/python-team/packages/pwntools +Homepage: https://pwntools.com +Rules-Requires-Root: no +Description: CTF framework and exploit development library + pwntools is designed for rapid prototyping and development, to make + exploit writing as simple as possible. The primary use cases of this + framework are CTF hacking contests, where vulnerabilities in a sandbox + environment are exploited to gain access to a "flag" file or a secret + string, as proof of successful infiltration. + +Package: python3-pwntools +Architecture: all +Depends: + ${misc:Depends}, + ${python3:Depends}, +Recommends: + gdb, + gdbserver, +Suggests: + gdb-multiarch, + qemu-user-static, +Description: ${source:Synopsis} + ${source:Extended-Description} + +Package: python-pwntools-doc +Section: doc +Architecture: all +Multi-Arch: foreign +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Description: ${source:Synopsis} (documentation) + ${source:Extended-Description} + . + This package installs the API documentation for pwntools diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5530068 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,101 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pwntools + +Files: * +Copyright: 2015-2023, Gallopsled and contributors + 2013, Pratik Kumar Sahu, Nagendra Chowdary, Anish Mathuria + 2013, Tactical Network Solutions, LLC + 2013, Zachary Cutlip <uid000@gmail.com> +License: Expat + +Files: pwnlib/data/includes/freebsd.h + pwnlib/data/includes/generator/freebsd/* + pwnlib/elf/datatypes.py +Copyright: 1982-1994, The Regents of the University of California + UNIX System Laboratories, Inc + 2015, Gallopsled and contributors +License: BSD-3-clause + +Files: pwnlib/data/includes/generator/linux/* +Copyright: 1991-2015, Linus Torvalds and many others +License: GPL-2 + +Files: pwnlib/data/includes/generator/linux/diet/* +Copyright: 2001-2015, Felix von Leitner <felix-dietlibc@fefe.de> + 2001-2002, Thomas M. Ogrisegg +License: GPL-2+ + +Files: debian/* +Copyright: 2022, Timo Röhling <roehling@debian.org> +License: Expat + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: GPL-2 + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + On Debian systems, the full license text is available at + /usr/share/common-licenses/GPL-2 + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + On Debian systems, the full license text is available at + /usr/share/common-licenses/GPL-2 diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..8f53891 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +debian-branch = debian/master diff --git a/debian/patches/0001-Remove-check-for-unneeded-development-headers.patch b/debian/patches/0001-Remove-check-for-unneeded-development-headers.patch new file mode 100644 index 0000000..d2d3348 --- /dev/null +++ b/debian/patches/0001-Remove-check-for-unneeded-development-headers.patch @@ -0,0 +1,25 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org> +Date: Mon, 11 Apr 2022 12:03:39 +0200 +Subject: Remove check for unneeded development headers + +--- + setup.py | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/setup.py b/setup.py +index 65cb5c3..77afde4 100755 +--- a/setup.py ++++ b/setup.py +@@ -53,12 +53,6 @@ if sys.version_info < (3, 4): + sys.argv.remove('--user') + + +-# Check that the user has installed the Python development headers +-PythonH = os.path.join(get_python_inc(), 'Python.h') +-if not os.path.exists(PythonH): +- print("You must install the Python development headers!", file=sys.stderr) +- print("$ apt-get install python-dev", file=sys.stderr) +- sys.exit(-1) + + setup( + version = '4.11.1', diff --git a/debian/patches/0002-Do-not-pollute-usr-bin-with-random-scripts.patch b/debian/patches/0002-Do-not-pollute-usr-bin-with-random-scripts.patch new file mode 100644 index 0000000..d41efbf --- /dev/null +++ b/debian/patches/0002-Do-not-pollute-usr-bin-with-random-scripts.patch @@ -0,0 +1,37 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org> +Date: Mon, 11 Apr 2022 12:04:19 +0200 +Subject: Do not pollute /usr/bin with random scripts + +--- + setup.py | 18 ------------------ + 1 file changed, 18 deletions(-) + +diff --git a/setup.py b/setup.py +index 77afde4..9c53854 100755 +--- a/setup.py ++++ b/setup.py +@@ -23,24 +23,6 @@ for scheme in INSTALL_SCHEMES.values(): + + console_scripts = ['pwn=pwnlib.commandline.main:main'] + +-# Find all of the ancillary console scripts +-# We have a magic flag --include-all-scripts +-flag = '--only-use-pwn-command' +-if flag in sys.argv: +- sys.argv.remove(flag) +-else: +- flag = False +- +-for filename in glob.glob('pwnlib/commandline/*'): +- filename = os.path.basename(filename) +- filename, ext = os.path.splitext(filename) +- +- if ext != '.py' or '__init__' in filename: +- continue +- +- script = '%s=pwnlib.commandline.common:main' % filename +- if not flag: +- console_scripts.append(script) + + compat = {} + if sys.version_info < (3, 4): diff --git a/debian/patches/0003-Do-not-install-documentation-to-usr-lib-python3.patch b/debian/patches/0003-Do-not-install-documentation-to-usr-lib-python3.patch new file mode 100644 index 0000000..c59474a --- /dev/null +++ b/debian/patches/0003-Do-not-install-documentation-to-usr-lib-python3.patch @@ -0,0 +1,22 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org> +Date: Mon, 11 Apr 2022 12:49:14 +0200 +Subject: Do not install documentation to /usr/lib/python3 + +--- + setup.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/setup.py b/setup.py +index 9c53854..1e3c9a7 100755 +--- a/setup.py ++++ b/setup.py +@@ -38,9 +38,6 @@ if sys.version_info < (3, 4): + + setup( + version = '4.11.1', +- data_files = [('pwntools-doc', +- glob.glob('*.md') + glob.glob('*.txt')), +- ], + package_data = { + 'pwnlib': [ + 'data/crcsums.txt', diff --git a/debian/patches/0004-Use-python3-in-doctests.patch b/debian/patches/0004-Use-python3-in-doctests.patch new file mode 100644 index 0000000..6de9fee --- /dev/null +++ b/debian/patches/0004-Use-python3-in-doctests.patch @@ -0,0 +1,68 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org> +Date: Mon, 11 Apr 2022 14:06:33 +0200 +Subject: Use python3 in doctests + +--- + pwnlib/tubes/process.py | 8 ++++---- + pwnlib/tubes/ssh.py | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/pwnlib/tubes/process.py b/pwnlib/tubes/process.py +index 8770ade..1449994 100644 +--- a/pwnlib/tubes/process.py ++++ b/pwnlib/tubes/process.py +@@ -117,7 +117,7 @@ class process(tube): + + Examples: + +- >>> p = process('python') ++ >>> p = process('python3') + >>> p.sendline(b"print('Hello world')") + >>> p.sendline(b"print('Wow, such data')") + >>> b'' == p.recv(timeout=0.01) +@@ -158,20 +158,20 @@ class process(tube): + >>> p.recv() + b'\x00\x00\x00\x00\x00\x00\x00\x00' + +- >>> p = process(['python','-c','import os; print(os.read(2,1024).decode())'], ++ >>> p = process(['python3','-c','import os; print(os.read(2,1024).decode())'], + ... preexec_fn = lambda: os.dup2(0,2)) + >>> p.sendline(b'hello') + >>> p.recvline() + b'hello\n' + +- >>> stack_smashing = ['python','-c','open("/dev/tty","wb").write(b"stack smashing detected")'] ++ >>> stack_smashing = ['python3','-c','open("/dev/tty","wb").write(b"stack smashing detected")'] + >>> process(stack_smashing).recvall() + b'stack smashing detected' + + >>> process(stack_smashing, stdout=PIPE).recvall() + b'' + +- >>> getpass = ['python','-c','import getpass; print(getpass.getpass("XXX"))'] ++ >>> getpass = ['python3','-c','import getpass; print(getpass.getpass("XXX"))'] + >>> p = process(getpass, stdin=PTY) + >>> p.recv() + b'XXX' +diff --git a/pwnlib/tubes/ssh.py b/pwnlib/tubes/ssh.py +index adda422..6aee6e0 100644 +--- a/pwnlib/tubes/ssh.py ++++ b/pwnlib/tubes/ssh.py +@@ -384,7 +384,7 @@ class ssh_process(ssh_channel): + + Examples: + >>> s = ssh(host='example.pwnme') +- >>> p = s.process(['python', '-c', 'import time; time.sleep(10)']) ++ >>> p = s.process(['python3', '-c', 'import time; time.sleep(10)']) + >>> hex(p.getenv('PATH')) # doctest: +ELLIPSIS + '0x...' + """ +@@ -846,7 +846,7 @@ class ssh(Timeout, Logger): + b'/tmp\n' + >>> io.cwd + '/tmp' +- >>> p = s.process(['python','-c','import os; os.write(1, os.read(2, 1024))'], stderr=0) ++ >>> p = s.process(['python3','-c','import os; os.write(1, os.read(2, 1024))'], stderr=0) + >>> p.send(b'hello') + >>> p.recv() + b'hello' diff --git a/debian/patches/0005-Disable-automatic-update-check.patch b/debian/patches/0005-Disable-automatic-update-check.patch new file mode 100644 index 0000000..c411582 --- /dev/null +++ b/debian/patches/0005-Disable-automatic-update-check.patch @@ -0,0 +1,30 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org> +Date: Mon, 11 Apr 2022 20:23:41 +0200 +Subject: Disable automatic update check + +--- + pwnlib/update.py | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/pwnlib/update.py b/pwnlib/update.py +index dd8f0ed..4805bf7 100644 +--- a/pwnlib/update.py ++++ b/pwnlib/update.py +@@ -117,15 +117,8 @@ def last_check(): + + def should_check(): + """Return True if we should check for an update""" +- filename = cache_file() +- +- if not filename: +- return False +- +- if disabled or read(filename).strip() == b'never': +- return False +- +- return time.time() > (last_check() + update_freq) ++ # Never check automatically for Debian ++ return False + + def perform_check(prerelease=current_version.is_prerelease): + """Perform the update check, and report to the user. diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..7889b37 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,5 @@ +0001-Remove-check-for-unneeded-development-headers.patch +0002-Do-not-pollute-usr-bin-with-random-scripts.patch +0003-Do-not-install-documentation-to-usr-lib-python3.patch +0004-Use-python3-in-doctests.patch +0005-Disable-automatic-update-check.patch diff --git a/debian/python-pwntools-doc.doc-base b/debian/python-pwntools-doc.doc-base new file mode 100644 index 0000000..850ffb9 --- /dev/null +++ b/debian/python-pwntools-doc.doc-base @@ -0,0 +1,10 @@ +Document: pwntools +Title: Pwntools documentation +Author: Gallopsled et al. +Abstract: + CTF framework and exploit development library documentation +Section: Programming + +Format: HTML +Index: /usr/share/doc/python-pwntools-doc/html/index.html +Files: /usr/share/doc/python-pwntools-doc/html/*.html diff --git a/debian/python-pwntools-doc.docs b/debian/python-pwntools-doc.docs new file mode 100644 index 0000000..25abde3 --- /dev/null +++ b/debian/python-pwntools-doc.docs @@ -0,0 +1,4 @@ +docs/build/html +README.md +DOCKER.md + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0c41c32 --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +export PYBUILD_NAME = pwntools +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) +export PYBUILD_AFTER_INSTALL=$(CURDIR)/debian/rules run-sphinx PYTHONPATH=$(CURDIR)/debian/python3-$(PYBUILD_NAME){install_dir} +endif + +%: + dh $@ --buildsystem=pybuild + +# Tests are written as doctests +override_dh_auto_test: + +BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "@$(SOURCE_DATE_EPOCH)") +run-sphinx: + $(MAKE) -C docs html SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 0000000..f418129 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,5 @@ +# Test binaries which are not installed +pwntools source: source-is-missing [pwnlib/data/elf/*] +# Example binaries which are not installed +pwntools source: source-is-missing [examples/fmtstr/printf.*] +pwntools source: source-is-missing [examples/fmtstr/printf-loop.*] diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..3ec8ecc --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=4 +opts=mode=git,uversionmangle=s/-?(a|b|r?c)/~$1/ \ + https://github.com/Gallopsled/pwntools refs/tags/(\d[\d.]+) + |