kismetwireless / python-kismet-rest Goto Github PK
View Code? Open in Web Editor NEWKismet REST Python API (mirrored from Kismet repos)
License: Other
Kismet REST Python API (mirrored from Kismet repos)
License: Other
Hello is there any way to filter data base on interface/datasource?
requests.post() and requests.get() are called without timeout parameter, so clients could hang for ever. maybe a global parameter could be added, so timeouts could be passed through to these calls.
also, see kismetwireless/kismet#339
Improve timestamp handling:
Add a synthetic column for handling timestamps. This will add a column to output which will be a python datetime
object (composed from ts_sec and ts_usec).
Provide functionality to make time-related queries using a Python datetime
object instead of having to reduce query args to two timestamp-related fields.
Add the ability to query using ISO 8601-formatted timestamp. Prioritize so that if multiple timestamps are provided with kwargs, the priority (in order of importance) should be:
under ubuntu 16.04 (vendor repo hosts python 3.5.2 as latest version) encountered error:
Traceback (most recent call last):
File "./wifi-alarm.py", line 38, in <module>
for device in devices.by_mac(devices=macs, fields=fields):
File "/usr/local/lib/python3.5/dist-packages/kismet_rest/devices.py", line 62, in by_mac
for result in self.interact_yield("POST", url, **call_settings):
File "/usr/local/lib/python3.5/dist-packages/kismet_rest/base_interface.py", line 255, in interact_yield
for result in self.process_response_stream(response, **kwargs):
File "/usr/local/lib/python3.5/dist-packages/kismet_rest/base_interface.py", line 271, in process_response_stream
yield json.loads(result)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
upgrade to python 3.6.8 solves.
other work arounds seem to be:
i don't know if support for python 3.5 is a concern but i figured i would put the info out there.
Even even there is only one commit since latest release, it would be good to make a new release. Indeed, master and current release are not backward compatibles as ekjson serialization modifies field names since October 2019.
using python-kismet-rest 2019.05.02 and kismet release 2019-09-01. I have been unable to raise an alert with the following code:
import kismet_rest
alert_conn = kismet_rest.Alerts(
username=username, password=password, host_uri=host)
alert_conn.define(name="AN_ALERT", description="Something has happened")
alert_conn.raise_alert(name="AN_ALERT", text="success")
The connection to the kismet instance works and no error are thrown but no alert is displayed on the web gui. I'm sure its my code, please code you point me in the right direction?
any assistance would be greatfully recieved
Tao
alerts.url_template = "alerts/last-time/{ts_sec}.{ts_usec}/alerts.itjson"
should be i think:
alerts.url_template = "alerts/last-time/{ts_sec}.{ts_usec}/alerts.json"
many thanks
tao
hello i have my kismet tool running on kali linux and i have downloaded your library using pip and when i run in py charm its giving me error
/root/PycharmProjects/BlueSnarf/venv/bin/python /root/PycharmProjects/BlueSnarf/DosAlert.py
Traceback (most recent call last):
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 278, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: *KISMET: 0.0.0 1561387425 �kali� �pcapdump,netxml,nettxt,gpsxml,alert� 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 368, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 296, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 278, in _read_status
raise BadStatusLine(line)
urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('*KISMET: 0.0.0 1561387425 \x01kali\x01 \x01pcapdump,netxml,nettxt,gpsxml,alert\x01 0 \n'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/PycharmProjects/BlueSnarf/DosAlert.py", line 5, in
for device in conn.device_summary():
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/kismet_rest/legacy.py", line 105, in device_summary
return self.device_list(callback, cbargs)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/kismet_rest/legacy.py", line 127, in device_list
return self.interact("GET", url, True, **kwargs)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/kismet_rest/base_interface.py", line 142, in interact
response = self.session.get(full_url, stream=stream)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/root/PycharmProjects/BlueSnarf/venv/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('*KISMET: 0.0.0 1561387425 \x01kali\x01 \x01pcapdump,netxml,nettxt,gpsxml,alert\x01 0 \n'))
Process finished with exit code 1
/datasource/by-uuid/[UUID]/pause_source.cmd
This goes into the Datasources
class, when it's created.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.