# # To install this program: # # mkdir /etc/abdemon # # cd /etc/abdemon # # jed /user.conf # # write here user and pass coded in base64 :) # # user:pass # # jed /abcomand.conf # # write here the command to startup or shtudown the demon # # Demon Name:command:Description #!/usr/bin/perl -w use strict; use warnings; use IO::Socket::INET; use MIME::Base64; sub login{ print"Starting LogIN\n"; my $session = $_[0]; print $session "LogIN: AbsoluteDemon\n\r"; print $session "UserName:"; my $ut=<$session>; print $session "Pass:"; my $pa=<$session>; open DB, "<", "user.conf"; #open DB, ">", "/etc/abdemon/user.conf"; $a=<DB>; my @vagone=split( /:/, $a); my $user=beis($vagone[0]); my $pass=beis($vagone[1]); chomp($user, $pass); $ut =~ s/\r\n\z//; $pa =~ s/\r\n\z//; chomp($ut, $pa); if ($ut eq $user) { if ($pa eq $pass){ print "LogIN Succesfull\n"; + choose($session);}} else { print $session "User can NOT log in"; sleep 1; uail(); }} sub choose { my $session=$_[0]; my @comz; my $ch; #open COM, "<", "/etc/abdemon/adcomand.conf"; open COM, "<", "C:/abd/abcomand.conf"; my $num=0; while (my $riga=<COM>) { $num=$num+1; print $session "$num, $riga\n\r"; $comz[$num]=$riga; #array che c +ontiene i comandi pił il numero } do { $ch=<$session>; #ricevo i +l numero di comando $ch =~ s/\n\r\z//; my $dirty=$comz[$ch]; #tiro fuo +ri la riga e la chompo chomp($dirty); my @command=split( /:/, $dirty); + #tiro fuori il comando print $session "$command[1]\n\r"; print "$ch\n\r"; system($command[1]); print $session "And now?"} while ($ch ne "0"); close $session; close COM; sleep 10; uail(); } sub beis { my $a=decode_base64($_[0]); print "Decoding..\n"; return $a;} sub uail { my @time = (localtime); my $sock = new IO::Socket::INET( LocalPort => '7350', #Localaddr =>'localhost', Proto => 'tcp', Listen => '1') or die "Cannot Listen on sock! +$!\n"; my $session = $sock->accept; print "Socket Created\n"; # open LOGZ, '>>', '/etc/abdemon/access_log'; open LOGZ, '>>', 'logz.txt'; my $ip=$session->peerhost; print (LOGZ "$ip at time: $time[2]h $time[1]m $time[0]s Da +y: $time[3]/$time[4]($time[5]-100) "); close LOGZ; print"Logged IP\n"; login($session); close $sock;} print"Absolute Demon 1.0 (un)stable relase\n"; chdir "C:/abd"; uail();

In reply to BigDemon by LordScinawa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.