-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.js
More file actions
47 lines (39 loc) · 1.44 KB
/
Copy pathglobal.js
File metadata and controls
47 lines (39 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import SONAR from '../../sonar'
import Interface from '../../lib/interface'
import Logger from '../../logger'
import path from 'path'
import fs from 'fs'
export default (callback)=>{
if(typeof callback !== 'function') return
Logger(null, `SUBMARINE#1`)
Logger(`Initialize Sequence Start.`)
Logger(`Network Initiating..`)
Interface((active)=>{
if(active === null){
Logger('Network Initiating.. [FAIL]')
Logger('Failed to find an available network card.')
Logger('Please check your internet connection.')
return
}
Logger('Network Initiated.\n')
Logger(`Stealth Host: ${active.external} [${active.ip}] [${active.mac}]`)
Logger(`Type: [${active.type}] GateWay: ${active.gateway.ip} [${active.gateway.mac}]\n`)
Logger(`Socket Initiating..`)
let configPath = path.resolve(`${__dirname}../../data/config.json`)
if(!fs.existsSync(configPath)){
let defaultConfig = {
receivePort: 12345
}
}
let sonar = new SONAR((isLoaded, sonar)=>{
if(!isLoaded){
Logger('Socket Initiating.. [FAIL]')
Logger('Please get npcap program and install it.')
Logger('WinPcap API-compatible Mode must be checked.')
return
}
Logger('Socket Initiated.\n')
callback(sonar)
}, active)
}, true)
}