I'm sure I am not doing this the right way, I'm not a programmer at all, rather an information security professional. We have a need to compare the MD5 value of files to a list of known bad, and I think Perl would be a good way to do it. I'm basically taking it one piece at a time.
1.) Scan the remote system and put all of the filenames and locations into a data set (multidimensional array in this case).
2.) Take that data, and compare to the MD5 list (comma delimited file with "filename,hash value") using the intersect of the two lists of filenames.
3.) I then need to take the list of filenames and their paths (many files have multiple matches but in different directories), and get the MD5 hash of the remote file and compare it to the bad MD5.
4.) If there is a match, somehow identify this and then run a report at the end, or just spit it out to a log file during the match.
You had a nice list of things I did incorrectly, if you would like to provide an outline of how to do this correctly, I'd be happy to restart on the script (it isn't that long). I'll be completing my undergraduate degree at the end of this month and plan to focus on learning Perl and C/C++, so this would be a good learning opportunity for me.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.