Identifying robots - asp.net

We are having an issue where robots are hitting our site and maxing out CPU usage. It's an ASP.NET Web Forms based site, we need to be able to identify these automatically and capture the IP addresses and write them to an event log, we can't put it in a database because of speed issues. Is this possible? Has anyone ever accomplished something like this? I have manually done this before but it's not possible with all the traffic we see to do this anymore.
Thanks!

Related

Server disables page after several GET requests from SIM908

I set up a free domain on 000webhost.com
I am using this as a web server to receive data from SIM908+arduino setup and store it in the database. Then display it on a web page.
I am sending the data from the SIM908 using HTTP GET requests. Basically I am sending two pieces of information, one is the location (lat and long) and other is a string. Both are sent using GET requests. The problem is very unusual so bear with me. EVERYTHING WORKS FINE, for a while. After several GET requests are sent, for some reason, 000webhost just deactivates my domain. I simply cannot access it. Every time I try to browse to the page it times out. It remains like this for around 7-8 hours after which the domain works fine again. I tried another hosting byethost.com, but GET requests from the SIM908 do not work there at all. Everything is 100% OK. The code, arduino setup everything is fine. My question is why is 000webhost stopping my domain? Really need a good answer or at least some direction, i am completely lost.
**NOTE: Please don't suggest POST method unless you explicitly know how to perform a POST operation using SIM908 AT commands, as far as I know it's not possible.
You are using the free webhost which has limitations. They will block you if your site is getting too much requests. Just read the limitations of free accounts with the server.
Look for a better free service or buy one. There is no issue with sim900 or arduino.
The following hosting service providers might be better than the one you are currently using in terms of limitations
Host Buddy You would get two months free
Free Hostia
Free Hosting .eu

Is it possible to save computer id upon website sign up?

I am looking for a solution to stop multiple sign ups on an upcoming websites of mine, but I am looking for different alternatives besides IP saving and tracing that.
So I was thinking about computer ID saving on the server. Is that possible?
No, that's not possible simply because this information is never sent on the network. The only information you could reliably get from a user visiting your website is his IP address in addition to the standard HTTP headers which might or not contain information about the UserAgent he is using, the language he configured in his browser, ...

Where can I see who is currently logged in to Plone?

Is there a way to see who is currently logged in to a Plone site?
Rationale: I want to make sure not to interfer with users working on content when I restart the instance.
Out-of-the-box, there is no way to see if users are currently using your site, only if they have just been using it. Just tail the instance-Z2.log access logfile.
Note that due to the nature of the HTTP protocol, 'current' users of your site do not maintain a connection, and thus, until they are back again for the next request, there is no accurate way to determine if anyone is using the site.
There are work-arounds, such as using sessions and timeouts, that use recency to estimate how many users are still around. collective.portlet.usertrack is one such approach. Note that such approaches can have a hefty scalability penalty though.
If all you want to do is not inconvenience users during a restart, use a caching frontend and / or a load balancer and more than one instance instead. That way users see cached content or content generated by an instance still up while you restart your first instance.
you can try collective.portlet.usertrack

Check if anyone is currently using an ASP.Net app (site)

I build ASP.NET websites (hosted under IIS 6 usually, often with SQL Server backends and forms authentication).
Clients sometimes ask if I can check whether there are people currently browsing (and/or whether there are users currently logged in to) their website at a given moment, usually so the can safely do a deployment (they want a hotfix, for example).
I know the web is basically stateless so I can't be sure whether someone has closed the browser window, but I imagine there'd be some count of not-yet-timed-out sessions or something, and surely logged-in-users...
Is there a standard and/or easy way to check this?
Jakob's answer is correct but does rely on installing and configuring the Membership features.
A crude but simple way of tracking users online would be to store a counter in the Application object. This counter could be incremented/decremented upon their sessions starting and ending. There's an example of this on the MSDN website:
Session-State Events (MSDN Library)
Because the default Session Timeout is 20 minutes the accuracy of this method isn't guaranteed (but then that applies to any web application due to the stateless and disconnected nature of HTTP).
I know this is a pretty old question, but I figured I'd chime in. Why not use Google Analytics and view their real time dashboard? It will require minor code modifications (i.e. a single script import) and will do everything you're looking for...
You may be looking for the Membership.GetNumberOfUsersOnline method, although I'm not sure how reliable it is.
Sessions, suggested by other users, are a basic way of doing things, but are not too reliable. They can also work well in some circumstances, but not in others.
For example, if users are downloading large files or watching videos or listening to the podcasts, they may stay on the same page for hours (unless the requests to the binary data are tracked by ASP.NET too), but are still using your website.
Thus, my suggestion is to use the server logs to detect if the website is currently used by many people. It gives you the ability to:
See what sort of requests are done. It's quite easy to detect humans and crawlers, and with some experience, it's also possible to see if the human is currently doing something critical (such as writing a comment on a website, editing a document, or typing her credit card number and ordering something) or not (such as browsing).
See who is doing those requests. For example, if Google is crawling your website, it is a very bad idea to go offline, unless the search rating doesn't matter for you. On the other hand, if a bot is trying for two hours to crack your website by doing requests to different pages, you can go offline for sure.
Note: if a website has some critical areas (for example, writing this long answer, I would be angry if Stack Overflow goes offline in a few seconds just before I submit my answer), you can also send regular AJAX requests to the server while the user stays on the page. Of course, you must be careful when implementing such feature, and take in account that it will increase the bandwidth used, and will not work if the user has JavaScript disabled).
You can run command netstat and see how many active connection exist to your website ports.
Default port for http is *:80.
Default port for https is *:443.

Monitoring load on ASP.NET Application

I am looking for ways to keep track of simultaneous users within an application. I cannot use IIS logs due to a load balancer that abstracts the users IP address. I am looking for a .NET code based solution or a configuration item, possibly with health monitoring to be able to track the "true" simultaneous user count.
I know that I can monitor the number of sessions, but that isn't really an ideal method to show, as it can be bloated based on the number of sessions with users abandoning their session.
There is a similiar question here: Tools and methods for live-monitoring ASP.NET web applications?
I found an advanced logging tool for debugging and monitoring .NET applications: SmartInspect. But I don't know if it meets your requirements.
What do you mean of "simultaneous users"? Perhaps you should monitor simultaneous TCP connections to your IIS application? Windows Performance Monitor tools should help you there.
Otherwise there is no sure way of telling how many users are using your application right now. If you can monitor number of sessions, then I'd suggest going with that. Just take into account the last modification time of the sessions, so you could get something like "active sessions in the last minute". That should give you a close measurment.
In the end we decided to use ASP.NET Performance counters, as well as generic information from the IIS Logs.
I parsed the information from both sources using the Microsoft Log Parser tool!
You just want to know the number of active users at a particular time? An easy option that omits inactive users as well as most bots would be to register the user as active through a JavaScript AJAX call on page load along with their SessionID. You can then purge old records from the log as you see fit. *Be careful of how you build your table's performance for read/write optimizations. ... just an idea off the top of my head.
We are using an expensive solution which is AVICode but it is great. You can monitor so many thing with that.

Resources