From c1ce1897df77d816b8ff1b929c5189ba0e9b809f Mon Sep 17 00:00:00 2001 From: peace-maker Date: Sun, 21 Apr 2024 22:13:56 +0200 Subject: [PATCH 1/3] Fix duplicate definition of `ssh.sftp` (#2394) --- pwnlib/tubes/ssh.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pwnlib/tubes/ssh.py b/pwnlib/tubes/ssh.py index 53b8be0d5..0bedd6359 100644 --- a/pwnlib/tubes/ssh.py +++ b/pwnlib/tubes/ssh.py @@ -550,10 +550,6 @@ class ssh(Timeout, Logger): #: Paramiko SSHClient which backs this object client = None - #: Paramiko SFTPClient object which is used for file transfers. - #: Set to :const:`None` to disable ``sftp``. - sftp = None - #: PID of the remote ``sshd`` process servicing this connection. pid = None @@ -719,6 +715,9 @@ def cwd(self, cwd): @property def sftp(self): + """Paramiko SFTPClient object which is used for file transfers. + Set to :const:`None` to disable ``sftp``. + """ if not self._tried_sftp: try: self._sftp = self.transport.open_sftp_client() From d2a02a7b37ba9d7c8c510b16eb16e268053f29de Mon Sep 17 00:00:00 2001 From: Lewis Watson Date: Sun, 21 Apr 2024 21:14:55 +0100 Subject: [PATCH 2/3] Updated Mac OS Install Documentation (#2392) * Added Missing MacOS Requirements * Updated Binutils Install Docs Due to security reasons Homebrew has removed direct formula references, this is the workaround. * Updated changelog for #2392 * reverting changelog --- docs/source/install.rst | 3 +++ docs/source/install/binutils.rst | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index d63e67523..6ea664dd5 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -15,6 +15,9 @@ following system libraries installed. install/* + +Note: For Mac OS X you will need to have cmake ``brew install cmake`` and pkg-config ``brew install pkg-config`` installed. + Released Version ----------------- diff --git a/docs/source/install/binutils.rst b/docs/source/install/binutils.rst index d802701bb..6a33369cd 100644 --- a/docs/source/install/binutils.rst +++ b/docs/source/install/binutils.rst @@ -32,14 +32,15 @@ Mac OS X ^^^^^^^^^^^^^^^^ Mac OS X is just as easy, but requires building binutils from source. -However, we've made ``homebrew`` recipes to make this a single command. +However, we've made ``homebrew`` recipes to make this just two commands. After installing `brew `__, grab the appropriate recipe from our `binutils repo `__. .. code-block:: bash - $ brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-$ARCH.rb + $ wget https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-$ARCH.rb + $ brew install ./binutils-$ARCH.rb Alternate OSes ^^^^^^^^^^^^^^^^ From eec3321ae9c1306b64231f6538a573e7265bdb11 Mon Sep 17 00:00:00 2001 From: marinelay Date: Mon, 22 Apr 2024 05:18:28 +0900 Subject: [PATCH 3/3] Fix passing bytes to `context.log_file` and `crc.BitPolynom` (#2389) * Fix incosistent usage of bytes/str * update changelog * Update CHANGELOG --------- Co-authored-by: marinelay Co-authored-by: Peace-Maker --- CHANGELOG.md | 2 ++ pwnlib/context/__init__.py | 2 ++ pwnlib/util/crc/__init__.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb9e31d1..631184f05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ The table below shows which release corresponds to each branch, and what date th - [#2327][2327] Add basic support to debug processes on Windows - [#2322][2322] Add basic RISCV64 shellcraft support - [#2330][2330] Change `context.newline` when setting `context.os` to `"windows"` +- [#2389][2389] Fix passing bytes to `context.log_file` and `crc.BitPolynom` [2360]: https://github.com/Gallopsled/pwntools/pull/2360 [2356]: https://github.com/Gallopsled/pwntools/pull/2356 @@ -84,6 +85,7 @@ The table below shows which release corresponds to each branch, and what date th [2327]: https://github.com/Gallopsled/pwntools/pull/2327 [2322]: https://github.com/Gallopsled/pwntools/pull/2322 [2330]: https://github.com/Gallopsled/pwntools/pull/2330 +[2389]: https://github.com/Gallopsled/pwntools/pull/2389 ## 4.13.0 (`beta`) diff --git a/pwnlib/context/__init__.py b/pwnlib/context/__init__.py index 3d090e138..3bf265893 100644 --- a/pwnlib/context/__init__.py +++ b/pwnlib/context/__init__.py @@ -1033,6 +1033,8 @@ def log_file(self, value): """ if isinstance(value, (bytes, six.text_type)): # check if mode was specified as "[value],[mode]" + from pwnlib.util.packing import _need_text + value = _need_text(value) if ',' not in value: value += ',a' filename, mode = value.rsplit(',', 1) diff --git a/pwnlib/util/crc/__init__.py b/pwnlib/util/crc/__init__.py index f4271b23f..80a5c5649 100644 --- a/pwnlib/util/crc/__init__.py +++ b/pwnlib/util/crc/__init__.py @@ -74,6 +74,8 @@ class BitPolynom(object): def __init__(self, n): if isinstance(n, (bytes, six.text_type)): + from pwnlib.util.packing import _need_text + n = _need_text(n) self.n = 0 x = BitPolynom(2) try: