Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when testing with httprint #227

Closed
mzfr opened this issue Feb 13, 2018 · 2 comments
Closed

Errors when testing with httprint #227

mzfr opened this issue Feb 13, 2018 · 2 comments
Labels

Comments

@mzfr
Copy link
Collaborator

mzfr commented Feb 13, 2018

I was testing httprint on Snare for issue mushorg/snare#7.

$ sudo python3 snare.py --port 8080 --page-dir example.com

privileges dropped, running as "nobody:nogroup"
serving on ('127.0.0.1', 8080) with uuid a7a529b8-8579-4b1d-827c-6e3f544d9823
Request path: /
Dorks timeout
snare.py:281: RuntimeWarning: coroutine 'HttpRequestHandler.submit_data' was never awaited
  self.submit_data(data)
Task exception was never retrieved
future: <Task finished coro=<ServerHttpProtocol.start() done, defined at /usr/local/lib/python3.5/dist-packages/aiohttp/server.py:225> exception=TypeError("'NoneType' object is not iterable",)>
Traceback (most recent call last):
  File "snare.py", line 67, in get_dorks
    'http://{0}:8090/dorks'.format(self.run_args.tanner)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client.py", line 590, in __await__
    resp = yield from self._coro
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client.py", line 222, in _request
    yield from resp.start(conn, read_until_eof)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/client_reqrep.py", line 615, in start
    message = yield from httpstream.read()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/streams.py", line 625, in read
    result = yield from super().read()
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/streams.py", line 456, in read
    yield from self._waiter
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 266, in result
    raise CancelledError
concurrent.futures._base.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/server.py", line 275, in start
    yield from self.handle_request(message, payload)
  File "snare.py", line 184, in handle_request
    content, content_type, headers, status_code = await self.parse_tanner_response(request.path, event_result['response']['message']['detection'])
  File "snare.py", line 236, in parse_tanner_response
    content = await self.handle_html_content(content)
  File "snare.py", line 153, in handle_html_content
    href=self.dorks.pop(),
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/server.py", line 325, in start
    yield from self.handle_error(500, message, None, exc)
TypeError: 'NoneType' object is not iterable

This occurred when I ran this command on httprint: httprint -h 127.0.0.1:8080 -s signatures.txt -P0

@mzfr
Copy link
Collaborator Author

mzfr commented Feb 13, 2018

2018-02-13 10:40 ERROR:asyncio:run_app: Task exception was never retrieved
future: <Task finished coro=<CommandCreator._get_wrapped_method.<locals>.wrapper.<locals>.done() done, defined at /usr/lib/python3.6/site-packages/asyncio_redis/protocol.py:650> exception=InvalidStateError('invalid state',)>
Traceback (most recent call last):
 File "/usr/lib/python3.6/site-packages/asyncio_redis/protocol.py", line 655, in done
   future2.set_result(result)
asyncio.base_futures.InvalidStateError: invalid state
2018-02-13 13:34 ERROR:aiohttp.server:log_exception: Error handling request
Traceback (most recent call last):
 File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 278, in data_received
   messages, upgraded, tail = self._request_parser.feed_data(data)
 File "aiohttp/_http_parser.pyx", line 273, in aiohttp._http_parser.HttpParser.feed_data (aiohttp/_http_parser.c:4351)
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

@afeena was able to figure out that tanner cannot handle this request so it returns nothing for dorks

@afeena afeena added the bug label Feb 14, 2018
@afeena
Copy link
Collaborator

afeena commented Jul 30, 2018

aiohttp.http_exceptions.BadStatusLine: invalid HTTP method occurs than httprint sends this raw data:
b'\x16\x03\x00\x00_\x01\x00\x00[\x03\x00[^*\xdd\x9a4\xfc,\xf1#\xd9\xa5o\xed\xa5v~\x13I\xf0\xef\xc0js[\x9dm\xa2\xf2@\xadx\x00\x004\x009\x008\x005\x00\x16\x00\x13\x00\n\x003\x002\x00/\x00f\x00\x05\x00\x04\x00c\x00b\x00a\x00\x15\x00\x12\x00\t\x00e\x00d\x00`\x00\x14\x00\x11\x00\x08\x00\x06\x00\x03\x01\x00'

Exception occurs inside aiohttp and doesn't affect the result of httprint or snare work.
Other exceptions no more relevant after replacing redis library.

@afeena afeena closed this as completed Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants