1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-27 19:04:15 +01:00

Merge branch 'master' of github.com:calebstewart/pwncat

This commit is contained in:
Caleb Stewart 2020-05-24 01:12:20 -04:00
commit 77eea0f71e
2 changed files with 9 additions and 8 deletions

View File

@ -186,15 +186,13 @@ class Command(CommandDefinition):
if args.identity: if args.identity:
try: try:
# Load the private key for the user # Load the private key for the user
key = paramiko.RSAKey.from_private_key_file( key = paramiko.RSAKey.from_private_key_file(args.identity)
pwncat.victim.config["privkey"]
)
except: except:
password = prompt( password = prompt(
"RSA Private Key Passphrase: ", is_password=True "RSA Private Key Passphrase: ", is_password=True
) )
key = paramiko.RSAKey.from_private_key_file( key = paramiko.RSAKey.from_private_key_file(
pwncat.victim.config["privkey"], password args.identity, password
) )
# Attempt authentication # Attempt authentication

View File

@ -8,6 +8,7 @@ import sys
import time import time
from typing import Dict, Optional, IO, Any, List, Tuple, Iterator, Union from typing import Dict, Optional, IO, Any, List, Tuple, Iterator, Union
import paramiko
import requests import requests
from colorama import Fore from colorama import Fore
from sqlalchemy.engine import Engine, create_engine from sqlalchemy.engine import Engine, create_engine
@ -324,10 +325,12 @@ class Victim:
raise RuntimeError("no available methods to spawn a pty!") raise RuntimeError("no available methods to spawn a pty!")
# Open the PTY # Open the PTY
util.info( if not isinstance(self.client, paramiko.Channel):
f"opening pseudoterminal via {Fore.GREEN}{method}{Fore.RESET}", overlay=True util.info(
) f"opening pseudoterminal via {Fore.GREEN}{method}{Fore.RESET}",
self.run(method_cmd, wait=False) overlay=True,
)
self.run(method_cmd, wait=False)
# This stuff won't carry through to the PTY, so we need to reset it again. # This stuff won't carry through to the PTY, so we need to reset it again.
util.info("setting terminal prompt", overlay=True) util.info("setting terminal prompt", overlay=True)