User Control Panel
Advertisements

HELP US, HELP YOU!

!perl command

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

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

PostPosted: Fri Jan 23, 2004 8:40 pm    Post subject: Reply with quote

Here's a !perl command for executing Perl functions. You may want to put an isAdmin or something in, this command is used on a bot where it won't even be called unless you have the right authority so I never put any isAdmin subs in.

Code:
sub perl {<br />   my ($self,$client,$msg,$listener) = @_;<br /><br />   # Cut the command off..<br />   my $sym = get_comm_code();<br />   my $comm = ($sym . "perl");<br />   $msg =~ s/$comm //ig;<br />   $msg =~ s/$comm//ig;<br /><br />   # Convert HTML symbols.<br />   $msg =~ s/\"\;/"/ig;<br />   $msg =~ s/\&apos\;/'/ig;<br />   $msg =~ s/\<\;/</ig;<br />   $msg =~ s/\>\;/>/ig;<br />   $msg =~ s/\&\;/\&/ig;<br /><br />   # Execute the Perl command.<br />   if ($msg) {<br />  eval ($msg);<br />  $reply = "I have executed the Perl function.\n\n$msg";<br />   }<br />   else {<br />  $reply = "You must put a Perl command in your message.\n\n!perl print \"Hello!\\n\\n\" ";<br />   }<br /><br />   # Return the reply.<br />   return $reply;<br />}<br />1;
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Fri Jan 23, 2004 8:43 pm    Post subject: Reply with quote

Cool. you should capture the STDOUT output and return it to the user so they can see its output Smile
_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Jan 23, 2004 8:57 pm    Post subject: Reply with quote

!perl die
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Fri Jan 23, 2004 9:11 pm    Post subject: Reply with quote

!perl unlink ;

you better make sure to make this admin only if you use it
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Jan 24, 2004 2:01 am    Post subject: Reply with quote

Nate has a habit of posting code and bots that have backdoors or can be used (by him) to do damage to unsuspecting users.

I suggest nobody use this command unless you are completely sure of what you are doing.
Back to top
Luke
Member
Member


Joined: 01 Nov 2003
Posts: 111

Reputation: 32.8Reputation: 32.8Reputation: 32.8

PostPosted: Sat Jan 24, 2004 2:10 am    Post subject: Reply with quote

indeed
Back to top
Drayshak
Young One
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sat Jan 24, 2004 10:39 am    Post subject: Reply with quote

hmmmm Sad lol subroutine undefined &msn::bot::get_comm_code
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 Jan 24, 2004 3:44 pm    Post subject: Reply with quote

QUOTE(Chrono945 @ Jan 24 2004, 05:39 AM)
hmmmm Sad lol subroutine undefined &msn::bot::get_comm_code

That's a sub I put into the bot that would get the command code... (i.e. # ! / \ etc)

QUOTE(Mojave)
Nate has a habit of posting code and bots that have backdoors or can be used (by him) to do damage to unsuspecting users.


I did that ONCE, it takes three to become a habit. Razz
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Sat Jan 24, 2004 7:14 pm    Post subject: Reply with quote

For grabbing the command code before the name of the command it makes more sense to do that wherever you are calling the commands from. Andromedas commands sub strips the command char and the command itself off before sending the msg to the command, so commands don't need to worry about stripping that crap off.
_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Jan 24, 2004 7:33 pm    Post subject: Reply with quote

QUOTE(Nate @ Jan 24 2004, 07:44 AM)
I did that ONCE, it takes three to become a habit.  Razz

The 'first' time was worth 10 by itself and this 'second' time is worth at least 3. You're way over your limit.

Stop posting potentially malicious, dangerous and tricky code! It's giving you a very bad reputation.
Back to top
Myzterio
Not Yet a God
Not Yet a God


Joined: 13 Dec 2003
Posts: 429

Reputation: 38.1Reputation: 38.1Reputation: 38.1Reputation: 38.1

PostPosted: Sat Jan 24, 2004 7:44 pm    Post subject: Reply with quote

How would nates code be a Stop posting potentially malicious, dangerous and tricky code.. isnt it a regular perl code?
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 Jan 24, 2004 7:54 pm    Post subject: Reply with quote

QUOTE(Mojave @ Jan 24 2004, 02:33 PM)
Stop posting potentially malicious, dangerous and tricky code! It's giving you a very bad reputation.

Grr

You go through that code character by character.

How are there any backdoors or anything in that? I mentioned at the beginning that "You may want to put an isAdmin or something in,"

The reason that was not included is because MY bot sorts commands by different folders, and MY bot will NOT even consider calling that command if it knows the user isn't gifted enough to have access to it.

So stop giving me negative rep points, there is nothing even remotely malicious about that code that could damage an unsuspecting user. Just because the command is left with limitless possibilities for use of the botmaster doesn't mean I would have any way of using them on another bot.

So just STOP jumping to conclusions, aiight?
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Jan 24, 2004 8:54 pm    Post subject: Reply with quote

Any time you have a completely unrestricted use of the perl function eval, you've got very dangerous code. As Keenie and I have pointed out, it can be used to kill the script or worse to hack a computer (delete files, execute other scipts, etc). This is rule #1 for any new perl programmer. eval is powerful but dangerous when used unrestricted.

I've gone through the code character by character and when I got to the eval, a big warning light went off. Of course, if you put this code in your bot but never call it, it's harmless, but that would be stupid. The problem is that many posters in this forum are newbies, who see a new command and think "cool, a new command, sounds useful, I'll stick it in my commands folder, yay!". They don't even look at the code, they copy and paste and they don't understand what eval does anyhow. Even for experienced programmers or those just moving to perl, it's easy to miss.

The reason I gave you negative rep points and have been so vocal in pointing out how dangerous it is for YOU to be posting this code is because of your history of including backdoors in your code. I'm sure you're hoping people install this, make a mistake and make it a public command and then you and your friends have access to their machines. Just as you made yourself admins in that Chaos bot you wanted people to download.

Quote:
there is nothing even remotely malicious about that code that could damage an unsuspecting user


That's just a flat out lie - eval is dangerous to unsuspecting users. Keenie, Luke and I (all experienced and knowing programmers) have told you and others that and shown examples of how it can be used badly.

Besides which, nobody needs this command. Start posting useful safe code.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands 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