Skip to content

Instantly share code, notes, and snippets.

@senaps
Created February 17, 2018 11:19
Show Gist options
  • Save senaps/df18fe3cade2dd5557b1e990da29768c to your computer and use it in GitHub Desktop.
Save senaps/df18fe3cade2dd5557b1e990da29768c to your computer and use it in GitHub Desktop.
def _sensor_setup():
"""this is where we create the sensor instanse thing!"""
api_instance = RestReportingEngineApi()
api_instance.api_client.set_default_header(
'X-Appsensor-Client-Application-Name2',
'myclientapp')
api_instance.api_client.host = 'http://localhost:8085'
getServerConfiguration(api_instance)
def getServerConfiguration(api_instance):
config = api_instance.resource_rest_reporting_engine_get_server_configuration_as_json_get()
=-=-=-=-=-=-=-=-=-=-
@app.errorhandler(404)
def fourOfour(error):
"""throw a 404 error page!"""
sensor = ApiClient()
sensor.request("GET", "")
# what should i enter in the second filed? if i enter anything, it tries to send a request to it!
return "bad page bruh!", 404
# i have tried every thing! :) the only way i don't have error regurding what url to post to is:
def create_app(config):
app = Flask(__name__)
_load_config(app, config)
_load_blueprints(app)
_sensor_setup()
@app.errorhandler(404)
def fourOfour(error):
"""throw a 404 error page!"""
sensor = ApiClient()
sensor.request("GET", "localhost:8084") #8084 is where the appsensor ui lives!
return "bad page bruh!", 404
# the question is, how would i tell it what kind of attack am i getting?!
@app.errorhandler(404)
def fourOfour(error):
"""throw a 404 error page!"""
sensor = ApiClient()
# sensor.request("GET", "localhost:8084")
sensor.call_api("", "GET")
return "bad page bruh!", 404
# this code will say swagger_client.rest.ApiException
"""
ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'Date': 'Sat, 17 Feb 2018 10:57:20 GMT', 'Content-Length': '0', 'Server': 'Apache-Coyote/1.1'})
"""
#i don't even know if im looking in the right place even.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment