Skip to content
Permalink
Branch: dev3
Commits on Oct 9, 2019
  1. Fix update ignore check for Python 3 (#1348)

    heinrich5991 authored and Arusekk committed Oct 9, 2019
    `read` returns bytes and its result can never equal a string.
Commits on Sep 24, 2019
  1. Merge branch 'dev' into dev3

    Arusekk committed Sep 24, 2019
  2. Code style and clarity

    Arusekk committed Sep 24, 2019
  3. Improve format string generator (#1216)

    bennofs authored and Arusekk committed Sep 24, 2019
    * feat(fmtstr): place pointers after format operations
    
    This means that the format string can now also work in certain
    cases even if the pointers contain null bytes.
    
    That's especially important on 64 bit where most pointers contain null bytes.
    
    * fix(fmtstr): more stuff
    
    * feat(fmtstr): optimize
    
    * perf(fmtstr): make sorting run in reasonable time (not perfect yet)
    
    * perf(fmtstr): be faster
    
    * style(fmtstr): more docs, some cleanup
    
    * fix(fmtstr): small fixes + more docs
    
    * style(fmtstr): cleanup small style issues
    
    * fix(fmtstr): fix handling of szmax in merge_atoms_overlapping
    
    * fix(fmtstr): fix Atom __getitem__ for out-of-bounds index
    
    * refactor(fmtstr): docs and cleaner code
    
    * fix(fmtstr): small test/doc fixes
    
    * tests(fmtstr): add example as tests for other arches
    
    * doc(fmtstr): more docstrings
    
    * fix(fmtstr): fix cyclic_find warnings
    
    * refactor(fmtstr): remove another nested function
    
    * tests(fmtstr): fix doctest output for wrong arch
    
    * style(fmtstr): remove unused imports
    
    * tests(fmtstr): add binaries for tests
  4. Perform all string formatting in log statement

    ZetaTwo authored and zachriggle committed May 12, 2019
Commits on Sep 23, 2019
  1. Dev3 (#1343)

    colinmkinsella authored and Arusekk committed Sep 23, 2019
    * Updates to requirements.txt.
    
    Removed the < 1.8.0 requirement for sphinx. It appeared no longer
    necessary.
    
    Alphabetized the listing for easier searching.
    
    Moved the requirements file under the docker folder. Docker does not
    like relative paths to parent directories due to security restrictions.
    
    * Updated Dockerfile to use Python3.
    
    * Fixes to srop test errors.
    
    Moving the imports to the beginning of the file resolved the issue.
    
    The following errors were popping up during testing within Docker:
    
    Document: rop/srop
    ------------------
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.recvline()
    Exception raised:
        Traceback (most recent call last):
          File "/usr/lib/python3.5/doctest.py", line 1321, in __run
            compileflags, 1), test.globs)
          File "<doctest default[18]>", line 1, in <module>
            p.recvline()
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 467, in recvline
            return self.recvuntil(self.newline, drop = not keepends, timeout = timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 310, in recvuntil
            res = self.recv(timeout=self.timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 82, in recv
            return self._recv(numb, timeout) or b''
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 160, in _recv
            if not self.buffer and not self._fillbuffer(timeout):
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 131, in _fillbuffer
            data = self.recv_raw(self.buffer.get_fill_size())
          File "/home/travis/pwntools/pwnlib/tubes/process.py", line 707, in recv_raw
            raise EOFError
        EOFError
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.poll(block=True)
    Expected:
        0
    Got:
        -11
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.recvline()
    Exception raised:
        Traceback (most recent call last):
          File "/usr/lib/python3.5/doctest.py", line 1321, in __run
            compileflags, 1), test.globs)
          File "<doctest default[18]>", line 1, in <module>
            p.recvline()
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 467, in recvline
            return self.recvuntil(self.newline, drop = not keepends, timeout = timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 310, in recvuntil
            res = self.recv(timeout=self.timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 82, in recv
            return self._recv(numb, timeout) or b''
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 160, in _recv
            if not self.buffer and not self._fillbuffer(timeout):
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 131, in _fillbuffer
            data = self.recv_raw(self.buffer.get_fill_size())
          File "/home/travis/pwntools/pwnlib/tubes/process.py", line 707, in recv_raw
            raise EOFError
        EOFError
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.poll(block=True)
    Expected:
        0
    Got:
        -11
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.recvline()
    Exception raised:
        Traceback (most recent call last):
          File "/usr/lib/python3.5/doctest.py", line 1321, in __run
            compileflags, 1), test.globs)
          File "<doctest default[18]>", line 1, in <module>
            p.recvline()
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 467, in recvline
            return self.recvuntil(self.newline, drop = not keepends, timeout = timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 310, in recvuntil
            res = self.recv(timeout=self.timeout)
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 82, in recv
            return self._recv(numb, timeout) or b''
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 160, in _recv
            if not self.buffer and not self._fillbuffer(timeout):
          File "/home/travis/pwntools/pwnlib/tubes/tube.py", line 131, in _fillbuffer
            data = self.recv_raw(self.buffer.get_fill_size())
          File "/home/travis/pwntools/pwnlib/tubes/process.py", line 707, in recv_raw
            raise EOFError
        EOFError
    **********************************************************************
    File "rop/srop.rst", line ?, in default
    Failed example:
        p.poll(block=True)
    Expected:
        0
    Got:
        -11
    **********************************************************************
    1 items had failures:
       6 of 159 in default
    159 tests in 1 items.
    153 passed and 6 failed.
    ***Test Failed*** 6 failures.
    
    * Fix for docstring warning in dynelf.py.
    
    The following warning is resolved with this fix:
    
    /home/travis/pwntools/pwnlib/dynelf.py:docstring of pwnlib.dynelf.DynELF._resolve_symbol_sysv:11: WARNING: Definition list ends without a blank line; unexpected unindent.
    
    * Fix for docstring warnings in gdb.py.
    
    The following warnings are resolved with this fix:
    
    /home/travis/pwntools/pwnlib/gdb.py:docstring of pwnlib.gdb.debug_assembly:8: WARNING: Inline strong start-string without end-string.
    /home/travis/pwntools/pwnlib/gdb.py:docstring of pwnlib.gdb.debug_assembly:21: WARNING: Block quote ends without a blank line; unexpected unindent.
    /home/travis/pwntools/pwnlib/gdb.py:docstring of pwnlib.gdb.debug_shellcode:4: WARNING: Inline strong start-string without end-string.
    /home/travis/pwntools/pwnlib/gdb.py:docstring of pwnlib.gdb.debug_shellcode:17: WARNING: Block quote ends without a blank line; unexpected unindent.
    
    * Fix for adb/__init__.py.
    
    The following error is resolved with this fix:
    
    Document: protocols/adb
    -----------------------
    **********************************************************************
    File "../../pwnlib/protocols/adb/__init__.py", line ?, in default
    Failed example:
        pprint(AdbClient().list('/data/user'))
    Exception raised:
        Traceback (most recent call last):
          File "/usr/lib/python3.5/doctest.py", line 1321, in __run
            compileflags, 1), test.globs)
          File "<doctest default[0]>", line 1, in <module>
            pprint(AdbClient().list('/data/user'))
        TypeError: 'module' object is not callable
    **********************************************************************
    1 items had failures:
       1 of  10 in default
    10 tests in 1 items.
    9 passed and 1 failed.
    ***Test Failed*** 1 failures.
    
    The following warning is resolved with this fix:
    
    /home/travis/pwntools/pwnlib/protocols/adb/__init__.py:docstring of pwnlib.protocols.adb.AdbClient.stat:6: WARNING: Inline literal start-string without end-string.
    
    * Fix for docstring warning in rop.py.
    
    The following warning is resolved with this fix:
    
    /home/travis/pwntools/pwnlib/rop/rop.py:docstring of pwnlib.rop.rop.DescriptiveStack.descriptions:3: WARNING: Inline literal start-string without end-string.
    
    * Fix for docstring warning in ssh.py.
    
    The following warning is resolved with this fix:
    
    /home/travis/pwntools/pwnlib/tubes/ssh.py:docstring of pwnlib.tubes.ssh.ssh._init_remote_platform_info:6: WARNING: Block quote ends without a blank line; unexpected unindent.
    
    * Doctest dictionary ordering problem in misc.py.
    
    There was an ordering problem while running the doctest in misc.py.
    Sorting the dictionary with pprint and updating the results fixed the
    issue.
    
    Document: util/misc
    -------------------
    **********************************************************************
    File "../../pwnlib/util/misc.py", line ?, in default
    Failed example:
        sizes
    Expected:
        {'eax': 32, 'ax': 16, 'al': 8, 'ah': 8, 'ebx': 32, 'bx': 16, 'bl': 8, 'bh': 8, 'ecx': 32, 'cx': 16, 'cl': 8, 'ch': 8, 'edx': 32, 'dx': 16, 'dl': 8, 'dh': 8, 'edi': 32, 'di': 16, 'esi': 32, 'si': 16, 'ebp': 32, 'bp': 16, 'esp': 32, 'sp': 16}
    Got:
        {'si': 16, 'cx': 16, 'cl': 8, 'dl': 8, 'dh': 8, 'eax': 32, 'bx': 16, 'sp': 16, 'bl': 8, 'bh': 8, 'di': 16, 'esi': 32, 'edx': 32, 'dx': 16, 'ebx': 32, 'ebp': 32, 'ax': 16, 'ch': 8, 'al': 8, 'ah': 8, 'edi': 32, 'esp': 32, 'bp': 16, 'ecx': 32}
    **********************************************************************
    File "../../pwnlib/util/misc.py", line ?, in default
    Failed example:
        bigger
    Expected:
        {'eax': ['eax'], 'ax': ['eax', 'ax'], 'al': ['eax', 'ax', 'al'], 'ah': ['eax', 'ax', 'ah'], 'ebx': ['ebx'], 'bx': ['ebx', 'bx'], 'bl': ['ebx', 'bx', 'bl'], 'bh': ['ebx', 'bx', 'bh'], 'ecx': ['ecx'], 'cx': ['ecx', 'cx'], 'cl': ['ecx', 'cx', 'cl'], 'ch': ['ecx', 'cx', 'ch'], 'edx': ['edx'], 'dx': ['edx', 'dx'], 'dl': ['edx', 'dx', 'dl'], 'dh': ['edx', 'dx', 'dh'], 'edi': ['edi'], 'di': ['edi', 'di'], 'esi': ['esi'], 'si': ['esi', 'si'], 'ebp': ['ebp'], 'bp': ['ebp', 'bp'], 'esp': ['esp'], 'sp': ['esp', 'sp']}
    Got:
        {'si': ['esi', 'si'], 'cx': ['ecx', 'cx'], 'cl': ['ecx', 'cx', 'cl'], 'dl': ['edx', 'dx', 'dl'], 'dh': ['edx', 'dx', 'dh'], 'eax': ['eax'], 'bx': ['ebx', 'bx'], 'sp': ['esp', 'sp'], 'bl': ['ebx', 'bx', 'bl'], 'bh': ['ebx', 'bx', 'bh'], 'di': ['edi', 'di'], 'esi': ['esi'], 'edx': ['edx'], 'dx': ['edx', 'dx'], 'ebx': ['ebx'], 'ebp': ['ebp'], 'ax': ['eax', 'ax'], 'ch': ['ecx', 'cx', 'ch'], 'al': ['eax', 'ax', 'al'], 'ah': ['eax', 'ax', 'ah'], 'edi': ['edi'], 'esp': ['esp'], 'bp': ['ebp', 'bp'], 'ecx': ['ecx']}
    **********************************************************************
    File "../../pwnlib/util/misc.py", line ?, in default
    Failed example:
        smaller
    Expected:
        {'eax': ['ax', 'al', 'ah'], 'ax': ['al', 'ah'], 'al': [], 'ah': [], 'ebx': ['bx', 'bl', 'bh'], 'bx': ['bl', 'bh'], 'bl': [], 'bh': [], 'ecx': ['cx', 'cl', 'ch'], 'cx': ['cl', 'ch'], 'cl': [], 'ch': [], 'edx': ['dx', 'dl', 'dh'], 'dx': ['dl', 'dh'], 'dl': [], 'dh': [], 'edi': ['di'], 'di': [], 'esi': ['si'], 'si': [], 'ebp': ['bp'], 'bp': [], 'esp': ['sp'], 'sp': []}
    Got:
        {'si': [], 'cx': ['cl', 'ch'], 'cl': [], 'dl': [], 'dh': [], 'eax': ['ax', 'al', 'ah'], 'bx': ['bl', 'bh'], 'sp': [], 'bl': [], 'bh': [], 'di': [], 'esi': ['si'], 'edx': ['dx', 'dl', 'dh'], 'dx': ['dl', 'dh'], 'ebx': ['bx', 'bl', 'bh'], 'ebp': ['bp'], 'ax': ['al', 'ah'], 'ch': [], 'al': [], 'ah': [], 'edi': ['di'], 'esp': ['sp'], 'bp': [], 'ecx': ['cx', 'cl', 'ch']}
    **********************************************************************
    1 items had failures:
       3 of  20 in default
    20 tests in 1 items.
    17 passed and 3 failed.
    ***Test Failed*** 3 failures.
    
    * Fix for docstring warning in packing.py.
    
    The following warning is resolved with this fix:
    
    /home/travis/pwntools/pwnlib/util/packing.py:docstring of pwnlib.util.packing.flat:2: WARNING: Inline emphasis start-string without end-string.
    
    * Removed commented out test in Dockerfile.
    
    * Forgot to update location of requirements.txt.
    
    Forgot to update the location of requirements.txt in .travis.yml.
    
    * Made recommended changes from Arusekk.
Commits on Sep 22, 2019
  1. Merge branch 'dev' into dev3

    Arusekk committed Sep 22, 2019
  2. Merge branch 'beta' into dev

    Arusekk committed Sep 22, 2019
  3. Merge branch 'stable' into beta

    Arusekk committed Sep 22, 2019
  4. Fix TypeError: find_module() takes exactly 3 arguments (2 given) (#1342)

    WGH- authored and Arusekk committed Sep 22, 2019
    pwnlib.shellcraft installs its custom import finder (LazyImporter) into
    sys.meta_path.
    
    According to PEP 302, finder is expected to have prototype
    
        finder.find_module(fullname, path=None)
    
    Note that the second argument is optional. pwnlib's LazyImporter has second
    argument required, which leads to compatibility problems, surfacing
    when trying to use pwnlib with other third-party modules:
    
        >>> import pwnlib
        >>> import faker
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "/tmp/.venv/lib/python2.7/site-packages/faker/__init__.py", line 2, in <module>
            from faker.factory import Factory  # noqa F401
          File "/tmp/.venv/lib/python2.7/site-packages/faker/factory.py", line 12, in <module>
            from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
          File "/tmp/.venv/lib/python2.7/site-packages/faker/config.py", line 15, in <module>
            AVAILABLE_LOCALES = find_available_locales(PROVIDERS)
          File "/tmp/.venv/lib/python2.7/site-packages/faker/utils/loading.py", line 45, in find_available_locales
            provider_module = import_module(provider_path)
          File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
            __import__(name)
          File "/tmp/.venv/lib/python2.7/site-packages/faker/providers/internet/__init__.py", line 4, in <module>
            from text_unidecode import unidecode
          File "/tmp/.venv/lib/python2.7/site-packages/text_unidecode/__init__.py", line 6, in <module>
            _replaces = pkgutil.get_data(__name__, 'data.bin').decode('utf8').split('\x00')
          File "/usr/lib64/python2.7/pkgutil.py", line 576, in get_data
            loader = get_loader(package)
          File "/usr/lib64/python2.7/pkgutil.py", line 462, in get_loader
            return find_loader(fullname)
          File "/usr/lib64/python2.7/pkgutil.py", line 473, in find_loader
            loader = importer.find_module(fullname)
        TypeError: find_module() takes exactly 3 arguments (2 given)
Commits on Aug 28, 2019
  1. Unified text_type in py3

    Arusekk committed Aug 28, 2019
  2. No print statements in py3

    Arusekk committed Aug 28, 2019
    bytes are bytes under py3
  3. Merge branch 'dev' into dev3

    Arusekk committed Aug 28, 2019
  4. Merge branch 'beta' into dev

    Arusekk committed Aug 28, 2019
  5. Merge branch 'stable' into beta

    Arusekk committed Aug 28, 2019
Commits on Aug 27, 2019
  1. Add freebsd generic syscall templates (#1285)

    io12 authored and Arusekk committed Aug 27, 2019
    * Add freebsd generic syscall templates
    
    * Update pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/amd64/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/arm/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/i386/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/mips/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update pwnlib/shellcraft/templates/thumb/freebsd/syscall.asm
    
    Co-Authored-By: io12 <7348004+io12@users.noreply.github.com>
    
    * Update FreeBSD syscall templates to use reversed() for stack args
    
    * Change assignment of ABIs
    
    * Unify sigreturn ABIs with `sysv_*`
    
    * Fix reversed() errors
  2. Merge branch 'dev' into dev3

    Arusekk committed Aug 27, 2019
  3. Fix timeout parameter passing in sendlineafter and other similar func…

    lockshaw authored and Arusekk committed Aug 27, 2019
    …tions (#1277)
    
    * Fix parameter order of sendlineafter
    
    * Fix the same bug for the other functions in tube.py
    
    * Update the docstrings
  4. Improve doctest coverage (#1275)

    Arusekk committed Aug 27, 2019
    * Improve util.proc doctest coverage
    
    * Improve util.crc coverage
    
    * Triggering doctests for getdents and buffer
    
    * Processes behave dynamically
  5. dev3 update README.md installation part (#1338)

    WildfootW and Arusekk committed Aug 27, 2019
    * dev3 update README.md installation part
    
    * Update require python version in README.md
    
    Co-Authored-By: Arusekk <arek_koz@o2.pl>
Commits on Aug 9, 2019
  1. Fixed ROP better

    Arusekk committed Aug 9, 2019
  2. Fix term and ROP strange behaviour

    Arusekk committed Aug 9, 2019
Commits on Jul 8, 2019
  1. Fix gdb for remote processes

    Arusekk committed Jul 8, 2019
  2. Fix AttributeError instead of EOFError

    Arusekk committed Jul 8, 2019
Commits on Jun 22, 2019
  1. A fix reverted

    Arusekk committed Jun 22, 2019
  2. Various commandline/rop fixes

    Arusekk committed Jun 22, 2019
  3. Merge branch 'dev' into dev3

    Arusekk committed Jun 22, 2019
  4. [dev3] Minor changes for python3 support (#1310)

    mcd1992 authored and Arusekk committed Jun 22, 2019
    * Removed old dependency for intervaltree and sortedcontainers
    
    Also make the pwn command show usage if no arguments supplied
    
    * Fix errno subcommand
    
    The errno library moved out of os and into its own library
    
    * Change template script to use system env python instead of only py2
    
    * Require updated intervaltree in setup.py
    
    * Update .travis.yml
    
    * Update .travis.yml
  5. Tubes with `context.encoding` (#1317)

    Arusekk committed Jun 22, 2019
    * Tubes fixed
    
    * Typo
    
    * Typo + default value
    
    * Fixes on and on
    
    * Many many more
    
    * Missing lines and tests
    
    * Refactoring
    
    * Missing line again
    
    * Missing again
    
    * Copypaste design patterns
Commits on May 8, 2019
  1. Fixes #1279 (#1304)

    ZetaTwo authored and Arusekk committed May 8, 2019
    * Fixes #1279
    
    * Remove redundant include
  2. Identity is not the same thing as equality in Python (#1306)

    cclauss authored and Arusekk committed May 8, 2019
    Use ==/!= to compare str, bytes, and int literals: __fmt is not 'raw'__ --> __fmt != 'raw'__
    
    $ __python__
    ```python
    >>> raw = 'ra'
    >>> raw += 'w'
    >>> raw
    'raw'
    >>> raw == 'raw'
    True
    >>> raw is 'raw'
    False
    ```
Commits on May 7, 2019
  1. Merge pull request #1288 from cclauss/patch-1

    zachriggle committed May 7, 2019
    Travis CI: The 'sudo' tag is now deprecated
  2. Merge pull request #1292 from xairy/stable

    zachriggle committed May 7, 2019
    Provide correct arch name to gdb for sparc64
  3. Merge pull request #1297 from ZetaTwo/dev

    zachriggle committed May 7, 2019
    Quotes around file path in gdbscript - Fixes #1291
Older
You can’t perform that action at this time.