http403 / pyrit

Automatically exported from code.google.com/p/pyrit
0 stars 0 forks source link

r190, accessing sqlite from client #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Server 192.168.1.202, Client 192.168.1.201,
everyone sqlite 3.6.19, sqlalchemy svn_r6468

root@192.168.1.202# 
echo aaaaaaaa > testpass
pyrit -i testpass -u sqlite:////mydb.db import_passwords
1 lines read. Flushing buffers...
pyrit -u sqlite:////mydb.db eval
Connecting to storage... connected
Passwords available: 1
absolute, mydb.db in /

root@192.168.1.201#
pyrit -u sqlite:////root@192.168.1.202/mydb.db eval
Pyrit 0.2.5-dev (svn r190) (C) 2008, 2009 Lukas Lueg
http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3

Connecting to storage... Traceback (most recent call last):
  File "/usr/bin/pyrit", line 6, in <module>
    pyrit_cli.Pyrit_CLI().initFromArgv()
  File "/usr/lib/python2.6/site-packages/pyrit_cli.py", line 105, in
initFromArgv
    self.storage = storage.getStorage(storage_url)
  File "/usr/lib/python2.6/site-packages/cpyrit/storage.py", line 58, in
getStorage
    return SQLStorage(url)
  File "/usr/lib/python2.6/site-packages/cpyrit/storage.py", line 608, in
__init__
    metadata.create_all(engine)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/schema.py", line 1796,
in create_all
    bind.create(self, checkfirst=checkfirst, tables=tables)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line
1129, in create
    self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line
1154, in _run_visitor
    conn = self.contextual_connect(close_with_result=False)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.py", line
1229, in contextual_connect
    return self.Connection(self, self.pool.connect(),
close_with_result=close_with_result, **kwargs)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 151, in
connect
    agent = _ConnectionFairy(self)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 304, in
__init__
    rec = self._connection_record = pool.get()
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 161, in get
    return self.do_get()
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 522, in
do_get
    c = self.create_connection()
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 122, in
create_connection
    return _ConnectionRecord(self)
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 198, in
__init__
    self.connection = self.__connect()
  File "/usr/lib/python2.6/site-packages/sqlalchemy/pool.py", line 261, in
__connect
    connection = self.__pool._creator()
  File "/usr/lib/python2.6/site-packages/sqlalchemy/engine/strategies.py",
line 80, in connect
    raise exc.DBAPIError.instance(None, None, e)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database
file None None

how can i figure a connection, missing config in sqlite, syntax wrong?

Original issue reported on code.google.com by masterzorag on 3 Nov 2009 at 12:50

GoogleCodeExporter commented 9 years ago
sqlite has no (tcp) server of it's own. It' strictly filesystem-based.

If you want to access mydb.db from 192.168.0.1, you need to mount the
remote-filesystem to the local one. Use NFSv4 and beware locking issues....

Original comment by lukas.l...@gmail.com on 3 Nov 2009 at 1:06

GoogleCodeExporter commented 9 years ago
using sshfs also works,
mounted server/pathofmydb in client /mnt/ssh

pyrit -u sqlite:///mydb.db batch on the server +
pyrit -u sqlite:////mnt/ssh/mydb.db batch on the client =
works togheter, but
when one finish the other not, and the database was malformed:
sqlalchemy.exc.DatabaseError: (DatabaseError) database disk image is malformed
u'SELECT essids.essid AS essids_essid, sum(passwords."numElems") AS sum_1 \nFROM
essids LEFT OUTER JOIN results ON essids.essid_id = results.essid_id LEFT OUTER 
JOIN
passwords ON passwords._key = results._key GROUP BY essids.essid' []

Original comment by masterzorag on 3 Nov 2009 at 3:44

GoogleCodeExporter commented 9 years ago
This is probably due to locking/caching issues in sshfs. NFS may also fail you 
(see
sqlite faq (5)).

You should use a 'real' database-server if you want to use Pyrit over the 
network.
See http://pyrit.wordpress.com/2009/10/18/network-is-coming-back/ on how to 
setup
Postgresql for that.

Original comment by lukas.l...@gmail.com on 3 Nov 2009 at 4:02