Git Product home page Git Product logo

sshpry2.0's People

Contributors

nopernik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sshpry2.0's Issues

run error on linux debian 11

OS: debian 11
kernel: Linux debian 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
python -V: 3.9.2

root@debian:~/Desktop/SSHPry2.0# python sshpry2.py --auto

SSHPry2 SSH-TTY control by @nopernik 2017

[+] Getting available ssh connections...
[+] Found active SSH connections:
	PID: 1511 | TTY: /dev/pts/1 (root)

[+] -- Lazy mode activated -- :-)

[+] Target TTY keystrokes file: 'keys-2022-11-05-1232.sshpry.log'
[+] Target TTY session file: 'sess-2022-11-05-1232.sshpry.log'

[+] Attaching to 1511 at /dev/pts/1...
(<class 'TypeError'>, TypeError("a bytes-like object is required, not 'str'"), <traceback object at 0x7f8dd83da900>)

i cant get session ssh

root@kali:~/Desktop/SSHPry2.0# ./sshpry2.py --tty /dev/pts/2

SSHPry2 SSH-TTY control by @nopernik 2017

[+] Getting available ssh connections...
[+] Target TTY keystrokes file: 'keys-2020-03-28-0834.sshpry.log'
[+] Target TTY session file: 'sess-2020-03-28-0834.sshpry.log'

[+] Attaching to 18809 at /dev/pts/2...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "./sshpry2.py", line 105, in PryonTTY
sshpipe = Popen(['strace', '-s', '16384', '-p', z.pid, '-e', 'read,write'], shell=False, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Crash by use --auto parameter

Hello,
If I'll use the --auto parameter, the programm crash with the following Error-Code:

user@test:~/test/SSHPry2.0$ sudo python sshpry2.py

SSHPry2 SSH-TTY control by @nopernik 2017

Usage: sshpry2.py [OPTIONS]

Args: --auto                # Lazy mode, auto-attach to first found session
      --list                # List available SSH Sessions
      --tty /dev/pts/XX     # Point SSHPry to specific TTY
      --raw                 # Record and Play raw term output, no timing.
      --replay <file>       # Replace previously recorded session.
      --speed 4             # Replay speed multiplier (Default: 4).

             ----- root privileges required! -----

user@test:~/test/SSHPry2.0$ sudo python sshpry2.py --list

SSHPry2 SSH-TTY control by @nopernik 2017

[+] Getting available ssh connections...
[+] Found active SSH connections:
        PID: 21508 | TTY: /dev/pts/1 (user)

[!] Choose yours with "--tty TTY" switch

user@test:~/test/SSHPry2.0$ sudo python sshpry2.py --auto

SSHPry2 SSH-TTY control by @nopernik 2017

[+] Getting available ssh connections...
[+] Found active SSH connections:
        PID: 21508 | TTY: /dev/pts/1 (user)

[+] -- Lazy mode activated -- :-)

[+] Target TTY keystrokes file: 'keys-2020-03-24-1931.sshpry.log'
[+] Target TTY session file: 'sess-2020-03-24-1931.sshpry.log'

[+] Attaching to 21508 at /dev/pts/1...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "sshpry2.py", line 105, in PryonTTY
    sshpipe = Popen(['strace', '-s', '16384', '-p', z.pid, '-e', 'read,write'], shell=False, stdout=PIPE, stderr=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Can anybody help me?

Crash while attaching to TTY

Hi!

SSHPry is not working for me, when I'm tying to attach to a TTY, it crashes.
I'm using Python 3.5.2 on Ubuntu 16.04.4 x64.
I thought maybe I should use pyton2, but the code looks pretty much like its written in python3.

Crash log:

[+] Attaching to 1668 at /dev/pts/1...
(<class 'TypeError'>, TypeError("a bytes-like object is required, not 'str'",), <traceback object at 0x7fad8a9ae848>)
root@ubnt:~/SSHPry2.0#

Thank you for your help.

Note strace dependency somewhere

A apt install strace for apt based systems and other package managers in the readme would be nice. And maybe fail with a nicer message than this:

Exception in thread Thread-1:                                                                                                                                                                                     
Traceback (most recent call last):                                                                                                                                                                                
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner                                                                                                                                           
    self.run()                                                                                                                                                                                                    
  File "/usr/lib/python3.7/threading.py", line 865, in run                                                                                                                                                        
    self._target(*self._args, **self._kwargs)                                                                                                                                                                     
  File "sshpry2.py", line 105, in PryonTTY                                                                                                                                                                        
    sshpipe = Popen(['strace', '-s', '16384', '-p', z.pid, '-e', 'read,write'], shell=False, stdout=PIPE, stderr=PIPE)                                                                                            
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__                                                                                                                                                  
    restore_signals, start_new_session)                                                                                                                                                                           
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child                                                                                                                                           
    raise child_exception_type(errno_num, err_msg, err_filename)                                                                                                                                                  
FileNotFoundError: [Errno 2] No such file or directory: 'strace': 'strace' 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.