Socket
Book a DemoInstallSign in
Socket

@agnoc/cli

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agnoc/cli

Agnoc command line

0.17.2
latest
Source
npmnpm
Version published
Weekly downloads
2
-96.23%
Maintainers
1
Weekly downloads
 
Created
Source

@agnoc/cli

Agnoc command line tool.

Install

Using npm:

$ npm install -g @agnoc/cli

or using yarn:

$ yarn add -g @agnoc/cli

The tool is named agnoc:

$ agnoc --help

Commands

Wlan

This command configures the wifi connection of the robot to the given one.

$ agnoc wlan my-wifi my-password

Read

This command reads a binary pcap dump file generated with tcpdump and prints packets to stdout.

$ agnoc read dump.pcap
[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 1] [DID: 2] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

It is possible to output to json format to be able to parse and manipulate it:

$ agnoc read --json dump.pcap

[
  {
    "ctype": 2,
    "flow": 1,
    "deviceId": 1,
    "userId": 2,
    "sequence": "7a479a0fbb978c12",
    "payload": {
      "opcode": {
        "code": "0x1012",
        "name": "DEVICE_GETTIME_RSP"
      },
      "object": {
        "result": 0,
        "body": {
          "deviceTime": 1606129555,
          "deviceTimezone": 3600
        }
      }
    }
  }
]

It is possible to use stdin as input, for example:

$ cat dump.pcap | agnoc read -

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 2] [DID: 1] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

Decode

This command reads a binary tcp flow file generated with WireShark or TShark and prints packets to stdout.

$ agnoc decode example.bin

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 1] [DID: 2] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

It is possible to output to json format to be able to parse and manipulate it:

$ agnoc decode --json example.bin

[
  {
    "ctype": 2,
    "flow": 1,
    "deviceId": 1,
    "userId": 2,
    "sequence": "7a479a0fbb978c12",
    "payload": {
      "opcode": {
        "code": "0x1012",
        "name": "DEVICE_GETTIME_RSP"
      },
      "object": {
        "result": 0,
        "body": {
          "deviceTime": 1606129555,
          "deviceTimezone": 3600
        }
      }
    }
  }
]

It is possible to use stdin as input, for example:

$ echo "2500000002010100000002000000128c97bb0f9a477a121008001a090893afeefd0510901c" | xxd -r -p | agnoc decode -

[ID: 7a479a0fbb978c12] [Flow: 1] [UID: 2] [DID: 1] [OP: DEVICE_GETTIME_RSP] {"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}

Encode

As a reverse operation to decode, encode command allows to build a binary dump using json as input:

$ agnoc encode example.json | xxd -r -p

2500000002010200000001000000128c97bb0f9a477a121008001a090893
afeefd0510901c

Also, it can be used with stdin:

$ echo '[{"ctype":2,"flow":1,"deviceId":1,"userId":2,"sequence":"7a479a0fbb978c12","opcode":{"code":"0x1012","name":"DEVICE_GETTIME_RSP"},"payload":{"result":0,"body":{"deviceTime":1606129555,"deviceTimezone":3600}}}]' | agnoc encode - | xxd -p

2500000002010200000001000000128c97bb0f9a477a121008001a090893
afeefd0510901c

Keywords

agnoc

FAQs

Package last updated on 28 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.