From a7fc7c205f68e5519640b2c60fada27d5cc1761c Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Thu, 22 Dec 2022 05:50:18 -0800 Subject: Add the MIT license --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7141095 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Carson Fleming + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -- cgit v1.2.3 From b6e70756b88f9014cf9fc518c09baa0937055517 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Mon, 26 Dec 2022 07:00:47 -0800 Subject: Make correction to avoid utf-8ing control sequences --- pkctl.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkctl.py b/pkctl.py index f54960e..6fa6058 100644 --- a/pkctl.py +++ b/pkctl.py @@ -83,25 +83,25 @@ def attach_cmd(): reader_thread.start() while state['attached']: try: - line = input().strip() + line = bytes(input().strip(), 'utf-8') except EOFError: print('detach') - line = 'detach' - if line == 'detach': + line = b'detach' + if line == b'detach': try: sock.sendall(b'\xde\xad') except: pass state['attached'] = False - elif line == 'clear': + elif line == b'clear': os.system('clear') - line = '\xc0\xdeprompt' + line = b'\xc0\xdeprompt' elif len(line) < 1: - line = '\xc0\xdeprompt' + line = b'\xc0\xdeprompt' if not state['attached']: break try: - sock.sendall(bytes(line, 'utf-8')) + sock.sendall(line) except: state['attached'] = False break @@ -111,9 +111,6 @@ def attach_cmd(): reader_thread.join() return True -def exec_cmd(*args): - pass - def main(): if len(sys.argv) < 2 or sys.argv[1] == 'help': print_help() -- cgit v1.2.3 From a262dd58d12a918d8d56d5abf4eb0eb7027699d4 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Mon, 26 Dec 2022 07:05:51 -0800 Subject: Less weird solution to prompt command --- pkd_stub.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkd_stub.py b/pkd_stub.py index ef5818d..550d9ad 100644 --- a/pkd_stub.py +++ b/pkd_stub.py @@ -340,6 +340,8 @@ def screen_reader(screen): cmdq_lock.release() elif cmd == b'show-serverkey': resp = showcrypto() + elif cmd == b'\xc0\xdeprompt': + pass elif len(cmd) > 0: shcmd = True targets = [] @@ -357,9 +359,6 @@ def screen_reader(screen): resp = '[pk] Can\'t target null command.' blast_command(cmd, screen, targets=targets) try: - if cmd == b'\xc0\xdeprompt': - screen.sendall(prompt_str()) - continue if len(resp) > 0: screen.sendall(bytes('%s\n' % resp, 'utf-8')) if len(tcp_clients) < 1: -- cgit v1.2.3