Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit c404682

Browse files
committed
Fixed port issue with nikto
1 parent 35f77b4 commit c404682

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hooks/imperative-subsequent-scans/hook.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function handle({
4343
cascadeNmapNikto &&
4444
finding.attributes.service === "http"
4545
) {
46-
await startNiktoHttpScan({
46+
await startNiktoScan({
4747
parentScan: scan,
4848
hostname,
4949
port,
@@ -236,7 +236,7 @@ async function startSSHScan({ parentScan, hostname, port }) {
236236
* @param {string} hostname The hostname to start a new subsequent Nikto scan for.
237237
* @param {string} port The port to start a new subsequent Nikto scan for.
238238
*/
239-
async function startNiktoHttpScan({ parentScan, hostname, port }) {
239+
async function startNiktoScan({ parentScan, hostname, port }) {
240240

241241

242242
if(hostname && port) {
@@ -247,7 +247,7 @@ async function startNiktoHttpScan({ parentScan, hostname, port }) {
247247
parentScan,
248248
name: `nikto-${port}-${hostname.toLowerCase()}`,
249249
scanType: "nikto",
250-
parameters: ["-h", "http://" + hostname, "-p", port.toString(), "-Tuning", "1,2,3,5,7,b"],
250+
parameters: ["-h", hostname, "-p", port.toString(), "-Tuning", "1,2,3,5,7,b"],
251251
});
252252
}
253253
else

hooks/imperative-subsequent-scans/hook.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ test("Should create subsequent scans for open HTTP ports (NMAP findings)", async
140140

141141
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(5, {
142142
name: "nikto-80-foobar.com",
143-
parameters: ["-h", "http://foobar.com", "-p", "80", "-Tuning", "1,2,3,5,7,b"],
143+
parameters: ["-h", "foobar.com", "-p", "80", "-Tuning", "1,2,3,5,7,b"],
144144
parentScan: { metadata: { labels: { foo: "bar" } } },
145145
scanType: "nikto",
146146
});
147147
// even if the HTTP port is not running at port 80 a corresponding Nikto scan should be created if a HTTP service is found by nmap
148148
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(6, {
149149
name: "nikto-3000-example.com",
150-
parameters: ["-h", "http://example.com", "-p", "3000", "-Tuning", "1,2,3,5,7,b"],
150+
parameters: ["-h", "example.com", "-p", "3000", "-Tuning", "1,2,3,5,7,b"],
151151
parentScan: { metadata: { labels: { foo: "bar" } } },
152152
scanType: "nikto",
153153
});
@@ -665,7 +665,7 @@ test("Should create subsequent scans for Service which are running in custom por
665665
});
666666
expect(startSubsequentSecureCodeBoxScan).toHaveBeenNthCalledWith(14, {
667667
name: "nikto-8000-http.example.com",
668-
parameters: ["-h", "http://http.example.com", "-p", "8000", "-Tuning", "1,2,3,5,7,b"],
668+
parameters: ["-h", "http.example.com", "-p", "8000", "-Tuning", "1,2,3,5,7,b"],
669669
parentScan: { metadata: { labels: { foo: "bar" } } },
670670
scanType: "nikto",
671671
});

0 commit comments

Comments
 (0)