dbiesecke
1/1/2016 - 2:45 PM

Lair-framework REST examples

Lair-framework REST examples

Lair-framework

Shows some basic REST command's to interact with a Lair API backend server (v2) lair-framework

export USERNAMEPASSWORD=admin@localhost:password export ProID=bDmiELoSJhAdwX2QS export LURL=http://127.0.0.1:11015/

get all hosts from project

curl -ksS -u "$USERNAMEPASSWORD" --url 'http://127.0.0.1:11015/api/projects/$ProID/hosts' | json_pp

[
   {
      "hostnames" : [],
      "ipv4" : "151.251.113.111",
      "tags" : [],
      "services" : null,
      "statusMessage" : "",
      "lastModifiedBy" : "admin@localhost",
      "status" : "lair-grey",
      "longIpv4Addr" : 2549838191,
      "_id" : "aFkRBejuhiskjJnZX",
      "files" : [],
      "os" : {
         "weight" : 100,
         "fingerprint" : "linux",
         "tool" : "Manual"
      },
      "mac" : "",
      "notes" : [],
      "isFlagged" : false,
      "webDirectories" : null,
      "projectId" : "bDmiELoSJhAdwX2QS"
   },
   {
      "longIpv4Addr" : 3455807599,
      "_id" : "LtScHRTSTSk8KFnqe",
      "status" : "lair-grey",
      "statusMessage" : "",
      "lastModifiedBy" : "admin@localhost",
      "services" : null,
      "tags" : [],
      "ipv4" : "205.251.112.111",
      "hostnames" : [],
      "projectId" : "bDmiELoSJhAdwX2QS",
      "webDirectories" : null,
      "isFlagged" : false,
      "mac" : "",
      "notes" : [],
      "os" : {
         "fingerprint" : "",
         "tool" : "",
         "weight" : 0
      },
      "files" : []
   }
]