33 Commits
Author SHA1 Message Date
Scott Laglerandpeace-maker 5efe909a91 Add Type Annotations for parts of pwnlib/util (#2679)
* Add Type Annotations for parts of pwnlib/util

* fix: use Callable in pwnlib/util/lists.py

* fix: Import Errors

* fix: use getLogger in pwnlib/util/net

* feat: use collections.abc.Buffer where appropriate

* fix: remove collections.abc.Buffer to use Sequence

* add CHANGELOG.md entry

* Improve packing and fiddling types

* Introduce own `BytesLike` type instead of 3.12 Buffer

* Improve web.wget types

* Use TypedDict in util.net

Specify generics properly.

* Improve pwnlib.proc types

* Improve pwnlib.util.lists types

* Fix util.splash types

* Make TypeVars private

* Improve util.hexdump types

* Remove partial types from packing.fit/flat

Those require more work to be useful.

* Fix implicit wget return

* Fix term.text type export

* Fix js_escape return type

* Fix sh_string doctest types

* Fix usage of ssh_channel as ssh_process

We access the pid, so a plain ssh_channel is not enough.

* Improve util.lists types

* Improve packing.dd types

* Fix relying on socket.AddressFamily type at runtime

The type is only in typeshed and not the real socket module. Don't access it at runtime, only at type checking.

* Fix lists.findall with string needle

* Fix dd on two files

* Update mypy-baseline.txt

* Remove testing artifacts from mypy-baseline.txt

---------

Co-authored-by: peace-maker <[email protected]>
2026-08-16 19:45:40 +02:00
RocketDev 5161b5ef23 Cleanup Python 2 legacy (#2680)
* Cleanup Python 2 legacy

* chore: update changelog
2026-02-20 10:48:42 +01:00
ArusekkandPeace-Maker 328b2cd447 Drop six (#2547)
Co-authored-by: Peace-Maker <[email protected]>
2025-02-28 12:15:04 +01:00
peace-maker 1998ff0920 Fix failing libcdb.unstrip_libc tests (#2196)
* Fix libcdb.unstrip_libc tests

The old debugsymbols seem to have been pruned.
Update hashes to recent Ubuntu 22.04 libcs.

* Switch wget test to httpbingo.org

httpbin.org is very slow to respond.
2023-05-18 17:59:16 +02:00
Arusekk 3121f68e39 Try to catch more errors by using python -bb (#1861)
* Try to catch more errors by using python -bb

* Apply changes to travis dockerfiles as well

* Introduce context._need_bytes and context._need_text

...and resolve many issues
2021-04-15 12:04:56 +02:00
Heap Crash 8a6383a55d Refactor dockerfiles for simplicity (#1786)
* Remove likely-unused Dockerfiles, which are not being supported in the future anyway

This leaves base, stable, beta, and dev as the only Dockerfile images

Simplify extra/Docker so that Pwntools is already checked out, and build precedence works

* Base image always gets built first
* Branch-tracking Dockerfiles now require base to be built
* Use locally-checked-out-repo instead of e.g. git+https://github.com/Gallopsled/pwntools@beta
* Install tested with both Python2 and Python3
* Add Python3 user-script directory to $PATH

Update CHANGELOG with Docker changes

Add develop to Makefile, restore old Dockerfiles

Make development target separate, and automatically launch "docker run -it" with suggested arguments

Add develop Dockerfile

* Add README for the Dockerfiles

* Merge dependencies, add NOPASSWD, use hostname localhost to avoid sudo errors

* Better Dockerfile for testing, working on making all of the tests work

* wip

* WORK-IN-PROGRESS

* Remove from pwn import *

* Fix incorrect usage of progress() in SSH

* WIPWIPWIP

* MORE WIP

* [srop] Fix SROP unit tests by allocating enough stack

* [todo] Test canary in MIPS pushstr to make sure tests are actually being run

* [ROP] Make ROP doctests work from Docker and more minimal

* [srop] Simplify SROP imports

* [mips] Simplify MIPS doctest imports

* [corefile] Handle race condition against kernel / qemu

* [web] Handle file permission failure in Docker

* [core] Actually implement timeout

* Revert "[corefile] Handle race condition against kernel / qemu"

This reverts commit e02a3dce19.

* [context] Handle file permission issue in Docker

* [aarch64] Just run the shellcode, dont dump it out

* [tests] Remove test canary from mips pushstr

* [timeout] Use ELLIPSIS for time-flaky tests

* [update] Remove DONT_CHECK_FOR_UPDATES

* [context] Handle another path access error in Docker

* [timeout] Just leave it the way it was, hardly ever fails

* [context] Fix broken test because of quotes

* WIP save Docker stuff just in case

* [mips] Do not replace "asm" in the global scope with doctest

* Clear context between invocations so we dont end up with e.g. 64-bit i386

* [process] Fix timeout to actually work

* [mips] Do not replace "asm" in the global scope with doctest (Part 2)

* [rop] Fix ROP doctests

* [mips] Do not replace "asm" in the global scope with doctest (Part 3)

* Re-add all of the Py2OutputChecker stuff so I can start testing Python2

* Restore libcdb checks

* Tests work on Python2 now with "make -C travis/docker doctest2"

* Handle issue caught by Pylint

* Install pwndbg for the pwntools user

* Add trailing newline

* Remove un-necessary ELLIPSIS

* Add trailing newline

* Convert assert to simple statement

* This is an empty commit for testing webhook integrations

* [travis] Use bash as the default shell

* Commit compiled Dockerfile for use on hub.docker.com

* [gdb] Restore gdb.rst and manually disable doctests from inside Docker container
2021-02-25 11:34:56 +01:00
Arusekk adaba022e6 Pretty docstrings and libcdb fix 2019-12-06 11:30:55 +01:00
Arusekk 03ff7a568d Doctest bytes part 3 2018-11-22 11:29:15 +01:00
Arusekk 7a492c6ab3 First python 3 version of up-to-date pwntools 2018-11-10 22:27:49 +01:00
Arusekk 57f0ebd762 Python 3 by-hand improvements 2018-10-29 21:24:39 +01:00
Arusekk 3d03a75975 Replace division with floor division as of PEP-238 (#1135)
* Replace division with floor division as of PEP-238

This will also get us closer to python3.
See https://www.python.org/dev/peps/pep-0238/

* Add from __future__ import division to source files
2018-04-11 09:42:34 -07:00
Zach Riggle fb16e158ec Use tubes.buffer for net.wget, add more tests 2017-01-17 13:58:49 -05:00
Zach Riggle 1d59a90fa8 Change all imports to absolute per PEP-328, and sort imports (#832) 2017-01-03 18:04:45 -05:00
Zach Riggle d733cf6560 Fix failing doctest because of httpbin slowness (#731) 2016-09-09 17:46:34 -07:00
Zach Riggle 9aff300cee Fix wget() keyword 2016-04-22 14:52:30 -07:00
Zach Riggle 7925b44582 Speed up DynELF leaking with field_compare
Also modify log.progress / log.waitfor update frequency.
2016-04-22 10:01:07 -07:00
Zach Riggle c503c9c7d5 Respect timeout for wget 2015-04-16 14:27:47 -04:00
Zach Riggle 41f003464b Merge pull request #1 from binjitsu/web-doctests
Make doctests cleaner
2015-02-05 11:52:28 -05:00
Zach Riggle 339c71abbd sorted imports with isort 2015-02-05 04:48:25 -08:00
Zach Riggle c762eec46c Make doctests cleaner 2015-01-25 18:14:44 -08:00
Morten Brøns-Pedersen 3dee2bbe41 mega commit -- attempt at improving logging 2015-01-06 12:45:57 +01:00
Zach Riggle 404f0958d0 Change Args to Arguments 2015-01-05 15:36:47 -08:00
Mathias Svensson faab1eb299 Use https instead of http wherever possible.
Note that this means that I changed a few of the links from
http://docs.pwntools.org to https://pwntools.readthedocs.org as we do
not currently have https on pwntools.com
2015-01-05 01:11:02 +01:00
Morten Brøns-Pedersen 92b311d655 fixed broken doctest in pwnlib.util.web.wget 2014-12-23 13:01:02 +01:00
Mathias Svensson b621a725e3 Fixed #217. 2014-12-22 14:52:52 +01:00
Mathias Svensson 42215bea8c A few bugfixes found with landscape.io 2014-12-21 20:55:06 +01:00
Zach Riggle 8f1583d588 Defer loading of requests module. Fixes #198 2014-12-21 12:40:09 -06:00
Zach Riggle 192065bb36 Merge branch 'wget-requests'
Conflicts:
	pwnlib/util/web.py
2014-11-07 00:05:53 -05:00
Zach Riggle b2cd8fde32 Switch to using pwnlib.util.misc.size for calculating sizes 2014-11-06 18:11:22 -05:00
Zach Riggle 6f3fe07e29 Change "wget" to use the requests library. Also adds the entire requests library to the top level. E.g. from pwn import * => "get" is now a global object 2014-11-06 17:29:38 -05:00
Zach Riggle 69e84b790d pwnlib 2.2 rewrite of context, logging, tubes, various bugfixes 2014-10-26 16:02:22 -07:00
Zach Riggle 85d7229691 Add timeout 2014-09-03 21:41:48 -07:00
Zach Riggle e514328d02 add pwnlib.util.web.wget 2014-09-03 21:36:44 -07:00