sensepost / snoopy-ng

Snoopy v2.0 - modular digital terrestrial tracking framework
Other
429 stars 128 forks source link

Confused on how snoopy.db is created #56

Closed thesle3p closed 9 years ago

thesle3p commented 9 years ago

Hi the Readme does not make this clear but how exactly does one create the snoopy.db sqlite file used to store data? I first tried passing it the path to a non existent snoopy.db file in the path I wanted it in hoping it would create such a file but it Crashed, so then I tried creating a empty sqlite database thinking snoopy would populate it with the appropriate tables but I got the same error message. How am I supposed to create snoopy.db? I encountered this on stock debian and arch linux with SQLAlchemy version 0.7.8 The error message can be found below:

[+] Starting Snoopy with plugins: server [+] Capturing local only. Saving to 'sqlite:///path/to/snoopy/snoopy-ng/snoopy.db' Traceback (most recent call last): File "./snoopy.py", line 428, in main() File "./snoopy.py", line 425, in main options.key, options.location, options.flush, options.verbose) File "./snoopy.py", line 86, in init if not self.db.dialect.has_table(self.db.connect(), tbl.name): File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2013, in connect return self._connection_cls(self, *kwargs) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 72, in init if connection is not None else engine.raw_connection() File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2099, in raw_connection self.pool.unique_connection, _connection) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2073, in _wrap_pool_connect e, dialect, self) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1403, in _handle_dbapi_exception_noconnection exc_info File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect return fn() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 318, in unique_connection return _ConnectionFairy._checkout(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 708, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 480, in checkout rec = pool._do_get() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1140, in _do_get return self._create_connection() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 323, in _create_connection return _ConnectionRecord(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 449, in init self.connection = self.connect() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 602, in connect connection = self.__pool._invoke_creator(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 97, in connect return dialect.connect(_cargs, _cparams) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 377, in connect return self.dbapi.connect(_cargs, *_cparams) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

aiddenkeli commented 9 years ago

You shouldnt try specifying a path to the db file. If you run just the example in the readme it should create the db file for you. On May 29, 2015 3:14 PM, "thesle3p" notifications@github.com wrote:

Hi the Readme does not make this clear but how exactly does one create the snoopy.db sqlite file used to store data? I first tried passing it the path to a non existent snoopy.db file in the path I wanted it in hoping it would create such a file but it Crashed, so then I tried creating a empty sqlite database thinking snoopy would populate it with the appropriate tables but I got the same error message. How am I supposed to create snoopy.db? I encountered this on stock debian and arch linux with SQLAlchemy version 0.7.8 The error message can be found below:

[+] Starting Snoopy with plugins: server [+] Capturing local only. Saving to 'sqlite:///path/to/snoopy/snoopy-ng/snoopy.db' Traceback (most recent call last): File "./snoopy.py", line 428, in main() File "./snoopy.py", line 425, in main options.key, options.location, options.flush, options.verbose) File "./snoopy.py", line 86, in init if not self.db.dialect.has_table(self.db.connect(), tbl.name): File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2013, in connect return self. _connection_cls(self, _kwargs) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 72, in _init if connection is not None else engine.raw_connection() File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2099, in raw_connection self.pool.unique_connection,

_connection) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2073, in wrap_pool_connect e, dialect, self) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1403, in _handle_dbapi_exception_noconnection exc_info File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect return fn() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 318, in unique_connection return _ConnectionFairy._checkout(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 708, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 480, in checkout rec = pool._do_get() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1140, in _do_get return self._create_connection() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 323, in _create_connection return _ConnectionRecord(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 449, in _init self.connection = self.connect() File "/usr/lib/python2.7/site-packages/sqlalchemy/pool.py", line 602, in connect connection = self.__pool._invoke_creator(self) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 97, in connect return dialect.connect(_cargs, _cparams) File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 377, in connect return self.dbapi.connect(_cargs, _cparams) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

— Reply to this email directly or view it on GitHub https://github.com/sensepost/snoopy-ng/issues/56.

glennzw commented 9 years ago

You need to specify the database format correctly, you're missing one "/".

e.g. 'sqlite:////tmp/snoopy.db'