diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..75714b9a8 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,60 @@ +GEM + remote: http://rubygems.org/ + specs: + addressable (2.2.7) + ansi (1.4.2) + daemons (1.1.8) + data_objects (0.10.8) + addressable (~> 2.1) + dm-core (1.2.0) + addressable (~> 2.2.6) + dm-do-adapter (1.2.0) + data_objects (~> 0.10.6) + dm-core (~> 1.2.0) + dm-migrations (1.2.0) + dm-core (~> 1.2.0) + dm-sqlite-adapter (1.2.0) + dm-do-adapter (~> 1.2.0) + do_sqlite3 (~> 0.10.6) + do_sqlite3 (0.10.8) + data_objects (= 0.10.8) + erubis (2.7.0) + eventmachine (0.12.10) + json (1.6.6) + librex (0.0.65) + msfrpc-client (1.0.1) + librex (>= 0.0.32) + msgpack (>= 0.4.5) + msgpack (0.4.6) + parseconfig (0.5.2) + rack (1.4.1) + rack-protection (1.2.0) + rack + sinatra (1.3.2) + rack (~> 1.3, >= 1.3.6) + rack-protection (~> 1.2) + tilt (~> 1.3, >= 1.3.3) + term-ansicolor (1.0.7) + thin (1.3.1) + daemons (>= 1.0.9) + eventmachine (>= 0.12.6) + rack (>= 1.0.0) + tilt (1.3.3) + +PLATFORMS + ruby + +DEPENDENCIES + ansi + data_objects + dm-core + dm-migrations + dm-sqlite-adapter + erubis + eventmachine (= 0.12.10) + json + msfrpc-client + parseconfig + sinatra (= 1.3.2) + term-ansicolor + thin diff --git a/modules/browser/ajax_fingerprint/command.js b/modules/browser/ajax_fingerprint/command.js new file mode 100644 index 000000000..cedc734ea --- /dev/null +++ b/modules/browser/ajax_fingerprint/command.js @@ -0,0 +1,93 @@ +// +// Copyright 2012 Wade Alcorn wade@bindshell.net +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +beef.execute(function() { + + //Regular expression to match script names in source + var regex = new RegExp('/\\w*\.(min\.)?js'); + var results = []; + var urls = ""; + + Array.prototype.unique = function() { + var o = {}, i, l = this.length, r = []; + for(i=0; i0){ + urls=results.unique().join('||'); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "script_urls="+urls); + } + else{ + beef.net.send("<%= @command_url %>", <%= @command_id %>, "script_urls="+urls); + } + } + catch(e){ + results = "Fingerprint failed: "+e.message; + beef.net.send("<%= @command_url %>", <%= @command_id %>, "script_urls="+results.toString()); + } + } + fp(); +}); diff --git a/modules/browser/ajax_fingerprint/config.yaml b/modules/browser/ajax_fingerprint/config.yaml new file mode 100644 index 000000000..36c0dc0d2 --- /dev/null +++ b/modules/browser/ajax_fingerprint/config.yaml @@ -0,0 +1,28 @@ +# +# Copyright 2012 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +beef: + module: + ajax_fingerprint: + enable: true + category: "Browser" + name: "Fingerprint Ajax" + description: "Fingerprint Ajax and JS libraries present" + authors: ["qswain"] + target: + working: ["FF","S"] + not_working: ["C"] + + diff --git a/modules/browser/ajax_fingerprint/module.rb b/modules/browser/ajax_fingerprint/module.rb new file mode 100644 index 000000000..60232d3a7 --- /dev/null +++ b/modules/browser/ajax_fingerprint/module.rb @@ -0,0 +1,28 @@ +# +# Copyright 2012 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +class Ajax_fingerprint < BeEF::Core::Command + + + def post_execute + puts 'Post' + content = {} + content['script_urls'] = @datastore['script_urls'] if not @datastore['script_urls'].nil? + if content.empty? + content['fail'] = 'Failed to fingerprint ajax.' + end + save content + end +end