An interesting turn of events today… Sometime ago, I had an idea, an interesting idea. As many of us php developers know, PHP is a rich language that comes with many built in functions and options to gain functionality through third party libraries, etc. Two of the more used of these libraries are MySQL and libCURL. It is curl I plan to talk about today.
Not too long ago, the School district installed a filtering mechanism provided by 8e6 technologies, through rinet, as is my understanding. This filtering device is clearly not what it is made out to be. While a good filter might sniff both incoming and outgoing packets, this filter only checks outgoing requests against a human-maintained blacklist (and keyword filter). Understandably, there is a lot of overhead involved in good filtering, but for those who are truly concerned, .3 seconds shouldn’t make that much difference. Because the filter blocks mainly by domain and the ip addresses they resolve to, one merely needs to bounce the blocked content off of an unblocked server I.e: divinelunacy.com is not blocked (yet), therefore, a simple php script can be used to take the content from addictinggames.com, rewrite the urls contained therein ( to bounce them ) and send it back to the user. In essence, it takes three lines of php to bypass the filtering mechanisms on a per-file basis.
$handle = curl_init();
curl_setopt( $handle, CURLOPT_URL, $this->url );
curl_exec($handle);
Of course, that isn’t very good… Regular expressions are easily used to rewrite all urls contained within a page (including stylesheet urls). All of that barely uses a measurable fraction of libCurl’s abilities. I also used the user option agent and set it to my user agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2. And yeah, there was more beyond that. The actual bypassing mechanism and all of the mechanisms contained therein comes out to 229 lines of php with excessive commenting. I have written it from scratch about 3 times. It is now all object oriented PHP :). A similar, opensource program is available at ibypass.org, in case anyone wants to know… ( I’ll post mine to my digital portfolio as soon as I finish coding the wordpress plugin… )
Well, anyway, apparently the school doesn’t like being undermined like that. We had a nice long talk 5th period today about lots of things.
There has been a lot going on with Tom/Corey lately ( we’re not even friends… ) and the fools ( “or abridging the freedom of speech, or of the press;” ) seem to think that I have something to do with it. I cannot enough emphasize the idiocy incurred by these assumptions. It seems these days that one cannot know even a simple server side scripting language without being a hacker. Now as if the hacker assumption isn’t enough, it is apparently odd that I am working alone. Yes, you heard that right. Apparently, if you know how to program, you must have lots of friends, you must be part of a group… Hey, I’m writing a php tutorial if anyone wants to be immediately blessed with infinite friends and prestige amongst hackers… Wait… I’m only a script kitty, how can that work? Ever feel like you were somehow caught in the middle of something big? Well, If I know anything, I’ll be sure to tell the police. Wait!!! Need I say it more blatantly? I am not a hacker. Oh wait, our illustrious net admin can’t tell the difference… Honestly, Rambacher , what were you thinking running a web server on windows? (feel free to provide an answer.) Are you aware of the numbers? Clearly you don’t realize that the line of best fit for the IIS market share from February 2002 to present has a negative slope… Now, just looking at the graphs, Apache seems to have the absolute value of that slope during the same time period. About 48.83% MORE servers run on Apache than on “Microsoft” (IIS). I won’t even get started on the steady decline in IE use compared to the Steady incline in Firefox. Just about any browser is better and more w3c compliant than IE, not to mention the security gains. I guess security and performance don’t matter these days. In case you are wondering, this wasn’t posted from school… ( obviously… )
So. For those of you whom I haven’t told, I am working on writing a digital portfolio plugin for wordrpess. Why? I don’t know why I am making it a wordpress plugin. ( the only reason I have been able to come up with is the backend… ) I am making it to house my the vast depths of /home/mario/, which contains many assorted things. Including a Fibonacci number generator written in C++ ( well, I did a php version too ). Who wouldn’t want to peruse that? ( Ok, I wouldn’t… )
Well, for those of you who read all the way down to here, I suppose I should tell the end of my interesting anecdote. I’ve lost my computer privledges. It is apparently worse to write the software than to use it. Afterall, they didn’t even ask me for names of those with access. ( and I actually didn’t use it… ). Were they to ask, I wouldn’t tell. They have the names they want, they have a martyr and as for the other names, they know I didn’t use SSL on the form. ( though urls were base64 encoded ). A post on the combinatorics POW tomorrow, methinks.