Target directory navigation

We will now address a directory navigation issue. Now, the problem is that browsing directories is restricted to the shell working directories. For instance, if the target has executed our Python script on the Desktop, then our working directory will be the Desktop. And due to shell limitations, we cannot simply type cd and move on to another directory. Remember we learned that some commands won't work in a shell, and cd is one of them.

Once we run our previous TCP reverse shell on both sides, you will see our current working directory is on the Desktop, where our Python exists. Notice what will happen when a cd command is issued to change the current working directory to C:\Users. Our script will become non-responsive ...

Get Python for Offensive PenTest now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.