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';

hey, sry i had a lil trouble

serfczar's picture

hey, sry i had a lil trouble understanding it, thx for explaining! I may start a working C++ version of this "bacteria", but it will report all of the machines it is on.

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.

More information about formatting options

What is 3 + 12?
To combat spam, please solve the math question above.
Honey Pot that kill bots