mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-24 01:25:37 +01:00
Added check for correct paramiko version at runtime to mitigate version problems.
This commit is contained in:
parent
867bd66af7
commit
0b2458462b
@ -4,9 +4,11 @@ import selectors
|
||||
import shlex
|
||||
import sys
|
||||
import warnings
|
||||
import inspect
|
||||
|
||||
from sqlalchemy import exc as sa_exc
|
||||
from sqlalchemy.exc import InvalidRequestError
|
||||
from paramiko.buffered_pipe import BufferedPipe
|
||||
|
||||
import pwncat
|
||||
from pwncat.util import console
|
||||
@ -15,6 +17,18 @@ from pwncat.remote import Victim
|
||||
|
||||
def main():
|
||||
|
||||
params = inspect.signature(BufferedPipe.read).parameters
|
||||
|
||||
if "flags" not in params:
|
||||
console.log(
|
||||
f"[red]error[/red]: pwncat requires a custom fork of paramiko. This can be installed with `pip install -U git+https://github.com/calebstewart/paramiko`"
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# Ignore SQL Alchemy warnings
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", category=sa_exc.SAWarning)
|
||||
|
||||
# Default log-level is "INFO"
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
@ -76,10 +90,6 @@ def main():
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# Ignore SQL Alchemy warnings
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", category=sa_exc.SAWarning)
|
||||
|
||||
main()
|
||||
|
||||
sys.exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user