honeynet / beeswarm

Honeypot deployment made easy
GNU General Public License v3.0
237 stars 64 forks source link

No row was found for one() #233

Closed uolevi closed 7 years ago

uolevi commented 7 years ago

beeswarm --server --workdir /foobar/ --clearsessions --resetpw --max_sessions 100 2016-11-30 18:15:47,048 (root) Initializing BeeSwarm version 0.7.18 2016-11-30 18:15:47,060 (beeswarm.server.db.database_setup) Database is at version 4. 2016-11-30 18:15:47,109 (root) Cleaned 14 pending sessions on startup 2016-11-30 18:15:47,110 (root) Deleting 0 sessions on startup. 2016-11-30 18:15:47,116 (beeswarm.server.db.database_actor) Database has been limited to contain 100 sessions. /usr/local/lib/python2.7/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.login is deprecated, use flask_login instead. .format(x=modname), ExtDeprecationWarning /usr/local/lib/python2.7/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.wtf is deprecated, use flask_wtf instead. .format(x=modname), ExtDeprecationWarning 2016-11-30 18:15:47,181 (beeswarm.server.webapp.app) Created default admin account for the beeswarm server, password has been printed to the console.


Password for the admin account is: foobar


2016-11-30 18:15:47,181 (beeswarm.server.server) Starting server listening on port 5450 2016-11-30 18:15:47,182 (beeswarm.server.server) Server started. 198.19.213.75 - - [2016-11-30 18:15:53] "GET / HTTP/1.1" 302 593 0.002804 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:142: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = LoginForm() 198.19.213.75 - - [2016-11-30 18:15:53] "GET /login?next=%2F HTTP/1.1" 200 2610 0.038796 198.19.213.75 - - [2016-11-30 18:15:53] "GET /static/css/bootstrap.min.css HTTP/1.1" 200 106299 0.011846 198.19.213.75 - - [2016-11-30 18:15:53] "GET /static/css/bootstrap-responsive.min.css HTTP/1.1" 200 17131 0.001413 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/thirdparty/fuelux/loader.min.js HTTP/1.1" 200 97862 0.007898 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/js/underscore-min.js HTTP/1.1" 200 15906 0.001050 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/thirdparty/fuelux/css/fuelux-responsive.css HTTP/1.1" 200 24816 0.001136 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/css/font-awesome.min.css HTTP/1.1" 200 18062 0.001100 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/js/main.js HTTP/1.1" 200 1782 0.001166 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/js/jquery-1.9.1.min.js HTTP/1.1" 200 92910 0.006234 198.19.213.75 - - [2016-11-30 18:15:54] "GET /static/thirdparty/fuelux/css/fuelux.css HTTP/1.1" 200 174583 0.009613 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:142: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = LoginForm() 2016-11-30 18:15:57,925 (beeswarm.server.webapp.app) User admin logged in. 198.19.213.75 - - [2016-11-30 18:15:57] "POST /login?next=%2F HTTP/1.1" 302 892 0.004394 198.19.213.75 - - [2016-11-30 18:15:58] "GET / HTTP/1.1" 200 6559 0.112546 198.19.213.75 - - [2016-11-30 18:16:13] "GET /sessions HTTP/1.1" 200 13156 0.012336 198.19.213.75 - - [2016-11-30 18:16:13] "GET /data/sessions/all HTTP/1.1" 200 967 0.127468 198.19.213.75 - - [2016-11-30 18:16:14] "GET /data/session/undefined/transcript HTTP/1.1" 200 109 0.318698 198.19.213.75 - - [2016-11-30 18:16:14] "GET /data/session/undefined/credentials HTTP/1.1" 200 109 0.349695 198.19.213.75 - - [2016-11-30 18:16:19] "GET /ws/drones HTTP/1.1" 200 8853 0.007723 198.19.213.75 - - [2016-11-30 18:16:21] "GET /data/drones/all HTTP/1.1" 200 1787 1.073433 198.19.213.75 - - [2016-11-30 18:16:31] "GET /bait_users HTTP/1.1" 200 7793 0.005170 198.19.213.75 - - [2016-11-30 18:16:31] "GET /ws/bait_users HTTP/1.1" 200 1955 0.003779 198.19.213.75 - - [2016-11-30 18:16:38] "GET / HTTP/1.1" 200 6521 0.095772 198.19.213.75 - - [2016-11-30 18:18:35] "GET / HTTP/1.1" 302 593 0.002704 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:142: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = LoginForm() 198.19.213.75 - - [2016-11-30 18:18:36] "GET /login?next=%2F HTTP/1.1" 200 2611 0.002746 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 185 0.001401 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/thirdparty/fuelux/css/fuelux-responsive.css HTTP/1.1" 304 184 0.001009 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/css/bootstrap-responsive.min.css HTTP/1.1" 304 184 0.001031 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/js/underscore-min.js HTTP/1.1" 304 183 0.001073 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/js/main.js HTTP/1.1" 304 183 0.001021 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/thirdparty/fuelux/loader.min.js HTTP/1.1" 304 183 0.000984 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/js/jquery-1.9.1.min.js HTTP/1.1" 304 184 0.000974 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/thirdparty/fuelux/css/fuelux.css HTTP/1.1" 304 185 0.001018 198.19.213.75 - - [2016-11-30 18:18:36] "GET /static/css/font-awesome.min.css HTTP/1.1" 304 184 0.000962 198.19.213.75 - - [2016-11-30 18:18:36] "GET /favicon.ico HTTP/1.1" 404 342 0.002145 198.19.213.75 - - [2016-11-30 18:18:36] "GET /favicon.ico HTTP/1.1" 404 342 0.000668 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:142: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = LoginForm() 2016-11-30 18:18:37,571 (beeswarm.server.webapp.app) User admin logged in. 198.19.213.75 - - [2016-11-30 18:18:37] "POST /login?next=%2F HTTP/1.1" 302 894 0.003957 198.19.213.75 - - [2016-11-30 18:18:37] "GET / HTTP/1.1" 200 6522 0.099976 198.19.213.75 - - [2016-11-30 18:18:42] "GET /ws/drones HTTP/1.1" 200 8853 0.001763 198.19.213.75 - - [2016-11-30 18:18:42] "GET /data/drones/all HTTP/1.1" 200 1787 0.003819 198.19.213.75 - - [2016-11-30 18:18:45] "GET /ws/drone/configure/47 HTTP/1.1" 200 4812 0.004508 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:222: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = HoneypotConfigurationForm(obj=config_obj) 198.19.213.75 - - [2016-11-30 18:18:47] "GET /ws/drone/honeypot/configure/47 HTTP/1.1" 200 20581 0.046184 /usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/webapp/app.py:222: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form = HoneypotConfigurationForm(obj=config_obj) 198.19.213.75 - - [2016-11-30 18:19:00] "POST /ws/drone/honeypot/configure/47 HTTP/1.1" 200 3852 0.521740 198.19.213.75 - - [2016-11-30 18:19:05] "GET /ws/drones HTTP/1.1" 200 8853 0.001427 198.19.213.75 - - [2016-11-30 18:19:15] "GET /data/drones/all HTTP/1.1" 200 1787 9.054469 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 534, in run result = self._run(*self.args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/db/database_actor.py", line 164, in _run self.persist_session(topic, data) File "/usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.18-py2.7.egg/beeswarm/server/db/database_actor.py", line 257, in persist_session _honeypot = db_session.query(Honeypot).filter(Honeypot.id == data['honeypot_id']).one() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2762, in one raise orm_exc.NoResultFound("No row was found for one()") NoResultFound: No row was found for one() <DatabaseActor at 0x7f7261af6a50> failed with NoResultFound

2016-11-30 18:19:17,155 (beeswarm.server.server) Stopping because <DatabaseActor at 0x7f7261af6a50> died: No row was found for one() 2016-11-30 18:19:17,155 (root) Stopping server.

johnnykv commented 7 years ago

Thanks for the bug report. I see the problem. Am I correct in assuming that a drone was just deleted when this occurred?

uolevi commented 7 years ago

Yes, it looks like it has occurred first time right after server tried to delete non-existent bait user. However now it happens quite randomly after starting the server without trying to delete anything.