mirror of https://github.com/cowrie/cowrie.git
Added a simple tool for editing data/pass.db
git-svn-id: https://kippo.googlecode.com/svn/trunk@142 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
c5604e7f66
commit
e9fee2d937
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import anydbm, sys, os
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) < 3 or \
|
||||||
|
(sys.argv[2] in ('add', 'remove') and len(sys.argv) < 4):
|
||||||
|
print 'Usage: %s <pass.db> <add|remove|list> [password]' % \
|
||||||
|
os.path.basename(sys.argv[0])
|
||||||
|
sys.exit(1)
|
||||||
|
db = anydbm.open(sys.argv[1], 'c')
|
||||||
|
if sys.argv[2] == 'list':
|
||||||
|
for password in db:
|
||||||
|
print password
|
||||||
|
elif sys.argv[2] == 'add':
|
||||||
|
db[sys.argv[3]] = None
|
||||||
|
elif sys.argv[2] == 'remove':
|
||||||
|
del db[sys.argv[3]]
|
||||||
|
else:
|
||||||
|
print 'Unknown option: %s' % (sys.argv[2],)
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
# vim: set ft=python sw=4 et:
|
Loading…
Reference in New Issue