我找到了这段代码,我认为它是编码的。我试图理解它是如何编码的,或者如何阅读它。有没有人有想法解码这段代码?
#!/usr/bin/perl
eval unpack u=>q{_<')I;G0@(EQN7&5<>#5"7'@S,UQX,S-<>#9$7'@U-UQX-C%<>#<R7'@V15QX-CE<>#9%7'@V-UQX,C!<>#4Y_7'@V1EQX-S5<>#(P7'@T1%QX-C%<>#<Y7'@R,%QX-$5<>#8U7'@V-5QX-C1<>#(P7'@U-%QX-D9<>#(P7'@T_.5QX-D5<>#<S7'@W-%QX-C%<>#9#7'@V0UQX,C!<>#<S7'@V1EQX-D1<>#8U7'@P05QX,C!<>#(P7'@R,%QX_,C!<>#(P7'@R,%QX,C!<>#(P7'@R,%QX-$1<>#9&7'@V-%QX-S5<>#9#7'@V-5QX-S-<>#!!7'@R,%QX,C!<_>#(P7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#(P7'@T.%QX-C5<>#<R7'@V-5QX,C!<>#8Y7'@W,UQX,C!<>#0Q_7'@V15QX,C!<>#0U7'@W.%QX-C%<>#9$7'@W,%QX-D-<>#8U7'@S05QX,$%<>#(P7'@R,%QX,C!<>#(P7'@R_,%QX,C!<>#(P7'@R,%QX,C!<>#8S7'@W,%QX-C%<>#9%7'@R,%QX-$5<>#8U7'@W-%QX,T%<>#-!7'@T.5QX_-3!<>#!!7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#(P7'@V,UQX-S!<>#8Q7'@V15QX,C!<_>#1#7'@U-UQX-3!<>#-!7'@S05QX-35<>#<S7'@V-5QX-S)<>#0Q7'@V-UQX-C5<>#9%7'@W-%QX,$%<>#(P_7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#8S7'@W,%QX-C%<>#9%7'@R,%QX-35<>#4R7'@T_.5QX,T%<>#-!7'@U-%QX-CE<>#<T7'@V0UQX-C5<>#!!7'@R,%QX,C!<>#(P7'@R,%QX,C!<>#(P7'@R,%QX_,C!<>#(P7'@U-%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_,S%<>#9$7'@U,UQX-S1<>#8Q7'@W,EQX-S1<>#8Y7'@V15QX-C=<>#(P7'@W-UQX-CE<>#<T7'@V.%QX,C`D_=&AR96%D<UQX,C!<>#<T7'@V.%QX-S)<>#8U7'@V,5QX-C1<>#<S7&Y<>#5"7'@R,5QX-41<>#4S7'@V,UQX_-C%<>#9%7'@V15QX-CE<>#9%7'@V-UQX,C`D05)'5ELP75QX,C!<95QX-4(P7'@V1%QN(CL*9F]R96%C:"!M_>2`D:7`@*$!L;V%D;&ES="D@>PIP<FEN="`B)&EP7&XB.PIP=7-H($!I<%]T96%M+"`D:7`K*R`M/FEP*"D[_"FEF("@@)'1H<F5A9',@/3T@0&EP7W1E86T@*2![(%-C86XH0&EP7W1E86TI.R!`:7!?=&5A;2`]("@I('T*_?0I38V%N*$!I<%]T96%M*3L*"@IS=6(@4V-A;@I["FUY($!0:61S.PH@("`@("`@(&9O<F5A8V@@;7D@)&AO_<W0@*$!?*0H@("`@("`@('L*("`@("`@("!M>2`D<&ED("`@("`@("`](&9O<FLH*3L*("`@("`@("!D:64@_(EQX-#-<>#9&7'@W-5QX-D-<>#8T7'@R,%QX-D5<>#9&7'@W-%QX,C!<>#8V7'@V1EQX-S)<>#9"7'@R,5QX_,C`D(5QN(B!U;FQE<W,@9&5F:6YE9"`D<&ED.PH*("`@("`@("`@("`@("`@(&EF("`H,"`]/2`D<&ED*0H@_("`@("`@("`@("`@("`@>PH@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@('!R:6YT("(D:&]S=%QN_(CL*("`@("`@("`@("`@("`@(&5X:70*("`@("`@("`@("`@("`@('T*("`@("`@("`@("`@("`@(&5L<V4*_("`@("`@("`@("`@("`@('L*("`@("`@("`@("`@("`@('!U<V@@0%!I9',L("1P:60*("`@("`@("`@("`@_("`@('T*("`@("`@("!]"@IF;W)E86-H(&UY("1P:60@*$!0:61S*2![('=A:71P:60H)'!I9"P@,"D@?0I]}
答案 0 :(得分:5)
将eval
替换为print
,您可以看到这里发生了什么:
print "\n\e\x5B\x33\x33\x6D\x57\x61\x72\x6E\x69\x6E\x67\x20\x59\x6F\x75\x20\x4D\x61\x79\x20\x4E\x65\x65\x64\x20\x54\x6F\x20\x49\x6E\x73\x74\x61\x6C\x6C\x20\x73\x6F\x6D\x65\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4D\x6F\x64\x75\x6C\x65\x73\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x48\x65\x72\x65\x20\x69\x73\x20\x41\x6E\x20\x45\x78\x61\x6D\x70\x6C\x65\x3A\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x63\x70\x61\x6E\x20\x4E\x65\x74\x3A\x3A\x49\x50\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x63\x70\x61\x6E\x20\x4C\x57\x50\x3A\x3A\x55\x73\x65\x72\x41\x67\x65\x6E\x74\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x63\x70\x61\x6E\x20\x55\x52\x49\x3A\x3A\x54\x69\x74\x6C\x65\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x54\x68\x61\x6E\x6B\x20\x79\x6F\x75\x20\x46\x6F\x72\x20\x55\x73\x69\x6E\x67\x20\x4D\x79\x20\x53\x63\x72\x69\x70\x74\x0A\x20\x20\x20\x20\x20\x20\x20\x20\x20\x69\x6E\x6A\x33\x63\x74\x6F\x72\x33\e\x5B0\x6D\n";
#sleep("1");
use Net::IP;
use Term::ANSIColor;
use LWP::UserAgent;
use URI::Title qw( title );
use vars qw( $PROG );
my @ip_team = ();
my $PROG = $0;
#Usage
#if ( @ARGV == 0 ) {
# print "\e[45mUsage: ./$PROG [file] [THREADS] [TIMEOUT] [OUTPUT]\nExample perl $0 90.0.23.54 91.0.50.0 1200 1 lol\ninj3ctor3\n";
# exit;
#}
my $ips = $ARGV[0];
open my $handle, "\x3C", $ips;
chomp( my @loadlist = <$handle> );#<============== OPEN UP IPS
close $handle;
my $threads = $ARGV[1];
#my $ip = new Net::IP ("$ARGV[0] - $ARGV[1]") or die "Invaild IP Range.". Net::IP::Error() ."\n";
print "\e\x5B\x33\x31\x6D\x53\x74\x61\x72\x74\x69\x6E\x67\x20\x77\x69\x74\x68\x20$threads\x20\x74\x68\x72\x65\x61\x64\x73\n\x5B\x21\x5D\x53\x63\x61\x6E\x6E\x69\x6E\x67\x20$ARGV[0]\x20\e\x5B0\x6D\n";
foreach my $ip (@loadlist) {
print "$ip\n";
push @ip_team, $ip++ ->ip();
if ( $threads == @ip_team ) { Scan(@ip_team); @ip_team = () }
}
Scan(@ip_team);
sub Scan
{
my @Pids;
foreach my $host (@_)
{
my $pid = fork();
die "\x43\x6F\x75\x6C\x64\x20\x6E\x6F\x74\x20\x66\x6F\x72\x6B\x21\x20$!\n" unless defined $pid;
if (0 == $pid)
{
print "$host\n";
exit
}
else
{
push @Pids, $pid
}
}
foreach my $pid (@Pids) { waitpid($pid, 0) }
}
另请参阅:http://perldoc.perl.org/perlpacktut.html#Uuencoding
模板字母表中的另一个奇怪的人是你,它包含一个&#34; uuencoded 字符串&#34 ;. (&#34; uu&#34;是Unix-to-Unix的缩写。)很可能你不会需要 这种编码技术是为克服缺点而发明的 除了简单的ASCII之外不支持的老式传输介质 数据。基本配方很简单:取三个字节或24位。分开他们 分为4个六包,每个都增加一个空格(0x20)。重复直到所有数据 混合。将4个字节的组折叠成不超过60的行并装饰 它们在前面有原始字节数(递增0x20)和&#34; \ n&#34;在 结束。 - 当你的时候,包装厨师会为你准备一分钟 在菜单上选择包装代码:
my $uubuf = pack( 'u', $bindat );
u设置放入uuencoded行的字节数后的重复计数, 默认情况下最大值为45,但可以设置为某些(较小) 三的整数倍。 unpack只是忽略重复计数。
答案 1 :(得分:3)
如另一张海报所述 - 第一个提取内容的方法是print
而不是eval
以获取一些源代码:
第二阶段是通过-MO=Deparse
运行它以查看是否发生任何奇怪的事情。 (然后perltidy
使其更容易阅读):
#!usr/bin/local/perl
print
"\n\e[33mWarning You May Need To Install some\n Modules\n Here is An Example:\n cpan Net::IP\n cpan LWP::UserAgent\n cpan URI::Title\n Thank you For Using My Script\n inj3ctor3\e[0m\n";
use Term::ANSIColor;
use LWP::UserAgent;
use vars ('$PROG');
my (@ip_team) = ();
my $PROG = $0;
my $ips = $ARGV[0];
open my $handle, '<', $ips;
chomp( my (@loadlist) = <$handle> );
close $handle;
my $threads = $ARGV[1];
print "\e[31mStarting with $threads threads\n[!]Scanning $ARGV[0] \e[0m\n";
foreach my $ip (@loadlist) {
print "$ip\n";
push @ip_team, ( $ip++ )->ip;
if ( $threads == @ip_team ) {
Scan(@ip_team);
@ip_team = ();
}
}
Scan(@ip_team);
sub Scan {
my @Pids;
foreach my $host (@_) {
my $pid = fork;
die "Could not fork! $!\n" unless defined $pid;
if ( 0 == $pid ) {
print "$host\n";
exit;
}
else {
push @Pids, $pid;
}
}
foreach my $pid (@Pids) {
waitpid $pid, 0;
}
}
有帮助的是,那个顶级块包含了谁编写它的签名。同样,因为我完全想要重复使用这个非常有用的东西。
[33mWarning You May Need To Install some
Modules
Here is An Example:
cpan Net::IP
cpan LWP::UserAgent
cpan URI::Title
Thank you For Using My Script
inj3ctor3[0m
所以看起来它的作用是:
$ARGV[1]
限制的块。 Net::IP
格式化地址IP 以四字形格式返回IP地址(或前缀或范围的第一个IP),作为字符串。 print($ ip-&gt; ip());
Scan
:所以......除非我遗漏了一些深刻的东西,否则这个剧本实际上并没有做任何事情。它只打印一个IP地址列表,如果叉子的数量设置得很高,可能可能用于分叉炸弹。
但是你可以看到 - perl的一个优点(有些可能称之为缺点)是它很难混淆它,因为它是一种解释型语言。