示例#1
0
def initiateDBConnection():
    dbinfo = config.database  #get the database from the config file
    dbwrapper = DatabaseWrapper.dbconnect(
        dbinfo['host'])  #try to connect to the database
    dbwrapper.login(
        dbinfo['user'], dbinfo['password'],
        dbinfo['db'])  #login to the database with the correct login info
    return dbwrapper
示例#2
0
def initiateDBConnection():
	dbinfo = config.database #get the database from the config file
	dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host']) #try to connect to the database
	dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db']) #login to the database with the correct login info
	return dbwrapper
示例#3
0
文件: NodeDB.py 项目: B-Rich/ReTiNA
#
#  xmlNodeGenerator.py
#  
#
#  Authors: Del Jackson and Daniel Sawyer
#  Copyright (c) 2010 __MyCompanyName__. All rights reserved.
#
# 

import sys
sys.path.append("../database")
import DatabaseWrapper, config

#connect to database
dbinfo = config.database
dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host'])
dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db'])

dbwrapper.clearNodeStats()

nodestats = {"Address" : "", "Team" : "", "OS" : "", "Type" : "unknown"}
ServiceList = ""

if (len(sys.argv) > 1):
	log = open(sys.argv[len(sys.argv) - 1])
	
else:
	print "Using default file: sampleNDOut.txt"
	log = open("sampleNDOut.txt")
	
for line in log:
示例#4
0
def initiateDBConnection():
        dbinfo = config.database
        dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host'])
        dbwrapper.login(dbinfo['user'], dbinfo['password'],dbinfo['db'])
        return dbwrapper
示例#5
0
#
#  xmlNodeGenerator.py
#
#
#  Authors: Del Jackson and Daniel Sawyer
#  Copyright (c) 2010 __MyCompanyName__. All rights reserved.
#
#  Updated by Jarrod Sawyer on 4/22/2011

import sys
sys.path.append("../database")  # Path of the DatabaseWrapper
import DatabaseWrapper, config

#connect to database
dbinfo = config.database
dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host'])
dbwrapper.login(dbinfo['user'], dbinfo['password'], dbinfo['db'])

dbwrapper.clearNodeStats()

nodestats = {"Address": "", "Team": "", "OS": "", "Type": "unknown"}
ServiceList = ""

if (len(sys.argv) > 1):
    log = open(sys.argv[len(sys.argv) - 1])

else:
    print "Using default file: sampleNDOut.txt"
    log = open("sampleNDOut.txt")

# Goes through each line of the log file parsing out the required node detection information.
示例#6
0
def initiateDBConnection():
    dbinfo = config.database
    dbwrapper = DatabaseWrapper.dbconnect(dbinfo['host'])
    dbwrapper.login(dbinfo['user'], dbinfo['password'], dbinfo['db'])
    return dbwrapper