Reputation: 2546
I have a requirement to see if a file has been altered - is it possible to have a hash "know" what the hash is after the hash and then insert it into the code?
I guess what I am talking about is rather odd, but it may be possible by creating deliberate collisions.
Here is a pseudo code
EG:
FILE1)#
_______
|<?php
| require("someRequire.php");
| checkThisFilesHashEquals(originPathName,"QJFOQOFJEQWOFHWEGHWG");
|
and therefore FILE1 itself's hash is "QJFOQOFJEQWOFHWEGHWG" because checkThisFilesHashEquals(originPathName)
does in fact check that the hash of originPathName does in fact equal "QJFOQOFJEQWOFHWEGHWG"
Has anyone heard of anyone doing this? Using collisions to somehow self hash a file?
Upvotes: 0
Views: 92
Reputation: 34103
PoC || GTFO 14 contains its own MD5 hash, and demonstrates the code necessary to pull off such a feat.
Upvotes: 1