IP address not enough to identify online pirates

In a stunning display of common sense, a judge has ruled that IP address alone is not enough to identify the person responsible for an illegal download.

.. and …

Of course, those of you reading this with even the most basic understanding of how IP addresses and wireless networks work already knew all of this. What makes Brown’s conclusion remarkable — sadly — is that someone in power actually used facts and common sense in the matter, rather than simply siding with the copyright holder, carte blanche.

Finally!

Read the article here.

~Talant

I’m a n00b

Yeah, clikker will rejoice in reading that statement comming from me. But I really feel like one right now. For years, I’ve been programming in PHP, and when creating webpages with user validating, I’ve usually saved the userID in a session variable in order to have other pages validate that a user is logged in or not. I know this is a very standard way of doing it.

However I’ve just recently become aware that the way I validate users as being logged in, is flawed. Usually I do so something like this:

if !(isset($_SESSION['id']) && is_numeric($_SESSION['id']) && $_SESSION['id'] > 0) header("location: index.php")

So, if the $_SESSION['id'] isn’t set, isn’t a numeric value, or isn’t greater than 0 (all which should be true, if the user is logged in) then we return a redirect header to the browser, forcing it to go to index.php instead.

Good, right? Wrong!

In all the time, I’ve been doing this, I’ve always tested this and the rest of my webpages in many different browsers. All redirected as desired. But, what I didn’t realize was that PHP doesn’t stop running the script after it hits the header() function, and continues to compile the page and send it to the browser.

I’ve made a CMS system for a local BMX club. The admin.php (the control panel) contains links to itself with GET values that defines what the admin wants to do. For example, to delete a menu item, there would be a link like this: <a href="admin.php?action=deleteMenu&menuId=1">delete</a>. Of course the admin.php checks to see if the user is logged in, and if the user is the admin user before it does anything else. And if the admin isn’t logged in? header("location: index.php")! And all seemed to be fine.

Then the administrator from the BMX club called me and told me that all the pages and menus had been deleted, that only he, another and myself knew the password, and that it seemed like either we had been hacked, or that the database had been reset somehow. I confirmed that the pages and menus had been deleted, but everything else seemed intact. I received the appache access log files from the webhost, and started going through them. In the files I saw that a webcrawler had managed to get access to admin.php and started to, as webcrawlers do, follow every link. So of course it followed all the delete links, and thus a damn webcrawler managed to delete all the CMS pages and menus.

But how did it get access to admin.php without logging in as admin? My first theory was that this particular webcrawler used a browser plugin to crawl the pages a user were visiting, using the visitors session. However I wanted to do a simple test first. SSH’ing into my linux box, I first tried to do curl -I http://bmxclub/admin.php. It resulted in HTTP/1.1 302 Moved Temporarily which seemed about right. For some reason I tried without the -I option, and saw all the raw HTML, and at first glance that too seemed fine. It showed me the header, the menu, the table to subscribe for newsletters, the loginbox, the footer… but then I saw that the content were actually the control panel, with the links to add, move, and delete menus and pages…

So that’s how I learned to NOT trust browsers only when testing PHP code and redirecting with header values. And looking at it afterwards, it’s kind of logical that it all behaved as it does. I should have known that I should always place a PHP die(); call whenever I don’t want to execute any more of the PHP script. Not just redirect a visiting browser once it gets the HTML headers. I’m a n00b.

~Talant

Join Astalavista.com

And this is just a small part of what Astalavista.com can offer you.

Astalavista is a 15 year old community of computer users, novices as experts, researchers, corporate administrators and basement hackers, and everyone in between.

Astalavista.com is a true underground site. By “underground” I don’t mean a place where illegal individuals exchange thoughts, tools etc. This is the only place, independent of products and companies, where people, even guys that I know, still submit tools and papers for the idea of doing it – not for the financial gains. I’m alive at Astalavista, for me it is like I got slash-dotted with knowledge, just because sooner or later everyone visits the site, and it’s the best place for all kinds of audiences. Although there’re a lot of tools at the site, it’s knowledge, not tool- oriented.

~Talant

dist-upgrading BackTrack 5 R1 to R2

Hallo All
I came across this guide on  that show you command for command how to dist-upgrade BackTrack to the newest version (BackTrack 5r2).

I know that its a simple process but I know atleast one person that would like to follow a guide on this, so it deserves a post :)

You can find the guide HERE

~Res85

A Better Way To Program (and live?)

Bret Vistor gives a speech at CUSEC 2012 (The Canadian University Software Engineering Conference) about.. well a way of living. As the author of this article I found wrote: This video will change the way you think about programming. But maybe also how you perceive life and its values.

It’s a rather long talk, about an hour, but worth the time! For the best part of the time, he shows some really amazing things, and summarizes it up with a more generic examples from other peoples lives and stories.

I have, on purpose, not written too much about what this guy actually IS talking about, because I think the message has to be taken in with as open a mind as possible, without any prior expectation of what this is about, so it will have the best impact on you. Hopefully.

Enjoy!

~Talant

Analyzing WordPress Themes

MaXe has written this short paper on analysing WordPress themes.

It can be found at exploit-db.com, or here

What I found very interesting (amongst other interesting things) was this little snippet:

Even though the developer, implemented this as some sort of “copyright protection”, and even stated it is “prohibited” to reverse engineer the file, it doesn’t legally apply in countries like Denmark, where you can buy a product and take it apart, as long as you’re not endangering anyone including yourself.

~Talant