Created
August 27, 2015 12:46
-
-
Save adilakhter/9e2af0d62de561d23dae to your computer and use it in GitHub Desktop.
send to logstash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import json | |
import sys | |
HOST = 'logging.developmentci.rebb.baseless.nl' | |
PORT = 1514 | |
try: | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
except socket.error, msg: | |
sys.stderr.write("[ERROR] %s\n" % msg[1]) | |
sys.exit(1) | |
try: | |
sock.connect((HOST, PORT)) | |
except socket.error, msg: | |
sys.stderr.write("[ERROR] %s\n" % msg[1]) | |
sys.exit(2) | |
msg = {"role": "NiktoScanner", "scanning_timestamp":"26-08-2015-11-26-45","scanner":"Nikto v2.1.6/2.1.5","rsite_host":"192.168.59.3","rsite_port":"5000","issue_id":"999102","severity":"Security Warning","description":"GET The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS---3"} | |
sock.send(json.dumps(msg)) | |
sock.close() | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment