Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SamJoan committed Sep 7, 2017
1 parent 3bee67f commit 4be02fd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dscan/plugins/internal/base_plugin_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ def process_url(self, opts, functionality, enabled_functionality, hide_progressb

output = self.url_scan(url, opts, functionality, enabled_functionality,
hide_progressbar=hide_progressbar)

if opts['output'] == "json":
self._output_json_add_info(output, url)

if not common.shutdown:
self.out.result(output, functionality)
Expand Down Expand Up @@ -347,6 +350,10 @@ def process_url_iterable(self, iterable, opts, functionality, enabled_functional
timeout_host)
results = []

def _output_json_add_info(self, output, url):
output['host'] = url
output['cms_name'] = self._meta.label

def _process_results_multisite(self, results, functionality, timeout_host):
for result in results:
try:
Expand All @@ -356,8 +363,7 @@ def _process_results_multisite(self, results, functionality, timeout_host):

output = result['future'].result(timeout=timeout_host)

output['host'] = result['url']
output['cms_name'] = self._meta.label
self._output_json_add_info(output, result['url'])

if not common.shutdown:
self.out.result(output, functionality)
Expand Down
7 changes: 7 additions & 0 deletions dscan/plugins/joomla/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<version md5="ac24edb81b9ac1174951491d2a17dcbd" nb="3.8.0-beta1" />
<version md5="ac24edb81b9ac1174951491d2a17dcbd" nb="3.7.3" />
<version md5="ac24edb81b9ac1174951491d2a17dcbd" nb="3.8.0-beta2" />
<version md5="ac24edb81b9ac1174951491d2a17dcbd" nb="3.8.0-beta4" />
</file>
<file url="templates/system/css/offline.css">
<version md5="4469566750b42c8fcaeb9f7096cbc34f" nb="2.5.23" />
Expand Down Expand Up @@ -319,6 +320,7 @@
<version md5="1ec2db1e4683e4528de451aeb0bfb5f8" nb="3.8.0-beta1" />
<version md5="1ec2db1e4683e4528de451aeb0bfb5f8" nb="3.7.3" />
<version md5="1ec2db1e4683e4528de451aeb0bfb5f8" nb="3.8.0-beta2" />
<version md5="1ec2db1e4683e4528de451aeb0bfb5f8" nb="3.8.0-beta4" />
</file>
<file url="media/system/css/calendar-jos.css">
<version md5="7a3a4a26af4f603445c62c7ca80d1476" nb="2.5.23" />
Expand Down Expand Up @@ -482,6 +484,7 @@
<version md5="30b13c7d3757af92568b9a9ff71d6fdc" nb="3.8.0-beta1" />
<version md5="30b13c7d3757af92568b9a9ff71d6fdc" nb="3.7.3" />
<version md5="30b13c7d3757af92568b9a9ff71d6fdc" nb="3.8.0-beta2" />
<version md5="30b13c7d3757af92568b9a9ff71d6fdc" nb="3.8.0-beta4" />
</file>
<file url="templates/system/css/general.css">
<version md5="6ce52781de5ab36383064948b55333d6" nb="2.5.23" />
Expand Down Expand Up @@ -639,6 +642,7 @@
<version md5="447751e75b8bfef74d6eeadba2d1d763" nb="3.8.0-beta1" />
<version md5="447751e75b8bfef74d6eeadba2d1d763" nb="3.7.3" />
<version md5="447751e75b8bfef74d6eeadba2d1d763" nb="3.8.0-beta2" />
<version md5="447751e75b8bfef74d6eeadba2d1d763" nb="3.8.0-beta4" />
</file>
<file url="templates/system/css/system.css">
<version md5="5eb2fce934fc4203857ce20333a2566c" nb="2.5.23" />
Expand Down Expand Up @@ -796,6 +800,7 @@
<version md5="1c9236d7b7b1a7c97c39414ac5b9ef1b" nb="3.8.0-beta1" />
<version md5="1c9236d7b7b1a7c97c39414ac5b9ef1b" nb="3.7.3" />
<version md5="1c9236d7b7b1a7c97c39414ac5b9ef1b" nb="3.8.0-beta2" />
<version md5="1c9236d7b7b1a7c97c39414ac5b9ef1b" nb="3.8.0-beta4" />
</file>
<file url="templates/system/css/error.css">
<version md5="4899cff7d385a59ac6c03183c85e5862" nb="2.5.23" />
Expand Down Expand Up @@ -953,6 +958,7 @@
<version md5="ff25c1acaa575b45a16d6fa23ed880fd" nb="3.8.0-beta1" />
<version md5="ff25c1acaa575b45a16d6fa23ed880fd" nb="3.7.3" />
<version md5="ff25c1acaa575b45a16d6fa23ed880fd" nb="3.8.0-beta2" />
<version md5="ff25c1acaa575b45a16d6fa23ed880fd" nb="3.8.0-beta4" />
</file>
<file url="media/system/js/tabs.js">
<version md5="b4b159ee1159d24e1f0577013a116a98" nb="2.5.23" />
Expand Down Expand Up @@ -1116,6 +1122,7 @@
<version md5="0706715e857007d0ea2a7f8daec600f3" nb="3.8.0-beta1" />
<version md5="0706715e857007d0ea2a7f8daec600f3" nb="3.7.3" />
<version md5="0706715e857007d0ea2a7f8daec600f3" nb="3.8.0-beta2" />
<version md5="0706715e857007d0ea2a7f8daec600f3" nb="3.8.0-beta4" />
</file>
</files>
</cms>
14 changes: 14 additions & 0 deletions dscan/tests/base_http_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,3 +903,17 @@ def test_read_timeout_warn(self, warn, _):

assert warn.called

def test_single_site_json_out_cms_fingerprint(self):
all_mocks = self.mock_all_enumerate('drupal')

self.add_argv(['-u', self.base_url, '--method', 'forbidden', '--out',
'json'])

with patch('dscan.common.output.JsonOutput.result') as r:
self.app.run()

args, kwargs = r.call_args_list[0]
results = args[0]

assert 'cms_name' in results
assert 'host' in results

0 comments on commit 4be02fd

Please sign in to comment.