User Control Panel
Advertisements

HELP US, HELP YOU!

Logging in Command Prompt

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Chat & Discussion
View unanswered posts
Author Message
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Fri Dec 05, 2003 9:19 pm    Post subject: Reply with quote

Hey... I was reading through some of the posts, and someone suggested an idea about having command log the program in a text document.

Quote:
perl bot.pl > log.txt


I think that thats a great idea...and it works fine.
But is there a way to have command log the events in the file and still display all the events in the command screen?

I want to do this so that I can read the events as they happen, but I also want to backup the file in case there are errors.

_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Fri Dec 05, 2003 9:43 pm    Post subject: Reply with quote

Doesn't it do it already?
Back to top
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Fri Dec 05, 2003 10:48 pm    Post subject: Reply with quote

It does...if you don't put
Quote:
> log.txt
in the command
_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Fri Dec 05, 2003 11:15 pm    Post subject: Reply with quote

Hm.... I remember having to do that once for an HTTP server I programmed, for it to be able to run Perl scripts online. I thought it printed it to the window... :blink:
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Dec 06, 2003 12:03 am    Post subject: Reply with quote

print() sends text to STDOUT or STDERR. When you type

Quote:
perl bot.pl > log.txt


you are simply redirecting STDOUT to a file called log.txt.

If you want text to show up in both STDOUT and a text file, you should create a new function, something like debug() that prints the same text to STDOUT and to a text file. In addition, you can have this function check a flag, say $debug, to see if it should print anything to STDOUT. That way, you can easily turn debugging on and off by changing the value of $debug.
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Sat Dec 06, 2003 2:21 am    Post subject: Reply with quote

My idea was just to make a sub, say "sub Echo" or something, that does all your printing. So instead of doing
print "message\n";
you do
Echo "message\n";

And then sub Echo would print the message to the console, AND write it into a text file.
Back to top
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Sat Dec 06, 2003 3:55 am    Post subject: Reply with quote

I already have all my "$victim: $msg" "$screenname: $reply" print to a text file...

...and they do print to the console....but i want everything to be printed to a document...again..once it hits the console....including the commands and errors

_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Dec 06, 2003 5:48 am    Post subject: Reply with quote

QUOTE(Nate @ Dec 5 2003, 06:21 PM)
My idea was just to make a sub, say "sub Echo" or something, that does all your printing. So instead of doing
print "message\n";
you do
Echo "message\n";

And then sub Echo would print the message to the console, AND write it into a text file.

hehe, and what did you think my debug() was supposed to do? Exactly what you just wrote down. hehe Wink

Read my post, it's not just there as filler.
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Sat Dec 06, 2003 6:21 pm    Post subject: Reply with quote

QUOTE(Nate @ Dec 5 2003, 06:21 PM)
My idea was just to make a sub, say "sub Echo" or something, that does all your printing. So instead of doing
print "message\n";
you do
Echo "message\n";

And then sub Echo would print the message to the console, AND write it into a text file.

Do that then. And then you can make your special subs like log_im that will send the text to a different text file, like "logs/$victim.txt"
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Chat & Discussion All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group