Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve remote() documentation #2427

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The table below shows which release corresponds to each branch, and what date th
- [#2398][2398] Add support for generating multiple shellcodes at a time in shellcraft
- [#2415][2415] Add shellcraft template for IPv6 socket
- [#2405][2405] Add "none" ssh authentication method
- [#2427][2427] Document behaviour of remote()'s sni argument as string.

[2360]: https://github.com/Gallopsled/pwntools/pull/2360
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
Expand All @@ -101,6 +102,7 @@ The table below shows which release corresponds to each branch, and what date th
[2398]: https://github.com/Gallopsled/pwntools/pull/2398
[2415]: https://github.com/Gallopsled/pwntools/pull/2415
[2405]: https://github.com/Gallopsled/pwntools/pull/2405
[2427]: https://github.com/Gallopsled/pwntools/pull/2405

## 4.13.0 (`beta`)

Expand Down
8 changes: 4 additions & 4 deletions pwnlib/tubes/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class remote(sock):
fam: The string "any", "ipv4" or "ipv6" or an integer to pass to :func:`socket.getaddrinfo`.
typ: The string "tcp" or "udp" or an integer to pass to :func:`socket.getaddrinfo`.
timeout: A positive number, None or the string "default".
sock(:class:`socket.socket`): Socket to inherit, rather than connecting
ssl(bool): Wrap the socket with SSL
ssl_context(ssl.SSLContext): Specify SSLContext used to wrap the socket.
sni: Set 'server_hostname' in ssl_args based on the host parameter.
sock(socket.socket): Socket to inherit, rather than connecting
ssl_args(dict): Pass ssl.wrap_socket named arguments in a dictionary.
ssl_args(dict): Pass :func:`ssl.wrap_socket` named arguments in a dictionary.
sni(str,bool): Set 'server_hostname' in ssl_args. Set to True to set it based on the host argument. Set to False to not provide any value. Default is True.

Examples:

Expand Down Expand Up @@ -57,7 +57,7 @@ class remote(sock):

def __init__(self, host, port,
fam = "any", typ = "tcp",
ssl=False, sock=None, ssl_context=None, ssl_args=None, sni=True,
sock=None, ssl=False, ssl_context=None, ssl_args=None, sni=True,
*args, **kwargs):
super(remote, self).__init__(*args, **kwargs)

Expand Down