Using file sweeping capabilities in Metasploit is effortless. The enum_files post exploitation module helps to automate file collection services. Let's see how we can use it:
We can see that we used the enum_files post-exploitation module. We used FILE_GLOBS as *.docx OR *.pdf OR *.xlsx, which means that the search will occur on these three types of file formats. Next, we just set the session ID to 5, which is nothing but our session identifier. We can see that as soon as we ran the module, it collected all the files found during the search and downloaded them automatically.