Skip to content

Commit

Permalink
Cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
andresriancho committed Jan 26, 2015
1 parent 755f06d commit ea8c342
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions w3af/plugins/infrastructure/php_eggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,16 +849,18 @@ def http_get(fuzzable_request, (egg_url, egg_desc)):

def _are_php_eggs(self, query_results):
"""
Now I analyze if this is really a PHP eggs thing, or simply a response that
changes a lot on each request. Before, I had something like this:
Now I analyze if this is really a PHP eggs thing, or simply a response
that changes a lot on each request. Before, I had something like this:
if relative_distance(original_response.get_body(), response.get_body()) < 0.1:
if relative_distance(original_response.get_body(),
response.get_body()) < 0.1:
But I got some reports about false positives with this approach, so now I'm
changing it to something a little bit more specific.
But I got some reports about false positives with this approach, so now
I'm changing it to something a little bit more specific.
"""
images = 0
not_images = 0

for query_result in query_results:
if 'image' in query_result.http_response.content_type:
images += 1
Expand All @@ -867,15 +869,17 @@ def _are_php_eggs(self, query_results):

if images == 3 and not_images == 1:
#
# The remote web server has expose_php = On. Report all the findings.
# The remote web server has expose_php = On. Report all the
# findings.
#
for query_result in query_results:
desc = 'The PHP framework running on the remote server has a'\
' "%s" easter egg, access to the PHP egg is possible'\
' through the URL: "%s".'
desc = desc % (query_result.egg_desc, query_result.egg_URL)

i = Info('PHP Egg', desc, query_result.http_response.id, self.get_name())
i = Info('PHP Egg', desc, query_result.http_response.id,
self.get_name())
i.set_url(query_result.egg_URL)

kb.kb.append(self, 'eggs', i)
Expand Down

0 comments on commit ea8c342

Please sign in to comment.