discovery port,service testing

This commit is contained in:
insanity 2018-03-29 19:45:06 +09:00
parent 43d1f4ccc6
commit e557f7a608

View File

@ -19,7 +19,7 @@ import { Host } from 'packages/discovery/model/Host';
import * as ProbeDetailStore from 'packages/probe/store'; import * as ProbeDetailStore from 'packages/probe/store';
import { Probe } from 'packages/probe/model'; import { Probe } from 'packages/probe/model';
import { DetailSelector as ProbeDetailSelector} from 'packages/probe/store'; import { DetailSelector as ProbeDetailSelector } from 'packages/probe/store';
@Component({ @Component({
selector: 'of-setting', selector: 'of-setting',
@ -107,7 +107,7 @@ export class SettingComponent implements OnInit, AfterContentInit {
isZone(zone: Zone): boolean { isZone(zone: Zone): boolean {
for (let i = 0 ; i < this.treeNodes.length; ++i) { for (let i = 0; i < this.treeNodes.length; ++i) {
if (zone.iface === this.treeNodes[i].iface) { if (zone.iface === this.treeNodes[i].iface) {
return true; return true;
} }
@ -131,7 +131,7 @@ export class SettingComponent implements OnInit, AfterContentInit {
} }
const jZone: any = { const jZone: any = {
title: 'Zone - ' + value.iface, title: 'Zone - ' + value.iface,
className : 'cn' + value.ip className: 'cn' + value.ip
}; };
jZone.obj = value; jZone.obj = value;
jZone.children = this.convertViewHost(value.hosts); jZone.children = this.convertViewHost(value.hosts);
@ -193,13 +193,22 @@ export class SettingComponent implements OnInit, AfterContentInit {
discoveryHost: { discoveryHost: {
firstScanRange: this.startIP, firstScanRange: this.startIP,
lastScanRange: this.endIP, lastScanRange: this.endIP,
} discoveryPort: {
firstScanRange: this.startPort,
lastScanRange: this.endPort,
includeTCP: true,
includeUDP: true,
excludePorts: null,
discoveryService: {
includeServices: ['SSH', 'PostgreSQL', 'DNS', 'WMI', 'SMB'],
}
},
},
}; };
console.log('start discovery - ' + this.probe.probeKey); console.log('start discovery - ' + this.probe.probeKey);
this.discoverstore.dispatch(new DiscoverStore.DiscoverZone( this.discoverstore.dispatch(new DiscoverStore.DiscoverZone(
{probeID: this.probe.probeKey, discoveryZone: discoveryZone})); { probeID: this.probe.probeKey, discoveryZone: discoveryZone }));
this.started = true; this.started = true;
@ -240,7 +249,7 @@ export class SettingComponent implements OnInit, AfterContentInit {
}); });
if (hosts.length > 0) { if (hosts.length > 0) {
this.registStore.dispatch(new RegistStore.DiscoverySaveAllTarget({hosts: hosts, probe: {id: 1}})); this.registStore.dispatch(new RegistStore.DiscoverySaveAllTarget({ hosts: hosts, probe: { id: 1 } }));
} }
} }
@ -260,7 +269,7 @@ export class SettingComponent implements OnInit, AfterContentInit {
const jHost: any = { const jHost: any = {
title: 'Host - ' + host.ip, title: 'Host - ' + host.ip,
className : 'cn' + host.ip className: 'cn' + host.ip
}; };
jHost.obj = host; jHost.obj = host;
@ -286,14 +295,14 @@ export class SettingComponent implements OnInit, AfterContentInit {
const jPort: any = { const jPort: any = {
title: 'Port - ' + port.portNumber, title: 'Port - ' + port.portNumber,
className : 'cn' + port.portNumber, className: 'cn' + port.portNumber,
}; };
jPort.obj = port; jPort.obj = port;
jPort.children = this.convertViewService(port.services); jPort.children = this.convertViewService(port.services);
portChildren.push(jPort); portChildren.push(jPort);
} ); });
return portChildren; return portChildren;
@ -310,7 +319,7 @@ export class SettingComponent implements OnInit, AfterContentInit {
services.forEach((service, serviceKey) => { services.forEach((service, serviceKey) => {
const jService: any = { const jService: any = {
title: 'Service - ' + service.serviceName, title: 'Service - ' + service.serviceName,
className : 'cn' + service.serviceName, className: 'cn' + service.serviceName,
}; };
jService.obj = service; jService.obj = service;
@ -321,118 +330,3 @@ export class SettingComponent implements OnInit, AfterContentInit {
} }
} }
const nodes = [
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
},
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
},
{
title: 'host - 3232235781',
className: 'className3232235781',
children: [
{
title: 'Port - 22',
className: 'className22',
children: [
{
title: 'SSH',
className: 'classNameSSH'
}
]
},
{
title: 'Port - 80',
className: 'className80',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
},
{
title: 'Port - 1936',
className: 'className1936',
children: [
{
title: 'HTTP',
className: 'classNameHTTP'
}
]
}
]
}
];