Follow us on Twitter!
Don't judge the unknown - Grindordie
Friday, April 18, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 21
Members Online: 2

Registered Members: 82825
Newest Member: bulmers
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

URLencoding content

Mouzi
Member



Posts: 144
Location: Finland
Joined: 08.08.06
Rank:
Newbie
Posted on 29-12-07 12:52
I wrote a long message about what I'm using this for, what I've already tried and what I've thought of but that damned referer thing prevented me from posting it and I lost the whole text so here's the question just shortly:

Is there a way to dynamically urlencode the whole content of a page? With PHP or Apache or something.


izuom.net/sig.gif
Steganographs

Edited by Mouzi on 29-12-07 12:58
You would try to hack it anyways.
Author

RE: URLencoding content

mido
Member

Your avatar

Posts: 613
Location: Cairo, Egypt
Joined: 27.01.07
Rank:
Monster
Posted on 29-12-07 14:01
Try Javascript...?


www.hellboundhackers.org/sig/r/16019.png

mido_eg3[at]hotmail.com
Author

RE: URLencoding content

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 29-12-07 14:05
Try PHP.

Code
$file = "yourfile.txt";
$fh = fopen($ourFileName, 'X') or die("Couldn't open file");
$encfile = urlencode($fh);
fclose($fh);




Haven't tested this but it should work.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s

Edited by spyware on 29-12-07 14:10
http://bitsofspy.net
Author

RE: URLencoding content

Mouzi
Member



Posts: 144
Location: Finland
Joined: 08.08.06
Rank:
Newbie
Posted on 29-12-07 14:53
Javascript does not work for this one... Maybe I should explain more (as I did before my message got lost).

I have a navigation system that uses AJAX to retrieve pages. I have to urlencode the content that goes through XMLHttpRequest because it uses UTF-8 character encoding which messes everything up. I have tried to make it so that the requested page loads itself with file_get_contents(), urlencodes and echoes the result and then die(), but this breaks the POST and GET variables, so it's not very good solution (well I could pass the POST and GET variables to the page, but that would require making a request with fsockopen() and heaps of other code; I'm looking for a simpler solution if there is one). I've also thought about making custom echo function for PHP which would urlencode everything if needed, but then I would have to put all non PHP contet through echo also. Not that good one either.


izuom.net/sig.gif
Steganographs

Edited by Mouzi on 29-12-07 15:00
You would try to hack it anyways.
Author

RE: URLencoding content

Mouzi
Member



Posts: 144
Location: Finland
Joined: 08.08.06
Rank:
Newbie
Posted on 30-12-07 11:30
I realised that the fsockopen is not an option either. It would bypass all IP specific things as the requesting IP will be the IP of the server :S

Would it be possible to create some kind of filter for apache maybe that would urlencode content if there is a certain request header?

Or is there any way to do this with PHP?


izuom.net/sig.gif
Steganographs
You would try to hack it anyways.
Author

RE: URLencoding content

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 30-12-07 11:40
if your apache is set to read remote files, try this.

Code
<?php
$data = file_get_contents("http://www.yourwebsite.com/yourfile.php");
echo urlencode($data);
?>




although i think possibly your looking for htmlentities?


http://www.hellboundhackers.org/
Author

RE: URLencoding content

Mouzi
Member



Posts: 144
Location: Finland
Joined: 08.08.06
Rank:
Newbie
Posted on 30-12-07 11:44
Mouzi wrote:
I have tried to make it so that the requested page loads itself with file_get_contents(), urlencodes and echoes the result and then die(), but this breaks the POST and GET variables


I already have. I also tried fsockopen which can send the POST and GET to the requested page, but it has problems too. And no I'm not looking for html entities... just a way to urlencode the whole page.


izuom.net/sig.gif
Steganographs

Edited by Mouzi on 30-12-07 11:44
You would try to hack it anyways.
Author

RE: URLencoding content

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 30-12-07 11:47
file_get_contents can send GET, obvioulsy.

but if you want to send POST, then use cURL and then just echo the result in urlencode. that will work.


http://www.hellboundhackers.org/
Author

RE: URLencoding content

Mouzi
Member



Posts: 144
Location: Finland
Joined: 08.08.06
Rank:
Newbie
Posted on 30-12-07 11:53
I know it can :P Also I can't use cURL, only fsockopen (my server doesn't have cURL lib). And I have tried that one too.

Mouzi wrote:
I realised that the fsockopen is not an option either. It would bypass all IP specific things as the requesting IP will be the IP of the server :S



izuom.net/sig.gif
Steganographs

Edited by Mouzi on 30-12-07 11:56
You would try to hack it anyways.