Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand cms scan #330

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions libs/core-scanner/src/scans/cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const getHtmlMatches = async (response: HTTPResponse) => {
if (Array.isArray(obj.html)) {
return (
obj.html.filter((html) => {
if (actualHtml.match(new RegExp(html))) {
if (actualHtml.match(new RegExp(html, 'i'))) {
return obj;
}
}).length > 0
);
} else {
if (actualHtml.match(new RegExp(obj.html))) {
if (actualHtml.match(new RegExp(obj.html, 'i'))) {
return obj;
}
}
Expand All @@ -56,9 +56,9 @@ const getHeaderMatches = async (response: HTTPResponse) => {
return obj.headers.some((header) => {
const formattedKey = header.key.toLowerCase();
if (Object.keys(formattedActualHeaders).includes(formattedKey)) {
const actualValue = formattedActualHeaders[formattedKey];
const formattedValue = formattedActualHeaders[formattedKey];
if (
actualValue.match(new RegExp(header.value)) ||
formattedValue.match(new RegExp(header.value, 'i')) ||
header.value === ''
) {
return header;
Expand All @@ -73,9 +73,17 @@ const cmsData = [
{
cms: 'Adobe Experience Manager',
html: [
'<div class="[^"]*parbase',
'class="[^"]*parbase',
'<div[^>]+data-component-path="[^"+]jcr:',
'<div class="[^"]*aem-Grid',
'class="[^"]*aem-Grid',
'href="[^"]*clientlib[^"]*"',
'class="[^"]*cmp-name[^"]*"',
'data-wcm-mode',
],
headers: [
{ key: 'Dispatcher', value: '' },
{ key: 'CQ-Action', value: '' },
{ key: 'CQ-Handle', value: '' },
],
},
{
Expand All @@ -102,7 +110,12 @@ const cmsData = [
},
{
cms: 'DNN',
html: ['<!-- by DotNetNuke Corporation', '<!-- DNN Platform'],
html: [
'<!-- by DotNetNuke Corporation',
'<!-- DNN Platform',
'<meta[^>]*content="[^"]*DotNetNuke[^"]*"[^>]*>',
'class="[^"]*DnnModule[^"]*"',
],
headers: [
{ key: 'Cookie', value: 'dnn_IsMobile=' },
{ key: 'DNNOutputCache', value: '' },
Expand Down Expand Up @@ -154,6 +167,7 @@ const cmsData = [
html: [
'(?:<div[^>]+id="wrapper_r"|<(?:link|script)[^>]+(?:feed|components)/com_|<table[^>]+class="pill)\\;confidence:50',
'<meta +[^>]*content=["\'][^"\']*Joomla[^"\']*["\'][^>]*>',
'<meta[^>]*name="Generator"[^>]*content="[^"]*Joomla[^"]*"[^>]*>',
],
headers: [
{ key: 'X-Content-Encoded-By', value: 'Joomla! ([\\d.]+)\\;version:\\1' },
Expand Down Expand Up @@ -205,6 +219,9 @@ const cmsData = [
{ cms: 'Methode', html: '<!-- Methode uuid: "[a-f\\d]+" ?-->' },
{
cms: 'Microsoft Sharepoint',
html: [
'<meta[^>]*name="Generator"[^>]*content="[^"]*sharepoint[^"]*"[^>]*>',
],
headers: [
{ key: 'MicrosoftSharePointTeamServices', value: '^(.+)$\\;version:\\1' },
{ key: 'SPRequestGuid', value: '' },
Expand Down
Loading