Reverting sha1 values to original file names

Is there a way revert the sha1 values to its original file name? Can the sha1 tool help with this or not? I really could use help on this task.

Very Respectfully,

Alex

I assume you want to take the SHA1 named files in a relay or root server cache and rename them to their original file name?

The best way to do this would be to query BigFix using session relevance to determine what the original filename was based upon the SHA1.

If you only had to do this for a single item, I would just query it and then rename it by hand.

If you had to do this for many items, I would automate it with the REST API.

Thanks @jgstew for your response, but I don’t know what a REST API is nor how to use it and I am not an expert manipulating relevance code to figure this out on my own. Unfortunately I need to find quite a few hundred of these files and I would like to automate the process as much as possible. Would you be able to point at what kind of documentation I need to read or how do I get this REST API going?

Thanks again for your help,

V/R,

Alex

I have some examples on BigFix.Me

Documentation: https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli+Endpoint+Manager/page/REST+API

Why do you need to do this?

Here is session relevance that will return the FileNames and SHA1s for all prefetch statements in bigfix content: https://bigfix.me/relevance/details/3005829

unique values of (it as trimmed string) whose(it does not contain "{" AND it does not contain "//" AND it does not contain "&") of (following text of first " name=" of it | it) of preceding texts of firsts " size" of (substrings separated by "prefetch" of it) whose(it as lowercase contains " sha1") of scripts whose(it as lowercase contains " sha1" AND it as lowercase contains "prefetch") of actions of custom bes fixlets

This goes a bit further:

unique values of (concatenations ", " of (substrings separated by " sha1=" of it) of (substrings separated by " sha1:" of it)) of unique values of (it as trimmed string) whose(it does not contain "{" AND it does not contain "//" AND it does not contain "&") of (following text of first " name=" of it | it) of preceding texts of firsts " size" of (substrings separated by "prefetch" of it) whose(it as lowercase contains " sha1") of scripts whose(it as lowercase contains " sha1" AND it as lowercase contains "prefetch") of actions of custom bes fixlets
1 Like

Thanks jgstew for your answer. I administer an offline BigFix installation. I used the BESDownloader tool to download microsoft updates for remote computers I need to patch. These systems is also in a remote facility and I have no remote access to it. These machines gets connected to my network using a dial-up connection which is why I don’t want to use this line for patch management tasks. I needed the FileName conversion because I am patching this computer using batch files that the remote operator needs to run. This remote operator has not interaction or technical expertise with BigFix. Since I have all the files downloaded into a external drive and with your solution here, what do you think is the best solution to rename these files.

I’d say using the REST API and some programming language to get the file names and SHA1 values, and then copy the files somewhere with the “correct” file names.

I personally prefer Python, but PowerShell is probably a better fit in this case.

Thanks jgstew,
I am already trying to script this task using PowerShell. I just needed the relation between sha1 and kb filenames. I’ll keep you posted.

Thanks again,

V/R,

Alex

1 Like

Alex, I’m wondering if you ever managed to create this script? I’m also looking for this sort of thing, but we have no scripting knowledge atm :frowning: