Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Interesting Idea


reaper4334's Avatar
Member
0 0

Well I was sat thinking the other day (no that's not all)… and I thought, what if I could make my computer "pretend" that it's running a web server. Like make a program that listens for a connection on a certain port, then when connected… sends whatever a browser would normally receive from a web server.

Could this be done? If so, how could this be done?

or… Is this just some crazy idea :]

Hope that all made sense

Thanks, Reaper


ghost's Avatar
0 0

Sure, no reason why not. As far as how to do it, you seem to have a pretty good idea of what to do already, based on the explanation of your idea. Just put that into C or perl or something and you're gold.


reaper4334's Avatar
Member
0 0

I know how I'd send the data (I think) but… I don't know what data I'd need to send.

Basically, how does a browser work? What does it request from the server?

If I knew a little more of this kind of stuff, I think I might be able to make something work with Perl or Python.

Thanks, Reaper

P.S: If anyone would like to work on something like this with me, I'd appreciate the help and such.


ghost's Avatar
0 0

read up on GET HTTP/1.1. google should tell you all you need to know :)

[edit] the get command is what the client sends, youll have to read up on server responses.[/edit]


reaper4334's Avatar
Member
0 0

Thanks for all the responses so far, they've all helped (I think).

I've looked around a little.. and I think I understand a little bit… I could do with like a more specific description or something though. Anyone have any ideas?

Thanks, Reaper


ghost's Avatar
0 0

You should look into headers. when you browser connects to a web server, it will ask it using HTTP (the language used for communicating web sites) something like this

GET / HTTP/1.1
Host: yoursite.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.x 200 OK
Date: Sun, 16 Sep 2007 23:48:16 GMT
Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7d SE/0.5.1
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
X-Powered-By: PHP/4.4.0
Set-Cookie: PHPSESSID=[removed]; path=/
Content-Encoding: gzip
Content-Length: 1017
Connection: close
Content-Type: text/html

so that is the type of information you have to work with, and will need to reply to.

you will get a seperate header request for each .css, image, .html, whatever that is requested.

boot up telnet and play around with

>telnet google.com 80
GET / HTTP/1.1
Host: http://google.com

hit enter twice and you will have just requested the HTML of google.com

(btw you wont see what you are typing, it is being sent to the server.)

so using telnet you can see all of the requests and responses.

hope that helped

i would love to help you with this but im swamped with school shit right now.


reaper4334's Avatar
Member
0 0

Thanks guys, I'm looking into it using some of the Perl modules (HTTP::Response is the main on I'm looking at).

Also, am I missing something? Or would this be an obviously simply way to host a server on Windows? If someone made something like this, and released it open source, or just made it downloadable and customizable… then someone could just run it on a box that they leave running.

Reaper

[Edit] Okay, I think I understand mainly what information I need to be sending and such. Now I just don't know how. I'm using the Perl HTTP::* modules. If anyone would like to help me, please do :). [/Edit]


spyware's Avatar
Banned
0 0

I say go packet-style. Sniff a HTTP request and 'copy' the packets. This way you can pretend you are something else then what you are.


ghost's Avatar
0 0

what he said, always more fun when you pretend to be something your not. lol


ghost's Avatar
0 0

-Scanning machine-

If your program could tell the difference in everyones hand writing, it would be good for scanning passwords that you cant read.

other than that the only other thing i could think of would be image verification like they already said. Good idea though.


reaper4334's Avatar
Member
0 0

omnipresence wrote: -Scanning machine-

If your program could tell the difference in everyones hand writing, it would be good for scanning passwords that you cant read.

other than that the only other thing i could think of would be image verification like they already said. Good idea though.

I'm guessing that was the wrong thread? Or is it just me?

Reaper


ghost's Avatar
0 0

reaper4334 wrote: what if I could make my computer "pretend" that it's running a web server.

you arnt really "pretending" anymore. you are coding your own web server.

sounds like an awesome idea. i think i might have to do the same when i get enough time. i was thinking of going the visual c++ route, but perl will work probably better (i am just very familiar with visual c++)

anyways sounds awesome. we could definitely release some open source customizable "hbh web server" or something. that would be fun.

i think i am going to make mine just text based tho. images and stuff add a whole new level of complexity. i think. ill have to look into it. ciao, and good luck

DigitalFire