1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-23 17:15:38 +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:
try:
# Load the private key for the user
key = paramiko.RSAKey.from_private_key_file(
pwncat.victim.config["privkey"]
)
key = paramiko.RSAKey.from_private_key_file(args.identity)
except:
password = prompt(
"RSA Private Key Passphrase: ", is_password=True
)
key = paramiko.RSAKey.from_private_key_file(
pwncat.victim.config["privkey"], password
args.identity, password
)
# Attempt authentication

View File

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