|
 |
|
|
|
|
|
Access non-public content from Websites Using PHP.
 |
|
 |
| |
goin-god  |
|
High Roller

Group: $outh $ide Hoodz
Joined: Mar 18, 2007



|
I know it may sound weird, but it's not.
I've been having a quick look at PHP because I just wanted to make my own signature rotator. But once I finished that I started to think about the things I could do with php scripts that return images. For example, check my signature. It gets Today top poster data and makes fun of him.
I'm basicly using this function file_get_contents. Where I need the URL to get data from. But that was easy to do since the Forum Stats are public. But if I want to get data from my profile or any other Members only section of the Forum, I can't. Since the script won't be able to access that.
Is there any way I can do it?
BTW, I first used PHP today. Still geting the hand on the sintaxis and stuff.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
K^2  |
Posted: Tuesday, Apr 10 2012, 02:24
|
Vidi Vici Veni

Group: Zaibatsu
Joined: Apr 14, 2004



|
Basically, you need to understand a few things about how authentication works. There are several methods. The one used by forums relies on session ID tracking. When you open a log-in page, the browser sends you a cookie containing session ID. Go to cookie browser, and you'll quickly find it. When you send info to the page, it matches session ID with information it already has. Once you log in, it marks that session ID as having logged in, and you no longer need to authenticate yourself in any other way than via the ID.
This has number of vulnerabilities, but overall, it's a pretty solid system. If you want to write a script that retrieves information from a page you need to be logged in to, all you really need to do is set a cookie with session ID and then run the request. Edmachine's links should help you with that. If you want to have the script log in automatically, you'll need to make sure that your script receives cookies along with the data, and keeps track of the session ID while you POST the user name and password.
By the way, a lot of forums allow session ID to be passed as GET parameter. I'm not sure about this one. You can experiment with it by disabling cookies and seeing if it works for you. However, a secure forum script will not allow you to pass session ID via GET method if you logged in with cookies. This has to do with vulnerabilities mentioned earlier.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|