Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
maintenance(jest): Updated snapshots to fit the updated format of jes…
…t v29.3.1

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
  • Loading branch information
Ilyesbdlala committed Feb 7, 2023
commit afe6f42107cae6b44ad518fe60a033059fd8c4bc
364 changes: 182 additions & 182 deletions scanners/amass/parser/__snapshots__/parser.test.js.snap

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions scanners/amass/parser/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ test("example parser parses single line json successfully", async () => {
await expect(validateParser(findings)).resolves.toBeUndefined();

expect(findings).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
"addresses": Array [
Object {
"asn": 34011,
"cidr": "10.110.224.0/21",
"desc": "GD-EMEA-DC-CGN1",
"ip": "10.110.225.135",
},
],
"domain": "example.de",
"name": "www.example.de",
"source": undefined,
"tag": "cert",
},
"category": "Subdomain",
"description": "Found subdomain www.example.de",
"location": "www.example.de",
[
{
"attributes": {
"addresses": [
{
"asn": 34011,
"cidr": "10.110.224.0/21",
"desc": "GD-EMEA-DC-CGN1",
"ip": "10.110.225.135",
},
],
"domain": "example.de",
"name": "www.example.de",
"osi_layer": "NETWORK",
"severity": "INFORMATIONAL",
"source": undefined,
"tag": "cert",
},
]
`);
"category": "Subdomain",
"description": "Found subdomain www.example.de",
"location": "www.example.de",
"name": "www.example.de",
"osi_layer": "NETWORK",
"severity": "INFORMATIONAL",
},
]
`);
});

test("example parser parses large json result successfully", async () => {
Expand Down
60 changes: 30 additions & 30 deletions scanners/angularjs-csti-scanner/parser/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test("should properly parse acstis empty finding log file", async () => {
);
const findings = await parse(fileContent);
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot("Array []");
expect(findings).toMatchInlineSnapshot(`[]`);
});

test("should properly parse acstis finding log file", async () => {
Expand All @@ -35,33 +35,33 @@ test("should properly parse acstis finding log file", async () => {
const findings = await parse(fileContent);
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
"injectedTemplate": "{{a=toString().constructor.prototype;a.charAt=a.trim;$eval('a,alert(1),a')}}",
"method": "POST",
"parameter": "string",
"url": "https://www.google.com/test/",
},
"category": "Template Injection",
"description": "The given in this finding URL is vulnerable to AngularJS template injection which can lead to XSS",
"name": "AngularJS template injection",
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
Object {
"attributes": Object {
"injectedTemplate": "{{alert('test')}}",
"method": "GET",
"parameter": "category",
"url": "http://localhost:5000/home?category={{alert('test')}}",
},
"category": "Template Injection",
"description": "The given in this finding URL is vulnerable to AngularJS template injection which can lead to XSS",
"name": "AngularJS template injection",
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
]
`);
[
{
"attributes": {
"injectedTemplate": "{{a=toString().constructor.prototype;a.charAt=a.trim;$eval('a,alert(1),a')}}",
"method": "POST",
"parameter": "string",
"url": "https://www.google.com/test/",
},
"category": "Template Injection",
"description": "The given in this finding URL is vulnerable to AngularJS template injection which can lead to XSS",
"name": "AngularJS template injection",
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
{
"attributes": {
"injectedTemplate": "{{alert('test')}}",
"method": "GET",
"parameter": "category",
"url": "http://localhost:5000/home?category={{alert('test')}}",
},
"category": "Template Injection",
"description": "The given in this finding URL is vulnerable to AngularJS template injection which can lead to XSS",
"name": "AngularJS template injection",
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
]
`);
});
26 changes: 13 additions & 13 deletions scanners/cmseek/parser/__snapshots__/parser.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`parser parses result of Joomla scan with core vulnerabilities successfully 1`] = `
Array [
Object {
"attributes": Object {
[
{
"attributes": {
"joomla_version": "3.6.5",
"references": Array [
"references": [
"CVE : CVE-2016-10033",
"https://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection",
"https://github.com/opsxcq/exploit-CVE-2016-10033",
Expand All @@ -19,10 +19,10 @@ Array [
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
Object {
"attributes": Object {
{
"attributes": {
"joomla_version": "3.6.5",
"references": Array [
"references": [
"CVE : CVE-2016-10045",
"https://www.rapid7.com/db/modules/exploit/multi/http/phpmailer_arg_injection",
"EDB : https://www.exploit-db.com/exploits/40969/",
Expand All @@ -35,9 +35,9 @@ Array [
"osi_layer": "APPLICATION",
"severity": "HIGH",
},
Object {
"attributes": Object {
"joomla_backup_files": Array [
{
"attributes": {
"joomla_backup_files": [
"http://172.26.0.3/1.save",
"http://172.26.0.3/1.tar.gz",
"http://172.26.0.3/1.rar",
Expand All @@ -57,7 +57,7 @@ Array [
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
},
Object {
{
"category": "Security Misconfiguration",
"description": "Debug mode is enabled on the site",
"location": "http://172.26.0.3/",
Expand All @@ -68,6 +68,6 @@ Array [
]
`;

exports[`parser parses result of Joomla scan without core vulnerabilities successfully 1`] = `Array []`;
exports[`parser parses result of Joomla scan without core vulnerabilities successfully 1`] = `[]`;

exports[`parser parses result of non-Joomla scan successfully 1`] = `Array []`;
exports[`parser parses result of non-Joomla scan successfully 1`] = `[]`;
2 changes: 1 addition & 1 deletion scanners/cmseek/parser/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ test("should properly parse empty cmseek json file", async () => {
);
const findings = await parse(jsonContent);
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});
50 changes: 25 additions & 25 deletions scanners/ffuf/parser/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ test("should properly parse ffuf json file", async () => {
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
[
{
"attributes": {
"contentType": "text/html; charset=UTF-8",
"duration": 14335592,
"headers": Object {},
"headers": {},
"hostname": "www.securecodebox.io",
"httpStatus": 301,
"input": Object {
"input": {
"FUZZ": "blog",
},
"length": 7253,
Expand All @@ -48,14 +48,14 @@ Array [
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
},
Object {
"attributes": Object {
{
"attributes": {
"contentType": "text/html; charset=UTF-8",
"duration": 17386127,
"headers": Object {},
"headers": {},
"hostname": "www.securecodebox.io",
"httpStatus": 200,
"input": Object {
"input": {
"FUZZ": "404",
},
"length": 9152,
Expand Down Expand Up @@ -88,15 +88,15 @@ test("should properly parse ffuf json file wih multiple fuzz keyword inputs", as
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
[
{
"attributes": {
"contentType": "text/html; charset=UTF-8",
"duration": 501741303,
"headers": Object {},
"headers": {},
"hostname": "www.securecodebox.io",
"httpStatus": 301,
"input": Object {
"input": {
"FUZZ1": "docs",
"FUZZ2": "architecture",
},
Expand Down Expand Up @@ -127,23 +127,23 @@ test("should properly parse ffuf json file with postdata", async () => {
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`
Array [
Object {
"attributes": Object {
[
{
"attributes": {
"contentType": "application/json; charset=utf-8",
"duration": 248886400,
"headers": Object {
"headers": {
"Content-Type": "application/json",
},
"hostname": "localhost:3000",
"httpStatus": 200,
"input": Object {
"input": {
"PASSWORD": "password",
"USERNAME": "user@example.com",
},
"length": 855,
"lines": 1,
"postdata": "{\\"email\\":\\"USERNAME\\",\\"password\\":\\"PASSWORD\\"}",
"postdata": "{"email":"USERNAME","password":"PASSWORD"}",
"redirectlocation": "",
"words": 1,
},
Expand All @@ -167,7 +167,7 @@ test("should properly parse empty json file", async () => {
const findings = await parse(fileContent);
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});

test("should properly parse zero findings json file", async () => {
Expand All @@ -179,26 +179,26 @@ test("should properly parse zero findings json file", async () => {
const findings = await parse(fileContent);
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});

test("should properly parse empty string", async () => {
const findings = await parse("");
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});

test("should properly parse null", async () => {
const findings = await parse(null);
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});

test("should properly parse undefined", async () => {
const findings = await parse(undefined);
// validate findings
await expect(validateParser(findings)).resolves.toBeUndefined();
expect(findings).toMatchInlineSnapshot(`Array []`);
expect(findings).toMatchInlineSnapshot(`[]`);
});
Loading