Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Completely removing a perl function.

by Anonymous Monk
on Jun 28, 2006 at 14:18 UTC ( #558026=note: print w/replies, xml ) Need Help??


in reply to Re: Completely removing a perl function.
in thread Completely removing a perl function.

Did you have a look at Safe.pm http://search.cpan.org/~rgarcia/Safe-2.11/Safe.pm ?
  • Comment on Re^2: Completely removing a perl function.

Replies are listed 'Best First'.
Re^3: Completely removing a perl function.
by Moron (Curate) on Jun 28, 2006 at 14:37 UTC
    I can't prove my theory that to every measure there exists a countermeasure - it would be an infite proof. But I am sure the same principles of non-100% security will apply to Safe - it is a matter of creative thinking. The first two ideas that come to mind (that a hacker might try to compromise Safe.pm):

    - download and modify the source and use a modified version of Safe.pm

    - change its code or access to it in a BEGIN block

    I am sure others can think up more.

    -M

    Free your mind

      There are lots of measures which don't allow countermeasures. If there weren't, any attempt to secure a system would be pointless. As the system gets more more complex, it becomes harder, but not impossible, to ensure that there are no countermeasures for any of the features that comprise the system, while still allowing legitimate access to people who need it. Removing a given feature outright is usually not that difficult.

      For example, removing the feature (shmget), plus all the general system interfaces, ( let's start by eliminating syscall(), system(), backquotes and XS bindings from the secure version of the language), and taking it out of the perl binary itself would be essentially unbreakable.

      If you can't make a system call, and the system call is the only interface to features protected by the O/S, then you can't tamper with those features, period.

      You can write all the code you want, but if you can't bypass the control mechanisms, you're out of luck.

      For example, there's no way to directly write to a specific memory address in Perl (without using XS). So, if a hack relies on tampering with perl source code to access a specific memory address, it will always fail. That's an example of a language specific feature that's not circumventable.

        For example, there's no way to directly write to a specific memory address in Perl (without using XS).
        I think you mean to say that there's no supported way to write to a specific memory address in Perl. There are many unsupported methods to do so.
        I already pointed out that C would be used at some point in this escalating battle for control of a Perl implementation. And if C were controlled, the hacker has assembler and then raw machine code waiting in the line-up - there is no answer to that.

        -M

        Free your mind

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://558026]
help
Chatterbox?
[ambrus]: Corion: well Prima::Object says something like that the cleanup method will send an onDestory message and that you can't get more messages after cleanup, or something.
[Corion]: ambrus: Yeah - I don't think the deep source dive will be necessary if things are implemented as simple as they could be :)) And hopefully I won't need (more) timely object destruction. I can update the screen at 60Hz and hopefully even do HTTP ...
[Corion]: ... transfers in the background. Now that I think about it, this maybe even means that I can run the OpenGL filters on Youtube input :)
[ambrus]: Corion: I mentioned that the unix event loop of Prima always wakes up at least once every 0.2 seconds. Have you found out whether the win32 event loop of Prima does that too?
[Corion]: ambrus: Hmm - I would assume that the onDestroy message is sent from the destructor and doesn't go through the messageloop, but maybe it is sent when a window gets destroyed but all components are still alive...
[ambrus]: Corion: partly deep source dive, partly just conservative coding even if it adds an overhead.
[Corion]: ambrus: Hmm - no, I haven't looked at wakeup intervals ... I wonder why it should want to wakeup periodically because it gets a lot of messages from the Windows message loop (on Windows obviously)
[ambrus]: (Alternately a deep source dive and then rewrite that event loop to make it better, and then as a bonus you get an idle method.)
[ambrus]: The 0.2 seconds wakeup is likely a workaround for some bug, but I can't guess what bug that is.
[ambrus]: It's been there since Prima 1.00 iirc

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2016-12-09 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.