TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-09-2009, 09:09 PM   #1 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default Directory listing from remote location.

So i'm looking for a way to retrieve a directory listing from a remote location.

Is my best way to grab the contents and regexp through what i need, or am I way off? alternative ways, curl? (my knowledge of curl is 0.000001% so i don't know :))

Thanks
hjalmar is offline  
Reply With Quote
Old 06-09-2009, 09:13 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,381
Thanks: 5
Salathe is on a distinguished road
Default

Is the directory listing publicly available? Would FTP be an option? A "directory listing" is pretty vague, where is the listing and in what form is it?
Salathe is offline  
Reply With Quote
Old 06-09-2009, 09:17 PM   #3 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Is the directory listing publicly available? Would FTP be an option? A "directory listing" is pretty vague, where is the listing and in what form is it?
Yes it would have to be pubicly available. No, ftp would not be an option. Simple directory on another server.

Sorry could have been a bit clearer in my post.



*edit, please delete my error post below, :/
hjalmar is offline  
Reply With Quote
Old 06-09-2009, 09:24 PM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,381
Thanks: 5
Salathe is on a distinguished road
Default

Can you give an example directory listing? Will there only be one listing that you are wanting to grab, or many? Sorry for all of the questions and what might seem unimportant details, but they will affect what methods you can use to do the work.
Salathe is offline  
Reply With Quote
Old 06-09-2009, 09:32 PM   #5 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,298
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by hjalmar View Post
So i'm looking for a way to retrieve a directory listing from a remote location.

Is my best way to grab the contents and regexp through what i need, or am I way off? alternative ways, curl? (my knowledge of curl is 0.000001% so i don't know :))

Thanks
So what you are looking to do is grab the directory listing from a server which you have no affiliation with. So if you were to go to www.xyz.com you could simply list all the files in it. If that is what you are trying to do, it is impossible unless the server you are getting it from specifically outputs it.
__________________

Village Idiot is offline  
Reply With Quote
Old 06-09-2009, 09:33 PM   #6 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Can you give an example directory listing? Will there only be one listing that you are wanting to grab, or many? Sorry for all of the questions and what might seem unimportant details, but they will affect what methods you can use to do the work.
Just one, well accessing a directory with any browser will give you a html output with what files it contains. no? :)

So as simple as it sounds i'm only looking to extract filenames of whats contained in a directory located on another server. Running the script on the remote server is also out of the question.

I understand all the question. hopefully you are satisfied now :)
hjalmar is offline  
Reply With Quote
Old 06-09-2009, 09:35 PM   #7 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,298
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by hjalmar View Post
Just one, well accessing a directory with any browser will give you a html output with what files it contains. no? :)
No. The server upon getting a directory request will output an HTML file with the contents of the folder in it should no default page exist. That is if the server is configured to give directory listings. We don't allow directory browsing at my work for security reasons.
__________________

Village Idiot is offline  
Reply With Quote
Old 06-09-2009, 09:47 PM   #8 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
No. The server upon getting a directory request will output an HTML file with the contents of the folder in it should no default page exist. That is if the server is configured to give directory listings. We don't allow directory browsing at my work for security reasons.
I totally understand that, the point here isn't to go around stealing files from all over. So the server will have to generate a html output by default, the user will be aware of that.

So i'll go back to my initial post, best way to go about it?

Thanks
hjalmar is offline  
Reply With Quote
Old 06-09-2009, 09:48 PM   #9 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,381
Thanks: 5
Salathe is on a distinguished road
Default

The directory listing itself will vary depending on the software and configuration used for that particular site (or individual directory!). If you are only wanting this done for one site/directory then we need to know that URL; otherwise we can only give you generic advice about using the DOM extension to parse a HTML document.
Salathe is offline  
Reply With Quote
Old 06-09-2009, 09:55 PM   #10 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
The directory listing itself will vary depending on the software and configuration used for that particular site (or individual directory!). If you are only wanting this done for one site/directory then we need to know that URL; otherwise we can only give you generic advice about using the DOM extension to parse a HTML document.
Only advice i need.

Thanks guys
hjalmar is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing level of a directory differently... Peuplarchie General 0 05-24-2009 07:59 AM
[How To] Allow / Disallow Directory Browsing dynaweb Tips & Tricks 6 04-14-2009 12:57 PM
Fix recursive function on a directory listing Peuplarchie General 1 04-13-2009 03:04 AM
Creating directory hierarchies with ease Wildhoney Script Giveaway 3 12-04-2008 01:28 AM
Remote FTP to Remote FTP Haris The Lounge 4 01-25-2008 05:26 PM


All times are GMT. The time now is 10:00 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design