Is it possible to exploit the banner information provided in the response header to get sensitive information about the server?
A typical response looks like below
**HTTP/1.1 200 OK
Date: Tue, 19 Apr 2011 09:23:32 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Set-Cookie: tracking=tI8rk7joMx44S2Uu85nSWc
X-AspNet-Version: 2.0.50727
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 1067
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”><html xmlns=“http://
www.w3.org/1999/xhtml” ><head><title>Your details</title>
…**
I am trying to know wether "Server: Microsoft-IIS/6.0" can be used to exploit the vulnerability present in the server or to get some sensitive information about the server.
Thanks
All kinds of information can potentially be useful to a potential attacker. Your example could be one small part of a larger reconnaissance effort.
As Jedi mentioned, the info you've provided can give a clue about potential weaknesses in the web server itself. Another thing to keep in mind though, is what the server tells you about the company's choice of architecture in general; if they are using a web server from Microsoft, chances are they will be using a database system from them too (and possibly mail servers and other stuff too).
There`s no guarantee of this of course, but it may provide a starting point for further investigation which may in turn reveal other weaknesses, such as SQL injection vulnerabilities (which are probably the most prevalent class of vulnerabilities in websites and web applications today).
Related
My desired behavior is to have cloudfront cache my origin(api endpoint that returns json).
It seems like no matter what values I put in the header for max-age at my origin or what "ttl" values I put in my cloudfront distribution, hitting the distribution point caches for 24 hours in cloudfront when using curl with a php backend. When hitting the endpoint through Chrome it is cached every 5 seconds like desired.(I think chrome is sending no-cache in the request header)
Does anyone have a recommendation on how to force cloudfront to cache fresh data every 5 seconds on my site especially when using curl?
I am effectively hitting a rest api point that is sending json back that needs to be dynamically cached in cloudfront every five seconds. The cache needs to be refreshed after 5 seconds so fresh data is served even if the data is the same. The origin is dynamic content that changes every hour on the hour and is not static.
Is it impossible to get passed the 24 hour caching limit?
I Tried different Cache-Control headers like max-age and s-maxage
I Tried changing the ttl times in my cloudfront distrubtuion
I have set Object caching to Customize and:
Min TTL is 0
Max TTL is 5
Default TTL is 5
My origin headers are:
HTTP/1.1 200 OK
Date: Thu, 09 May 2019 14:15:17 GMT
Server: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 mpm-itk/2.4.7-04
Last-Modified: Thu, 09 May 2019 14:12:57 GMT
ETag: "e1ab8bae1d38bfceecece2c36df378c1-gzip"
X-Robots-Tag: noindex, follow
Link: <https://www.example.com/json/>; rel="https://api.w.org/"
Cache-Control: max-age=5
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 789
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json
Maybe it sounds a novice question in Varnish Cache world, but why in WordPress it seems that is a need to install a external cache plugin, to working fully cached?
Websites are correctly loaded via Varnish, a curl -I command:
HTTP/1.1 200 OK
Server: nginx/1.11.12
Date: Thu, 11 Oct 2018 09:39:07 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: max-age=0, public
Expires: Thu, 11 Oct 2018 09:39:07 GMT
Vary: Accept-Encoding
X-Varnish: 19575855
Age: 0
Via: 1.1 varnish-v4
X-Cache: MISS
Accept-Ranges: bytes
Pragma: public
Cache-Control: public
Vary: Accept-Encoding
With this configuration, by default WordPress installations are not being cached.
After test multiple cache plugins -some not working, or not working without complex configuration- i found the Swift Performance, in their Lite version, simply activating the Cache option, here really takes all advantages and here i can see varnish is working fully with very good results in stress test.
This could be ok for a single site on a single environment, but in shared hosting terms, when every customer can have their own WP (or other CMS) installation could be a problem.
So the key is there are no way to take full caching advantage from Varnish without installing 3rd party caching (and complex) plugins? Why not caching all by default?
Any kind of suggestions and help will be high welcome, thanks in advance.
With this configuration, by default WordPress installations are not being cached
By default, if you don't change anything in neither Wordpress or Varnish configuration, things would work together in a way that Wordpress pages are cached for 120 seconds. So real caching is possible, but it will be a short lived cache and highly ineffective one.
Your specific headers indicate that no caching should happen. They are either sent by Varnish itself (we're all guilty of copy pasting stuff without thinking what it does), or a Wordpress plugin (more often bad ones, than good). Without knowing your specific configuration, it's hard to decipher anything.
Varnish is a transparent HTTP caching proxy. Which means it’s just going to, by default, use HTTP headers, which are sent by backend (Wordpress), like Cache-Control, to make a decision on whether resource can be cached and for how long.
Wordpress, in fact, does not send cache related headers other than in a few specific areas (error pages, login POST submission, etc).
The standard approach outlined here is configuring Varnish with the highest TTL. With that:
Varnish has no idea when you update an article contents, or change theme. Typical solution to this lies in using cache invalidation plugin like Varnish HTTP Purge.
A plugin requirement comes from necessity to purge cache, when content is changed.
Suppose that you update a Wordpress page's text. You had that same page previously visited and it went into Varnish cache for storage. What happens upon the next visit, is that Varnish will serve the same, now stale content to all the next visitors.
The Wordpress plugins for Varnish, like Varnish HTTP Purge, will hook into Wordpress in a way that they will instruct Varnish to clear cache when pages are updated. This is their primary purpose.
That kind of approach (high TTL and cache purging) is de-facto standard with Varnish. As Varnish has no information about when you update content, the inner workings of purging cache is with the application itself. The cache purging feature is either bundled into CMS code itself (Magento 2, for example has it out of the box, without any extra plugins), or a Wordpress plugin.
I have .htaccess set up to expire js and css files after 7 days. ETag is turned off, and gzip / Deflate is turned on.
In my source HTML there are 25 different calls to load JS files. Not my design. Here is an example of one of those calls:
<script type="text/javascript" src="content/vendors/jquery/rater/jquery.rater-custom.js"></script>
The response header from inspection via Firebug:
HTTP/1.1 200 OK
Date: Sun, 20 Jan 2013 23:35:42 GMT
Server: Apache
Last-Modified: Sun, 20 Jan 2013 22:49:10 GMT
Accept-Ranges: bytes
Cache-Control: max-age=604800
Expires: Sun, 27 Jan 2013 23:35:42 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 648
Keep-Alive: timeout=1, max=95
Connection: Keep-Alive
Content-Type: application/x-javascript
There are also a ton of CSS references. The page is extremely slow and I am trying to get caching to work, to speed it up. On IE 9 and Chrome after the first load, this page will render almost instantly...I can tell all these files are being pulled from the cache in those browsers.
On FireFox I cannot get the browser to use the cached copies. Any idea what I am missing or what could be going on that is forcing FireFox to request fresh copies of these files every single time the page is reloaded?
Have you checked your Firefox configuration? Sometimes people deactivate caching for development reasons, for example via the Developers Toolbar...
I'm not too sure how Firefox handles automatic caching of files it is served but if your goal is to improve performance by caching files then maybe implementing ApplicationCache might be a viable solution.
Application Cache
http://www.html5rocks.com/en/tutorials/appcache/beginner/
http://www.sitepoint.com/offline-browsing-in-html5-with-applicationcache/
http://www.whatwg.org/specs/web-apps/current-work/#applicationcache
I'm really confused by all that caching stuff. I'm trying to setup mod_expires to reduce the number of HTTP Requests from my website to the server.
I did well so far, I installed mod_expires and wrote a little .conf file from the instructions on http://httpd.apache.org/docs/2.0/mod/mod_expires.html.
Now, for instance, all my .png, .gif, .jpeg files have a Cache-Control header. My expected result was, that the browser won't do any GET Request within the time period (given from the Cache-Control value). But it does, every single file fires a request and receives HTTP 304 not Modified.
That is the wrong behavior isn't it ? It should load that files from the internal cache.
One thing I don't understand is, that the browser sends a Response header: Cache-Control: max-age=0. Should it be like that?
Here is an complete example Request + Response headers for a single .png file:
Request
Host dev-mgg.localdomain
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer http://dev-mgg.localdomain/css/global/icons.css?18224
Cookie IR_SQLPwdStore=; IR_SQLUser=sysadm
If-Modified-Since Thu, 24 Jul 2008 06:24:11 GMT
If-None-Match "4010127-3c4-452bf1aefd8c0"
Cache-Control max-age=0
Response
Date Mon, 02 Aug 2010 14:00:28 GMT
Server Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0
Connection Keep-Alive
Keep-Alive timeout=15, max=59
Etag "4010127-3c4-452bf1aefd8c0"
Expires Mon, 02 Aug 2010 14:04:28 GMT
Cache-Control max-age=240
It looks like the Expires header being sent back by the server is only 4 minutes in the future. The algorithm by which web browsers decide whether or not to actually make a request (based on Expires values) uses the "closeness" of the current time to the expiration date - so unless the expiration date is still a long time away (weeks, months, years), you can be pretty sure that the browser will make a request for the file.
I'm having trouble with a particular version of Pocket IE running under Windows Mobile 5.0. Unfortunately, I'm not sure of the exact version numbers.
We had a problem whereby this particular 'installation' would return a locally cached version of a page when the wireless network was switched off. Fair enough, no problem. We cleared the cache of the handheld and started sending the following headers:
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Last-Modified: Thu, 30 Jul 2009 16:42:08 GMT
The Last-Modified header is calculated on the fly and set to 'now'.
Even still, the handheld seems to be caching these pages: the page is sent with the headers but then when they disconnect the wireless network and click a link to the page (that was not supposed to be cached) it still returns this cached file.
Is there some other header/s that should be sent, or is this just a problem with Pocket IE? Or is it possibly something entirely different?
Thanks!
I'm not sure I can answer your question since I have no Pocket IE to test with, but maybe I can offer something that can help.
This is a very good caching reference: http://www.mnot.net/cache_docs/
Also, I'm not sure whether your example is the pasted results of your headers, or the code that you've set up to send the headers, but I believe the collection of headers in most language implementations (and by extension I assume most browser implementations) is treated as a map; therefore, it's possible you've overwritten "no-store, no-cache, must-revalidate" with the second "Cache-Control" header. In other words, only one can get sent, and if last wins, you only sent "post-check=0, pre-check=0".
You could also try adding the max-age=0 header.
In my experience both Firefox and IE have seemed more sensitive to pages served by HTTPS as well. You could try that if you have it as an option.
If you still have no luck, and Pocket IE is behaving clearly differently from Windows IE, then my guess is that the handheld has special rules for caching based on the assumption that it will often be away from internet connectivity.
Edit:
After you mentioned CNN.com, and I realized that you do not have the "private" header in Cache-Control. I think this is what is making CNN.com cache the page but not yours. I believe "private" is the most strict setting available in the "Cache-Control header. Try adding that.
For example, here are CNN's headers. (I don't think listing "private" twice has any effect)
Date: Fri, 31 Jul 2009 16:05:42 GMT
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=60, private, private
Expires: Fri, 31 Jul 2009 16:06:41 GMT
Content-Type: text/html
Vary: User-Agent,Accept-Encoding
Content-Encoding: gzip
Content-Length: 21221
200 OK
If you don't have the Firefox Web Developer Toolbar, it's a great tool to check Response Headers of any site - in the "Information" dropdown, "View Reponse Headers" is at the bottom.
Although Renesis has been awesome in trying to help me here, I've had to give up.
By 'give up' I mean I've cheated. Instead of trying to resolve this issue on the client side, I went the server side route.
What I ended up doing was writing a function in PHP that will take a URL and essentially make it unique. It does this by adding a random GET parameter based on a call to uniqid(). I then do a couple of other little things to it: make sure I add a '?' or a '&' to the URL based on the existence of other GET parameters and make sure that any '#' anchor items are pushed right to the end and then I return that URL to the browser.
This essentially resolves the issue as each link the browser ever sees is unique: it's never seen that particular URL before and so can't retrieve it from the cache.
Hackish? Yes. Working? So far, so good.