开发者

How to Finding out the about the browser/client connections to a web server hosting some website?

I would like to understand the programmatic way of finding out(logging) IP address & physical MAC address of computers/devices from which web browsers would connect to a webserver (hosting some site) to access the site.

e.g.

Consider a web site which has many users posting threads in some for开发者_开发技巧um on that website, throughout the day/for many days.

How can the server hosting the sebsite find out the IP addresses passed which are accessing the server for - Reading the posts, Writing/Editing the posts.

If it is found that a particular webbrowser/client from a certain IP address is doing a malicious operation on the server(violating the robots rules, or anything else which the webserver does not like), can the server in some way programatically block that IP adress from accessing the server/website content?

Question 1] Is it possible to get it done something like above? Does it have any particular name/terminology?

Question 2] If yes, What kind of code would help do that? I meam what all are the aspects the code doing this functionality need to have(TCP-IP sockets, robots analysers, etc.. [I might be totally off here, just putting what i could think of, but would like to hear more])

Question 3] Would it be possible to do it in C, PERL or it would need some Javascript, PHP,.. kind of code to get it done.

P.S. Sorry for multiple questions in one post, but I am asking this solely from programming perspective to understand something I do not know, and I do not fully realize whether web-servers already do this, or if it has any privacy-breach angle to this. So would like to avoid this subjective/argumentative aspect and know only technical solutions.

Thank You.

-AD


First of all, forget MAC address. There is no way. MAC address is only visible while in LAN, so...

  1. Yes, it is possible. There are several languages and platforms for web applications, or you can write your own webserver on your own. It could be too complicated to explain here "how to do it" without a reference to the platform (PHP? ASP.NET?)
  2. Ok let's take an example. If you are using PHP, you can get your client's IP with $SERVER["REMOTE_ADDR"]. Once you get this value, do whatever computation you want. By "whatever" you may mean "robot analysis", for example try to see in the database if that IP posted a topic less than 30 seconds ago. If so, refuse posting. You can always have a list of banned IPs and so on..
  3. If you write your webserver on your own (crazy!!!!) C is viable. But I suggest you PHP or better ASP.NET.

An important aspects: web server don't perform such tasks. This is done by web applications, a software layer that stands above the application server which is just over the web server.

You might need to study some theory, pal ;-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜