‫So since we were going to see the interpreter command in the post exploitation section in detail, right
‫now, we're only going to look at a few examples of the basic interpreter commands.
‫So there are minor differences between Windows and Linux interpreter sessions.
‫This is why I'd like to show you the interpreter session in both machines.
‫In our last lecture, we had a maturity session on Metasploit of a Linux machine.
‫Let's continue to see the basic interpreter commands on that session.
‫So a good habit to get into is looking at this system info, which is the first command that I run when
‫I interact with a maturity session just so I can see which system I am in.
‫Never to double check.
‫OK, I'm on Metasploit.
‫Help is the second command I'd like to show.
‫And surprisingly, it shows the available commands in this miniature session.
‫Commands are grouped, and we'll talk about it more in the following lectures, but the command names
‫are at the left hand side in the descriptions of commands are on the right hand side.
‫And here's another command group anyway.
‫So first of all, let's see how we can manage interpreter sessions.
‫If you're in a interpretive session, you can go back to MSF's console with the background command.
‫And now we're on MSF show.
‫Sessions L is to list the active sessions now, the sessions may or may not be interpreted as sessions,
‫but you'll see the session tape in the third column of the Sessions list.
‫In fact, the sessions command with no parameter lists the sessions as well, so you don't need to use
‫the L parameter.
‫The first column of the list shows the ID numbers of the Sessions information column shows the user
‫and the system connected, and the connection column shows the attacker and the victim systems, IP
‫addresses and the connected ports.
‫Use this session's command with the eye parameter to interact with any of these sessions.
‫Simply give the ID number the session you want to interact with.
‫And we're in the MetaTrader session of the Metasploit of Linux again.
‫Now to see our current position in the target system.
‫We'll use the D command.
‫OK, if you are familiar with the Linux system, you already know that the command is a standard Linux
‫command to print working directory.
‫Well, you're wrong here.
‫It's a mature predicament, and it runs under the other operating system sessions as well, which I'll
‫show you in a couple of minutes.
‫The interpreter filesystem commands are mostly similar to the Linux file system commands.
‫We're on the root folder, we can use the Alaska man to see the files in this folder.
‫The CD command to change or to move to another folder, for example, Etsy.
‫And now we are in its full.
‫So we can use the CD command to go back to the root folder again.
‫The next command is debt UUID.
‫It's used to show which user you are on that system.
‫We are the root user, which is very good for us, but not for the victim.
‫Get PID is to see the ID number, the process that we are injected into, but it seems it's not available
‫on Linux systems.
‫OK, I'll show it on a Windows system soon.
‫Stay tuned.
‫The peace command is to see the running processes on that system.
‫So hash dump is a very useful command for ethical hackers, as you might guess, it lists the hashes
‫of the user of this system.
‫But remember, you can access the hash files if you have the root or the admin privileges.
‫Otherwise, interpreter cannot gather the hashes.
‫But don't worry, there are a few tricks up our sleeves to escalate the privilege.
‫Well, now it seems interpreted does not have the harsh don't command for Linux systems.
‫But again, no worries because we can use a post module to gather hashes.
‫We'll see that in detail in the post exploitation lecture.
‫So just to show you that we have alternatives.
‫Let's run this post exploitation module.
‫Run post.
‫Slash wind, no, not Windows.
‫It's a Linux system.
‫Slash gather, slash, hash dump and hit enter.
‫Remember Metasploit framework and interpret her have code completion.
‫So you can just use the tab key to complete the words.
‫And here are the usernames and the password hashes.
‫Now, I don't know if I need to stress to you that this is very important data, so will use these hashes
‫for some of our purposes a little bit later.
‫But first, let me show you that idle time is another useful motivator command, which displays the
‫number of seconds that the user at the remote machine has been idle.
‫If you'd like to log out the user or restart the system for any reason.
‫You better look at the idle time first, so you understand if the user is using the machine at that
‫time or if he or she is away.
‫And again, it seems that the idle time command doesn't work for the Linux systems, so I'll show it
‫to you for the Windows system.
‫If config command displays the network interfaces and addresses on the remote machine.
‫Alternatively, IPconfig does the same thing.
‫Some interpreter also has a commands to interact with a local file system.
‫Now, because you're on the maternity session in the terminal window, you don't see the current position
‫by default.
‫So you want to use the LP, WD Command to see the local position.
‫Think of it as the abbreviation of local print working directory.
‫And it changed the local position.
‫You can use the LCD command.
‫And double dot brings us one folder out and give the path you want to go to as a parameter of the LCD
‫command.
‫Now, as you know, search command is used to look for the modules in a Metasploit Framework console
‫interpreter.
‫The search command has a completely different purpose.
‫It provides a way of locating specific files on the target host.
‫The command is capable of searching through the whole system or specific folders.
‫Wild cards such as Star can also be used when creating the file pattern to search for.
‫So give the file name with the F parameter.
‫You will find it and show the position if it exists.
‫So here it is.
‫Shadow file is under the Etsy folder.
‫Now, don't fall into the trap.
‫This is El PWI command, so it shows the local position.
‫And we can use the cat command in to see the content of the shadow file and hear the password hashes
‫once again.
‫All right.
‫So lastly, if you'd like to have a shell access to the target machine, you can use the shell material
‫to command.
‫So the channel has created no command prompt, but it's OK, we have the show.
‫To see the list of files and folders, if config to see the IP address.
‫And because we in a Linux shell, we cannot use interpreter search command to find a file, we have
‫to use the Linux find command instead.
‫And type exit to exit the shell interaction, and we're in the maturity recession again.