forked from julienbedard/browsersploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencp.pl
50 lines (39 loc) · 858 Bytes
/
encp.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl
#
# Xor with password
#
use MIME::Base64;
$file = $ARGV[0];
open(ENC, ">>$file.enc");
open(PLAIN, "<$file");
while (<PLAIN>)
{
$input .= $_;
}
close(PLAIN);
# Do encryption operation
chomp($input);
$mama = encode_base64($input);
#Complete the Sub
$sub = 'sub decry ($){ local($^W) = 0;my $str = shift;my $res = "";
$str =~ tr|A-Za-z0-9+=/||cd;$str =~ s/=+$//; $str =~ tr|A-Za-z0-9+/| -_|;
while ($str =~ /(.{1,60})/gs) {my $len = chr(32 + length($1)*3/4);
$res .= unpack("u", $len . $1 ); }$res;}';
#save to encfile
print ENC <<EOF;
#!/usr/bin/perl
#
# This module is a part of Ez Install Converter
#
# Do not modify this file
#
# Use on your own systems only or where you have
# permission to use this tool.
#
$sub
my \$crojhg = '$mama';
eval(decry(\$crojhg));
EOF
close(ENC);
unlink("$file");
rename "$file.enc",$file;