I found this Perl program:
''=~('(?{'.(']])@+}'^'-/@._]').'"'.('/<[*-_<+>?}{>]@}+@}]])@+}@<[*-_<+>?}{>]@^'^'`^=_^<]_[[]+[/,]_/]-/@._]/^=_^<]_[[]+[/,|').',$/})')
It prints "Obfuscated Perl to print obfuscated Perl"
I want to know how it actually prints this.
Perl is a fairly straightforward, widely known and well-respected scripting language. It is used for a variety of tasks (for example, you can use it to create the equivalent of DOS batch files or C shell scripts), but in the context of Web development it is used to develop CGI scripts.
Perl is a high-level, interpreted, general-purpose programming language originally developed for text manipulation. It borrows many features from C and Shell script and is used for system administration, networking, and other applications that involve user interfaces.
Perl is InterpretedTraditional compilers convert programs into machine language. When you run a Perl program, it's first compiled into a byte code, which is then converted ( as the program runs) into machine instructions.
It is making good use of the bitwise string XOR operator ^
.
']])@+}' ^ '-/@._]'
evaluates to print
,
'/<[*-_<+>?}{>]@}+@}]])@+}@<[*-_<+>?}{>]@^'
^ '`^=_^<]_[[]+[/,]_/]-/@._]/^=_^<]_[[]+[/,|'
evaluates to Obfuscated Perl to print obfuscated Perl"
and the whole program reduces to
$ perl -MO=Deparse ...
'' =~ m[(?{print "Obfuscated Perl to print obfuscated Perl",$/})];
... syntax OK
Related: Acme::EyeDrops
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With