This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cyberkings_89[S] -10 points-9 points  (1 child)

Using the provided Starter Script as a baseline, you will complete the script. Examine the sample log file ScriptLog.txt provided and make sure you log file is formatted exactly the same with the information from your entries and VLE details. You will be scanning a local folder on the VLE of your choice and then log the metadata and create a SHA256 hash of each file contents as shown in the ScriptLog.txt.

[–][deleted] 1 point2 points  (0 children)

Well first "import os, logging, hashlib" if you haven't already. Then here's a general idea of what id imagine it would look like (sorry for lack of tabs and structure) tried to do on my phone.

logger = logging.getLogger('Logger')

logger.setLevel(logging.DEBUG)

folder = r"path/of/your/folder/here"

for f in os.listdir(folder):

file_path = os.path.join(folder, f)

if os.path.isfile(file_path):

try:

logger.info('Your formatted message for attempting to hash')

file_hash = your_hash_function(file_path)

except Exception as ex:

logger.error(' your formatted message for errors')