mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-30 20:34:15 +01:00
Merge branch 'master' into issue-183-fix-sudo-parsing
This commit is contained in:
commit
856d4a8134
@ -13,6 +13,7 @@ and simply didn't have the time to go back and retroactively create one.
|
|||||||
- Possible exception due to _pre-registering_ of `session` with `manager`
|
- Possible exception due to _pre-registering_ of `session` with `manager`
|
||||||
- Covered edge case in sudo rule parsing for wildcards ([#183](https://github.com/calebstewart/pwncat/issue/183))
|
- Covered edge case in sudo rule parsing for wildcards ([#183](https://github.com/calebstewart/pwncat/issue/183))
|
||||||
- Added fallthrough cases for PTY methods in case of misbehaving binaries (looking at you: `screen`)
|
- Added fallthrough cases for PTY methods in case of misbehaving binaries (looking at you: `screen`)
|
||||||
|
- Fixed handling of `socket.getpeername` when `Socket` channel uses IPv6 ([#159](https://github.com/calebstewart/pwncat/issues/159)).
|
||||||
### Added
|
### Added
|
||||||
- Added alternatives to `bash` to be used during _shell upgrade_ for a _better shell_
|
- Added alternatives to `bash` to be used during _shell upgrade_ for a _better shell_
|
||||||
- Added a warning message when a `KeyboardInterrupt` is caught
|
- Added a warning message when a `KeyboardInterrupt` is caught
|
||||||
|
@ -50,7 +50,11 @@ class Socket(Channel):
|
|||||||
|
|
||||||
if client is not None:
|
if client is not None:
|
||||||
# Report host and port number to base channel
|
# Report host and port number to base channel
|
||||||
host, port = client.getpeername()
|
host, port, *_ = client.getpeername()
|
||||||
|
|
||||||
|
# Localhost is sometimes a IPv4 and sometimes IPv6 socket, just normalize the name
|
||||||
|
if host == "::1" or host == "127.0.0.1":
|
||||||
|
host = "localhost"
|
||||||
|
|
||||||
if "host" not in kwargs:
|
if "host" not in kwargs:
|
||||||
kwargs["host"] = host
|
kwargs["host"] = host
|
||||||
@ -78,6 +82,10 @@ class Socket(Channel):
|
|||||||
self.client = client
|
self.client = client
|
||||||
self.address = client.getpeername()
|
self.address = client.getpeername()
|
||||||
|
|
||||||
|
# Localhost is sometimes a IPv4 and sometimes IPv6 socket, just normalize the name
|
||||||
|
if self.address[0] == "::1" or self.address[0] == "127.0.0.1":
|
||||||
|
self.address = ("localhost", *self.address[1:])
|
||||||
|
|
||||||
self.client.setblocking(False)
|
self.client.setblocking(False)
|
||||||
fcntl.fcntl(self.client, fcntl.F_SETFL, os.O_NONBLOCK)
|
fcntl.fcntl(self.client, fcntl.F_SETFL, os.O_NONBLOCK)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user