update
This commit is contained in:
1 parent
da8fb57bfb
commit
bba75c7dc6
35 files changed
+92592
-500
No files matched your search
@@ -0,0 +1,25 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function checkDetails() {
|
||||
const agents = ["2F-TF-1D-GK", "8A-V3-PB-85", "F6-2V-DT-8A"];
|
||||
for (const agent of agents) {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_agent: agent, settings_limit: 3 }
|
||||
});
|
||||
console.log(`\n=== Agent ${agent} top/local_ip ===`);
|
||||
console.dir(res.data?.data, { depth: null });
|
||||
}
|
||||
}
|
||||
|
||||
checkDetails();
|
||||
@@ -0,0 +1,29 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function checkAgentsList() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/scorecard/agent/download`, { headers });
|
||||
const agents = res.data?.data?.map(r => ({
|
||||
id: r.agent?.id,
|
||||
uuid: r.agent?.uuid,
|
||||
label: r.agent?.label,
|
||||
download: r.download
|
||||
}));
|
||||
console.log('Agents scorecard list:');
|
||||
console.dir(agents, { depth: null });
|
||||
} catch (e) {
|
||||
console.error('Failed:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
checkAgentsList();
|
||||
@@ -0,0 +1,22 @@
|
||||
const Database = require('better-sqlite3');
|
||||
const db = new Database('c:\\Users\\vanne\\OneDrive\\Dokumen\\Network Magang Baru\\netify-app\\backend\\netify_data.db');
|
||||
|
||||
console.log('=== INTERFACES DATA ===');
|
||||
try {
|
||||
const data = db.prepare('SELECT * FROM interfaces').all();
|
||||
console.log('Count:', data.length);
|
||||
if (data.length > 0) console.log(data.slice(0, 5));
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
console.log('=== FLOWS WITH OTHER COLUMNS? ===');
|
||||
try {
|
||||
// Let's print column names of flows and devices
|
||||
const info = db.prepare('PRAGMA table_info(flows)').all();
|
||||
console.log('Flows columns:', info.map(i => i.name));
|
||||
const info2 = db.prepare('PRAGMA table_info(devices)').all();
|
||||
console.log('Devices columns:', info2.map(i => i.name));
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const Database = require('better-sqlite3');
|
||||
const db = new Database('c:\\Users\\vanne\\OneDrive\\Dokumen\\Network Magang Baru\\netify-app\\backend\\netify_data.db');
|
||||
|
||||
try {
|
||||
const agents = db.prepare('SELECT DISTINCT agent_id FROM interfaces').all();
|
||||
console.log('Unique agent_ids in interfaces:', agents);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const ifaces = db.prepare('SELECT * FROM interfaces LIMIT 10').all();
|
||||
console.log('Sample interfaces:', ifaces);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
const Database = require('better-sqlite3');
|
||||
const db = new Database('c:\\Users\\vanne\\OneDrive\\Dokumen\\Network Magang Baru\\netify-app\\backend\\netify_data.db');
|
||||
|
||||
const ip = '10.250.192.202';
|
||||
|
||||
console.log('=== ENCRYPTION AUDIT FOR IP ===');
|
||||
try {
|
||||
const data = db.prepare('SELECT * FROM intel_encryption_audit WHERE ip_address = ?').all(ip);
|
||||
console.log(data);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
console.log('=== INSECURE PROTOCOLS FOR IP ===');
|
||||
try {
|
||||
const data = db.prepare('SELECT * FROM intel_insecure_protocols WHERE ip_address = ?').all(ip);
|
||||
console.log(data);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
console.log('=== IP REPUTATION FOR IP ===');
|
||||
try {
|
||||
const data = db.prepare('SELECT * FROM intel_ip_reputation WHERE ip_address = ? OR local_ip = ?').all(ip, ip);
|
||||
console.log(data);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
const axios = require('axios');
|
||||
const path = require('path');
|
||||
require('dotenv').config({ path: path.join(__dirname, '.env.local') });
|
||||
|
||||
const API_KEY = process.env.NETIFY_API_KEY;
|
||||
const SITE_UUID = process.env.NETIFY_SITE_UUID;
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function inspect() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/flows`, { headers, params: { settings_limit: 2 } });
|
||||
console.log('=== FLOW 0 ===');
|
||||
console.dir(res.data?.data?.[0], { depth: null });
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/intelligence/discovery/devices`, { headers, params: { settings_limit: 2 } });
|
||||
console.log('=== DISCOVERY DEVICE 0 ===');
|
||||
console.dir(res.data?.data?.[0], { depth: null });
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
inspect();
|
||||
@@ -0,0 +1,26 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function inspectLocalIpItem() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { settings_limit: 1 }
|
||||
});
|
||||
console.log('=== local_ip item ===');
|
||||
console.dir(res.data?.data?.[0], { depth: null });
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
inspectLocalIpItem();
|
||||
@@ -0,0 +1,23 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testScorecardAgent() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/scorecard/agent/download`, { headers });
|
||||
console.log('=== agent scorecard download ===');
|
||||
console.dir(res.data?.data, { depth: null });
|
||||
} catch (e) {
|
||||
console.error('Failed:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testScorecardAgent();
|
||||
@@ -0,0 +1,57 @@
|
||||
const axios = require('axios');
|
||||
const path = require('path');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testAgentFilter() {
|
||||
const agents = ["2F-TF-1D-GK", "8A-V3-PB-85", "F6-2V-DT-8A"];
|
||||
|
||||
for (const agent of agents) {
|
||||
console.log(`\n=== Testing Agent ${agent} ===`);
|
||||
|
||||
// Test stats summary
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/summary`, {
|
||||
headers,
|
||||
params: { filter_agent: agent }
|
||||
});
|
||||
console.log(`stats/summary filter_agent=${agent}:`, JSON.stringify(res.data?.data));
|
||||
} catch (e) {
|
||||
console.log(`stats/summary filter_agent=${agent} failed:`, e.message);
|
||||
}
|
||||
|
||||
// Test top local_ip
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_agent: agent, settings_limit: 3 }
|
||||
});
|
||||
const ips = res.data?.data?.map(r => r.local_ip?.address || r.local_ip);
|
||||
console.log(`top/local_ip filter_agent=${agent}:`, ips);
|
||||
} catch (e) {
|
||||
console.log(`top/local_ip filter_agent=${agent} failed:`, e.message);
|
||||
}
|
||||
|
||||
// Test flows
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/flows`, {
|
||||
headers,
|
||||
params: { filter_agent: agent, settings_limit: 3 }
|
||||
});
|
||||
const flows = res.data?.data?.map(r => `${r.local_ip?.address} -> ${r.remote_ip?.address}`);
|
||||
console.log(`flows filter_agent=${agent}:`, flows);
|
||||
} catch (e) {
|
||||
console.log(`flows filter_agent=${agent} failed:`, e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
testAgentFilter();
|
||||
@@ -0,0 +1,26 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testAgentScorecardAppFilter() {
|
||||
const app = 'YouTube';
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/scorecard/agent/download`, {
|
||||
headers,
|
||||
params: { filter_application: app }
|
||||
});
|
||||
console.log(`Agent scorecard filtered by application=${app}:`, res.data?.data?.map(r => ({ agent: r.agent?.uuid, download: r.download })));
|
||||
} catch (e) {
|
||||
console.error('Failed:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testAgentScorecardAppFilter();
|
||||
@@ -0,0 +1,48 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testAppFilters() {
|
||||
// Let's first search for YouTube application ID
|
||||
let youtubeId = 15; // default guess or we can inspect flows/stats
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_application: 'YouTube', settings_limit: 3 }
|
||||
});
|
||||
console.log(`top/local_ip with filter_application=YouTube:`, res.data?.data?.map(r => ({ ip: r.local_ip?.address, download: r.download })));
|
||||
} catch (e) {
|
||||
console.error(`Failed filter_application=YouTube:`, e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_application_id: youtubeId, settings_limit: 3 }
|
||||
});
|
||||
console.log(`top/local_ip with filter_application_id=${youtubeId}:`, res.data?.data?.map(r => ({ ip: r.local_ip?.address, download: r.download })));
|
||||
} catch (e) {
|
||||
console.error(`Failed filter_application_id=${youtubeId}:`, e.message);
|
||||
}
|
||||
|
||||
// Test flows with application filter
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/flows`, {
|
||||
headers,
|
||||
params: { filter_application: 'YouTube', settings_limit: 3 }
|
||||
});
|
||||
console.log(`flows with filter_application=YouTube:`, res.data?.data?.map(r => ({ src: r.local_ip?.address, dst: r.remote_ip?.address })));
|
||||
} catch (e) {
|
||||
console.error(`Failed flows filter_application=YouTube:`, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testAppFilters();
|
||||
@@ -0,0 +1,25 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testAppsAgent() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/application/download`, {
|
||||
headers,
|
||||
params: { filter_agent: '2F-TF-1D-GK', settings_limit: 3 }
|
||||
});
|
||||
console.log('Top apps for agent:', res.data?.data?.map(a => ({ name: a.application?.label, download: a.download })));
|
||||
} catch (e) {
|
||||
console.error('Failed:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testAppsAgent();
|
||||
@@ -0,0 +1,27 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testCombinedFilters() {
|
||||
const agent = '2F-TF-1D-GK';
|
||||
const app = 'YouTube';
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_agent: agent, filter_application: app, settings_limit: 3 }
|
||||
});
|
||||
console.log(`top/local_ip for agent=${agent} and app=${app}:`, res.data?.data?.map(r => ({ ip: r.local_ip?.address, download: r.download })));
|
||||
} catch (e) {
|
||||
console.error(`Failed combined filters:`, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testCombinedFilters();
|
||||
@@ -0,0 +1,25 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testDeviceAgent() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/intelligence/discovery/devices`, {
|
||||
headers,
|
||||
params: { filter_agent: '2F-TF-1D-GK', settings_limit: 3 }
|
||||
});
|
||||
console.log('Discovery devices for agent:', res.data?.data?.map(d => ({ ip: d.ip?.address, type: d.discovery_type?.label })));
|
||||
} catch (e) {
|
||||
console.error('Failed:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testDeviceAgent();
|
||||
@@ -0,0 +1,43 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testInterfaceFilter() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_interface: 'eth1 (LAN)', settings_limit: 3 }
|
||||
});
|
||||
console.log(`top/local_ip filter_interface=eth1 (LAN):`, res.data?.data?.map(r => r.local_ip?.address));
|
||||
} catch (e) {
|
||||
console.error('Failed filter_interface:', e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
// Let's get interfaces first to see their IDs
|
||||
const resI = await axios.get(`${BASE}/data/stats/top/interface/download`, { headers });
|
||||
const ifaces = resI.data?.data;
|
||||
console.log('Available interfaces:', ifaces?.map(i => ({ id: i.interface?.id, name: i.interface?.name, agent: i.interface?.agent_id })));
|
||||
|
||||
if (ifaces && ifaces.length > 0) {
|
||||
const ifaceId = ifaces[0].interface?.id;
|
||||
const res = await axios.get(`${BASE}/data/stats/top/local_ip/download`, {
|
||||
headers,
|
||||
params: { filter_interface_id: ifaceId, settings_limit: 3 }
|
||||
});
|
||||
console.log(`top/local_ip filter_interface_id=${ifaceId}:`, res.data?.data?.map(r => r.local_ip?.address));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed interface_id test:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testInterfaceFilter();
|
||||
@@ -0,0 +1,36 @@
|
||||
const axios = require('axios');
|
||||
|
||||
const API_KEY = 'sk_db_live_ZjViMTNmODU3ZjNkN2Q4MGV';
|
||||
const SITE_UUID = '6681452d_9cae_4ff4_8ae8_0d504774265e';
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function testIpFilter() {
|
||||
const ip = '10.250.192.202';
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/application/download`, {
|
||||
headers,
|
||||
params: { filter_local_ip: ip, settings_limit: 3 }
|
||||
});
|
||||
console.log(`Top apps for IP ${ip}:`, res.data?.data?.map(a => ({ name: a.application?.label, download: a.download })));
|
||||
} catch (e) {
|
||||
console.error(`Failed filter_local_ip:`, e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/stats/top/application/download`, {
|
||||
headers,
|
||||
params: { filter_ip: ip, settings_limit: 3 }
|
||||
});
|
||||
console.log(`Top apps for IP ${ip} (filter_ip):`, res.data?.data?.map(a => ({ name: a.application?.label, download: a.download })));
|
||||
} catch (e) {
|
||||
console.error(`Failed filter_ip:`, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
testIpFilter();
|
||||
Reference in new issue
Block a user