Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ajax API

There are several php pages which return JSON content for use in Ajax pages.

These scripts can be found in /var/www/myra-canyon/html/json/. Note that when accessed via Apache, the JSON scripts require a valid web interface session cookie obtained with a username/password login.

For example:

This can easily be done with tools like curl or wget:

wget --quiet --no-check-certificate --output-document=/dev/null --keep-session-cookies --save-cookies cookies.txt --post-data="username=bob&password=secret" https://192.168.1.70/login.php
wget --quiet --no-check-certificate --output-document=- --keep-session-cookies --load-cookies cookies.txt https://192.168.1.70/json/flows.php
{
"0": {
"id": "265227",
"hash": "4831916679882035559",
"parent": null,
"ethertype": "2048",
"protocol": "6",
"addr_1": "10.0.1.11",
"addr_2": "31.13.77.6",
"port_1": "47789",
"port_2": "80",
"last_type": "HTTP",
"type": "FlowStart+IP+IPv4+TCP+HTTP",
"first_seen": "2015-03-06 04:48:52.420741-08"
},
...

JSON: ether_types

JSON: flow_stats

JSON: flows

  • /json/flows.php
  • Provides the most recent 100 flow records.
  • See Table: flows.
  • See Myra::Flow.
  • See Myra::Server::flow_map.
  • For example:
    {
    "0": {
    "id": "223904",
    "hash": "18329117701394876310",
    "parent": null,
    "ethertype": "2048",
    "protocol": "6",
    "addr_1": "10.0.1.23",
    "addr_2": "23.3.105.153",
    "port_1": "62056",
    "port_2": "80",
    "last_type": "HTTP",
    "type": "FlowStart+FlowEnded+IP+IPv4+TCP+HTTP",
    "first_seen": "2015-03-01 13:28:00.82645-08"
    },
    ...

JSON: inside_hosts

  • /json/inside_hosts.php
  • Provides information on all known inside hosts.
  • See Myra::Server::inside_host_thread().
  • For example:
    {
    "0": {
    "id": "17",
    "address": "10.0.1.24",
    "mac": "f8:0f:41:2f:cc:b1",
    "lease_start": "2015-02-27 12:52:44-08",
    "lease_end": "2015-03-27 13:52:44-07",
    "hostname": "souris",
    "last_update": "2015-02-27 13:04:58.58429-08"
    },
    ...

JSON: live-data

  • /json/live-data.php
  • Provides information used by report-live.php on network traffic over the past 1000 milliseconds (1 second).
  • For example:
    {
    "total": {
    "out": 116,
    "in": 60
    },
    "flows": {
    "12154039569872845193": {
    "out": 116,
    "in": 60
    }
    },
    "per_host": {
    "10.0.1.23": {
    "name": "iPad",
    "out": 116,
    "in": 60,
    "flows": {
    "12154039569872845193": {
    "out": 116,
    "in": 60
    }
    }
    }
    }
    }

JSON: protocol_type

JSON: sessions

  • /json/sessions.php
  • Provides information on web interface sessions.
  • See myra_validate_session_id().
  • See Myra::Session.
  • For example:
    {
    "session" : {
    "7AB354094B9354EE" : {
    "ip" : "192.168.1.45",
    "ts" : 1425245917,
    "user" : "stephane"
    }
    }
    }

JSON: traffic_type

  • /json/traffic_type.php
  • Traffic type id to name mapping.
  • See Table: traffic_type.
  • See Myra::Traffic::Type.
  • For example:
    {
    "0": "Unknown",
    "1": "StopAnalysis",
    "2": "FlowStart",
    "3": "FlowEnded",
    "4": "PortBased",
    "5": "Recovered",
    "70": "ARP",
    "71": "IP",
    "72": "IPv4",
    "73": "IPv6",
    "100": "TCP",
    "101": "UDP",
    "102": "ICMP",
    "1000": "DNS",
    "1001": "HTTP",
    "1002": "SPDY",
    "1003": "Ping",
    "1004": "SSH",
    ....

JSON: version

  • /json/version.php
  • Provides the Myra Canyon version number and the date when it was built.
  • For example:
    {
    "version": "v0.0.1-758",
    "build_date": "2015-03-01 11:17:48 -0800"
    }