Archive - Jan 5, 2007

Date

PHP Bacillus sphaericus

The first version of PHP Bacteria.
This is actually like make a script that:
replicate self:
easy, read self(for script languages), or read the predefined string that store the source code(for non-script languages) and save as another copy somewhere in the hard disk
Manipulate replicated self:
make it unreadable but it still work like the original...
to do that, I just have to trash your code, sugar coat, encrypt, encode or anything possible to let it can't be easily understand...
here is my version... the most basic version because I have to tell you guys I don't know regex, which made this thing pretty hard.
if I do know regex, I can do a lot more operations... like trashing... but now I can only make variables harder to read >.< but this have done what is required... each copy of the script that generated can be used to regenerate a another copy that does the same thing but looks different.
I might update my version soon... doing some regex crash course...
I name this script... PHP Bacillus sphaericus... one of the oldest bacteria...

$fp = fopen(__FILE__, 'rb');
$script = fread($fp, filesize(__FILE__));
$script = str_replace('$fp', '$V'.md5('$fp'),$script);
$script = str_replace('$script', '$V'.md5('$script'),$script);
$fp = fopen(md5($script).'.php', 'wb');
fwrite($fp, $script);
echo 'replicated';
Honey Pot that kill bots