The ever-fabulous Need to Know brings us the story of an amazing hack in the current issue. It's called Subterfugue, and it:
lets you insert [...] code between the OS and an application, mangling and filtering any data along the way.
It works by letting you write "tricks", which are essentially wrappers that let you get in the communication channel between the application and kernel, via the system calls the app makes, and the signals raised by the kernel.
It lets you do things like:
- restrict the I/O rate of a process
- modify the arguments of a system call (or even the call itself)
- modify or ignore signals
- restrict filesystem access (à la chroot)
And of course, tricks can be written in a high-level language (i.e. not C).
Got you salivating yet? When I hear "code", "filtering" and "data" in the same sentence, I naturally think of Perl. Unfortunately, the only high-level language supported is Python. In fact, it's just a very clever Python hack.
So, if you have a spare week-end or two, why don't you write Subterfugue in Perl? That would be cool.
and it's subterfugue, not, as I orginally wrote, subterfuge. Thanks, vsarkiss.
print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.