{"action":"created","issue":{"url":"https://api.github.com/repos/lmco/laikaboss/issues/20","labels_url":"https://api.github.com/repos/lmco/laikaboss/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/lmco/laikaboss/issues/20/comments","events_url":"https://api.github.com/repos/lmco/laikaboss/issues/20/events","html_url":"https://github.com/lmco/laikaboss/issues/20","id":110172832,"number":20,"title":"Lightweight client","user":{"login":"c-goosen","id":7881734,"avatar_url":"https://avatars.githubusercontent.com/u/7881734?v=3","gravatar_id":"","url":"https://api.github.com/users/c-goosen","html_url":"https://github.com/c-goosen","followers_url":"https://api.github.com/users/c-goosen/followers","following_url":"https://api.github.com/users/c-goosen/following{/other_user}","gists_url":"https://api.github.com/users/c-goosen/gists{/gist_id}","starred_url":"https://api.github.com/users/c-goosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c-goosen/subscriptions","organizations_url":"https://api.github.com/users/c-goosen/orgs","repos_url":"https://api.github.com/users/c-goosen/repos","events_url":"https://api.github.com/users/c-goosen/events{/privacy}","received_events_url":"https://api.github.com/users/c-goosen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-07T08:13:41Z","updated_at":"2015-10-07T12:51:56Z","closed_at":null,"body":"Is it possible to write a more lightweight client that implements a tripwire type detection. Im thinking in terms of a periodic scan of the file system, comparing hashes and then passing suspect files via the network to a laikaboss host. webscan.py still requires a lot of libraries to be installed. "},"comment":{"url":"https://api.github.com/repos/lmco/laikaboss/issues/comments/146187485","html_url":"https://github.com/lmco/laikaboss/issues/20#issuecomment-146187485","issue_url":"https://api.github.com/repos/lmco/laikaboss/issues/20","id":146187485,"user":{"login":"marnao","id":3496643,"avatar_url":"https://avatars.githubusercontent.com/u/3496643?v=3","gravatar_id":"","url":"https://api.github.com/users/marnao","html_url":"https://github.com/marnao","followers_url":"https://api.github.com/users/marnao/followers","following_url":"https://api.github.com/users/marnao/following{/other_user}","gists_url":"https://api.github.com/users/marnao/gists{/gist_id}","starred_url":"https://api.github.com/users/marnao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marnao/subscriptions","organizations_url":"https://api.github.com/users/marnao/orgs","repos_url":"https://api.github.com/users/marnao/repos","events_url":"https://api.github.com/users/marnao/events{/privacy}","received_events_url":"https://api.github.com/users/marnao/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T12:51:56Z","updated_at":"2015-10-07T12:51:56Z","body":"Yes! It's an undocumented feature and admittedly has not been thoroughly tested, but we provide a cross platform interface that uses JSON for serialization rather than python's pickle. We are also planning to add more interface types in the future that are even more lightweight (JSON is pretty heavy for serialization).\r\n\r\nHere is an example python client the uses JSON for serialization. You could easily extend this example to work on other platforms/languages. The only hard requirement is ZeroMQ for message transport.\r\n\r\n```\r\n#!/usr/bin/python\r\n\r\nimport zmq\r\nimport base64\r\nimport json\r\nimport sys\r\n\r\nREQ_TYPE_PICKLE = '1'\r\nREQ_TYPE_PICKLE_ZLIB = '2'\r\nREQ_TYPE_JSON = '3'\r\nREQ_TYPE_JSON_ZLIB = '4'\r\n\r\nfn = sys.argv[1]\r\nuniqID = sys.argv[2]\r\n\r\nrequest = { 'source' : 'python-json-client',\r\n             'buffer' : base64.b64encode(open(fn).read()),\r\n             'filename' : fn,\r\n             'uniqID' : uniqID,\r\n             'extMetaData' : { 'testing' : uniqID }\r\n           }\r\n\r\njRequest = json.dumps(request)\r\n\r\n\r\nctx = zmq.Context()\r\n\r\nclient = ctx.socket(zmq.REQ)\r\npoll = zmq.Poller()\r\npoll.register(client, zmq.POLLIN)\r\n\r\nclient.connect('tcp://localhost:5558')\r\n\r\n# The first field tells the server to expect json. If you had a 1 in here it would expect a python pickled object\r\n# The second field is a blank delimter field, required by zmq\r\n# You could compress the JSON with zlib if you choose-- just choose REQ_TYPE_JSON_ZLIB instead\r\nclient.send_multipart([REQ_TYPE_JSON, '', jRequest])\r\n\r\nsocks = dict(poll.poll(None))\r\n\r\nif socks.get(client) == zmq.POLLIN:\r\n    # Recieve reply\r\n    reply = client.recv()\r\n\r\nresult = json.loads(reply)\r\n\r\nprint json.dumps(result, indent=4, separators=(',', ': '), ensure_ascii=False)\r\n```\r\n\r\nDoes this help?\r\n"}}