diff --git a/.gitignore b/.gitignore index b00ed0a..e1740c9 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ testing/ data/pwncat.sqlite-journal pwncat.sqlite-journal linpeas.txt +NOTES.md + diff --git a/pwncat/privesc/__init__.py b/pwncat/privesc/__init__.py index a5d4e36..c1dfa06 100644 --- a/pwncat/privesc/__init__.py +++ b/pwncat/privesc/__init__.py @@ -380,6 +380,12 @@ class Finder: readers: List[Technique] = [] writers: List[Technique] = [] + # A previous escalation attempt may have left us in a working directory + # that causes problems during escalation (e.g. a home directory). Ensure + # we are in a safe directory + pwncat.victim.flush_output() + pwncat.victim.chdir("/tmp") + for technique in techniques: if Capability.SHELL in technique.capabilities: try: