Added Ruby on Rails, made env detection more robust in FF driver

main
ElbertF 12 years ago
parent ae8c3d321f
commit 2624d331eb

@ -106,6 +106,8 @@
headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } }, headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } },
'Apache JSPWiki': { 'Apache JSPWiki': {
cats: [ 8 ], cats: [ 8 ],
url: /wiki\.jsp/,
script: /jspwiki/,
html: /<html[^>]* xmlns:jspwiki=/i html: /<html[^>]* xmlns:jspwiki=/i
}, },
'Apache Tomcat': { 'Apache Tomcat': {
@ -902,7 +904,8 @@
}, },
'Mixpanel': { 'Mixpanel': {
cats: [ 10 ], cats: [ 10 ],
script: /api\.mixpanel\.com\/track/ script: /api\.mixpanel\.com\/track/,
env: /^Mixpanel/
}, },
'MochiKit': { 'MochiKit': {
cats: [ 12 ], cats: [ 12 ],
@ -1232,8 +1235,14 @@
}, },
'Ruby': { 'Ruby': {
cats: [ 27 ], cats: [ 27 ],
headers: { 'Server': /(Mongrel|WEBrick|Ruby|mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i }, headers: { 'Server': /(Mongrel|WEBrick|Ruby)/i }
meta: { 'csrf-param': /authenticity_token /i } },
'Ruby on Rails': {
cats: [ 18 ],
script: /\/assets\/application\-[a-z0-9]{32}\/\.js/,
meta: { 'csrf-param': /authenticity_token/ },
headers: { 'Server': /(mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i },
implies: [ 'Ruby' ]
}, },
'S.Builder': { 'S.Builder': {
cats: [ 1 ], cats: [ 1 ],

@ -141,7 +141,7 @@ var wappalyzer = wappalyzer || (function() {
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) { if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); content = match.toString().match(/content=("|')([^"']+)("|')/i);
if ( content && w.apps[app].meta[meta].test(content[2]) ) { if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
apps.push(app); apps.push(app);
break; break;

@ -106,6 +106,8 @@
headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } }, headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } },
'Apache JSPWiki': { 'Apache JSPWiki': {
cats: [ 8 ], cats: [ 8 ],
url: /wiki\.jsp/,
script: /jspwiki/,
html: /<html[^>]* xmlns:jspwiki=/i html: /<html[^>]* xmlns:jspwiki=/i
}, },
'Apache Tomcat': { 'Apache Tomcat': {
@ -902,7 +904,8 @@
}, },
'Mixpanel': { 'Mixpanel': {
cats: [ 10 ], cats: [ 10 ],
script: /api\.mixpanel\.com\/track/ script: /api\.mixpanel\.com\/track/,
env: /^Mixpanel/
}, },
'MochiKit': { 'MochiKit': {
cats: [ 12 ], cats: [ 12 ],
@ -1232,8 +1235,14 @@
}, },
'Ruby': { 'Ruby': {
cats: [ 27 ], cats: [ 27 ],
headers: { 'Server': /(Mongrel|WEBrick|Ruby|mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i }, headers: { 'Server': /(Mongrel|WEBrick|Ruby)/i }
meta: { 'csrf-param': /authenticity_token /i } },
'Ruby on Rails': {
cats: [ 18 ],
script: /\/assets\/application\-[a-z0-9]{32}\/\.js/,
meta: { 'csrf-param': /authenticity_token/ },
headers: { 'Server': /(mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i },
implies: [ 'Ruby' ]
}, },
'S.Builder': { 'S.Builder': {
cats: [ 1 ], cats: [ 1 ],

@ -141,7 +141,7 @@ var wappalyzer = wappalyzer || (function() {
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) { if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); content = match.toString().match(/content=("|')([^"']+)("|')/i);
if ( content && w.apps[app].meta[meta].test(content[2]) ) { if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
apps.push(app); apps.push(app);
break; break;

@ -106,6 +106,8 @@
headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } }, headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } },
'Apache JSPWiki': { 'Apache JSPWiki': {
cats: [ 8 ], cats: [ 8 ],
url: /wiki\.jsp/,
script: /jspwiki/,
html: /<html[^>]* xmlns:jspwiki=/i html: /<html[^>]* xmlns:jspwiki=/i
}, },
'Apache Tomcat': { 'Apache Tomcat': {
@ -902,7 +904,8 @@
}, },
'Mixpanel': { 'Mixpanel': {
cats: [ 10 ], cats: [ 10 ],
script: /api\.mixpanel\.com\/track/ script: /api\.mixpanel\.com\/track/,
env: /^Mixpanel/
}, },
'MochiKit': { 'MochiKit': {
cats: [ 12 ], cats: [ 12 ],
@ -1232,8 +1235,14 @@
}, },
'Ruby': { 'Ruby': {
cats: [ 27 ], cats: [ 27 ],
headers: { 'Server': /(Mongrel|WEBrick|Ruby|mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i }, headers: { 'Server': /(Mongrel|WEBrick|Ruby)/i }
meta: { 'csrf-param': /authenticity_token /i } },
'Ruby on Rails': {
cats: [ 18 ],
script: /\/assets\/application\-[a-z0-9]{32}\/\.js/,
meta: { 'csrf-param': /authenticity_token/ },
headers: { 'Server': /(mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i },
implies: [ 'Ruby' ]
}, },
'S.Builder': { 'S.Builder': {
cats: [ 1 ], cats: [ 1 ],

@ -1,11 +1,21 @@
"use strict"; "use strict";
(function() { (function() {
addEventListener('DOMContentLoaded', onLoad, false); addEventListener('DOMContentLoaded', function() {
removeEventListener('DOMContentLoaded', onLoad, false);
onLoad();
}, false);
function onLoad() { function onLoad() {
if ( content.document.contentType != 'text/html' ) { return }; if ( content.document.contentType != 'text/html' ) { return };
content.document.documentElement.addEventListener('load', function() {
sendAsyncMessage('wappalyzer', { env: Object.keys(content.wrappedJSObject) });
removeEventListener('load', onLoad, false);
}, true);
// HTML // HTML
var html = content.document.documentElement.outerHTML; var html = content.document.documentElement.outerHTML;
@ -24,7 +34,5 @@
env: Object.keys(content.wrappedJSObject), env: Object.keys(content.wrappedJSObject),
url: content.location.href url: content.location.href
}); });
removeEventListener('DOMContentLoaded', onLoad, false);
} }
})(); })();

@ -141,7 +141,7 @@ var wappalyzer = wappalyzer || (function() {
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) { if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); content = match.toString().match(/content=("|')([^"']+)("|')/i);
if ( content && w.apps[app].meta[meta].test(content[2]) ) { if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
apps.push(app); apps.push(app);
break; break;

@ -106,6 +106,8 @@
headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } }, headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } },
'Apache JSPWiki': { 'Apache JSPWiki': {
cats: [ 8 ], cats: [ 8 ],
url: /wiki\.jsp/,
script: /jspwiki/,
html: /<html[^>]* xmlns:jspwiki=/i html: /<html[^>]* xmlns:jspwiki=/i
}, },
'Apache Tomcat': { 'Apache Tomcat': {
@ -902,7 +904,8 @@
}, },
'Mixpanel': { 'Mixpanel': {
cats: [ 10 ], cats: [ 10 ],
script: /api\.mixpanel\.com\/track/ script: /api\.mixpanel\.com\/track/,
env: /^Mixpanel/
}, },
'MochiKit': { 'MochiKit': {
cats: [ 12 ], cats: [ 12 ],
@ -1232,8 +1235,14 @@
}, },
'Ruby': { 'Ruby': {
cats: [ 27 ], cats: [ 27 ],
headers: { 'Server': /(Mongrel|WEBrick|Ruby|mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i }, headers: { 'Server': /(Mongrel|WEBrick|Ruby)/i }
meta: { 'csrf-param': /authenticity_token /i } },
'Ruby on Rails': {
cats: [ 18 ],
script: /\/assets\/application\-[a-z0-9]{32}\/\.js/,
meta: { 'csrf-param': /authenticity_token/ },
headers: { 'Server': /(mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i },
implies: [ 'Ruby' ]
}, },
'S.Builder': { 'S.Builder': {
cats: [ 1 ], cats: [ 1 ],

@ -141,7 +141,7 @@ var wappalyzer = wappalyzer || (function() {
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) { if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); content = match.toString().match(/content=("|')([^"']+)("|')/i);
if ( content && w.apps[app].meta[meta].test(content[2]) ) { if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
apps.push(app); apps.push(app);
break; break;

@ -106,6 +106,8 @@
headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } }, headers: { 'Server': /(Apache($|[^-])|HTTPD)/i } },
'Apache JSPWiki': { 'Apache JSPWiki': {
cats: [ 8 ], cats: [ 8 ],
url: /wiki\.jsp/,
script: /jspwiki/,
html: /<html[^>]* xmlns:jspwiki=/i html: /<html[^>]* xmlns:jspwiki=/i
}, },
'Apache Tomcat': { 'Apache Tomcat': {
@ -902,7 +904,8 @@
}, },
'Mixpanel': { 'Mixpanel': {
cats: [ 10 ], cats: [ 10 ],
script: /api\.mixpanel\.com\/track/ script: /api\.mixpanel\.com\/track/,
env: /^Mixpanel/
}, },
'MochiKit': { 'MochiKit': {
cats: [ 12 ], cats: [ 12 ],
@ -1232,8 +1235,14 @@
}, },
'Ruby': { 'Ruby': {
cats: [ 27 ], cats: [ 27 ],
headers: { 'Server': /(Mongrel|WEBrick|Ruby|mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i }, headers: { 'Server': /(Mongrel|WEBrick|Ruby)/i }
meta: { 'csrf-param': /authenticity_token /i } },
'Ruby on Rails': {
cats: [ 18 ],
script: /\/assets\/application\-[a-z0-9]{32}\/\.js/,
meta: { 'csrf-param': /authenticity_token/ },
headers: { 'Server': /(mod_rails|mod_rack|Phusion.Passenger)/i, 'X-Powered-By': /(mod_rails|mod_rack|Phusion.Passenger)/i },
implies: [ 'Ruby' ]
}, },
'S.Builder': { 'S.Builder': {
cats: [ 1 ], cats: [ 1 ],

@ -141,7 +141,7 @@ var wappalyzer = wappalyzer || (function() {
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) { if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); content = match.toString().match(/content=("|')([^"']+)("|')/i);
if ( content && w.apps[app].meta[meta].test(content[2]) ) { if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
apps.push(app); apps.push(app);
break; break;