Esempio n. 1
0
def main():

	config = file('config.yaml', 'r')
	config = yaml.load(config)
	toolConfig = config['tool']

	host     = toolConfig['host']
	bindDN   = toolConfig['bindDN']
	password = toolConfig['password']


	iRocLdap = IRocLDAP(host, bindDN, password)

	results = iRocLdap.getButtons( )

	if type(results) == tuple and len(results) == 2 :
		(code, arr) = results
	elif type(results) == list:
		arr = results

	for item in arr:
		(dn, attrs) = item
		uid = attrs['uid'][0]
		status = attrs['iLockRocButtonActive'][0]
		if 'iLockRocUserDN' in attrs:
			hackerDN = attrs['iLockRocUserDN'][0]
		else:
			hackerDN = "Undef"

		print "UID: %s Active: %s HackerDN: %s" % ( uid, status, hackerDN )
Esempio n. 2
0
def main():

	parser = argparse.ArgumentParser()
	parser.add_argument('--button', dest='buttonID', help='the iButton ID', required=True)
	parser.add_argument('-v', dest='verbose', action='store_true')
	args = parser.parse_args()

	config = file('config.yaml', 'r')
	config = yaml.load(config)
	toolConfig = config['tool']

	host     = toolConfig['host']
	bindDN   = toolConfig['bindDN']
	password = toolConfig['password']
	buttonID = args.buttonID

	iRocLdap = IRocLDAP(host, bindDN, password)

	status = iRocLdap.addButton( buttonID )
Esempio n. 3
0
def main():

	parser = argparse.ArgumentParser()
	parser.add_argument('--uid', dest='uid', required=True)
	parser.add_argument('-v', dest='verbose', action='store_true')
	args = parser.parse_args()

	config = file('config.yaml', 'r')
	config = yaml.load(config)
	toolConfig = config['tool']

	host     = toolConfig['host']
	bindDN   = toolConfig['bindDN']
	password = toolConfig['password']

	uid      = args.uid

	iRocLdap = IRocLDAP(host, bindDN, password)

	status = iRocLdap.delHacker( uid )
Esempio n. 4
0
def main():

    parser = argparse.ArgumentParser()
    parser.add_argument("--button", dest="buttonID", help="the iButton ID", required=True)
    parser.add_argument("-v", dest="verbose", action="store_true")
    args = parser.parse_args()

    config = file("config.yaml", "r")
    config = yaml.load(config)
    toolConfig = config["tool"]

    host = toolConfig["host"]
    bindDN = toolConfig["bindDN"]
    password = toolConfig["password"]

    buttonID = args.buttonID

    iRocLdap = IRocLDAP(host, bindDN, password)

    status = iRocLdap.delButton(buttonID)
Esempio n. 5
0
def main():

    parser = argparse.ArgumentParser()
    parser.add_argument("--button", dest="buttonID", help="the iButton ID", required=True)
    parser.add_argument("--uid", dest="uid", help="the hacker uid", required=True)
    args = parser.parse_args()

    config = file("config.yaml", "r")
    config = yaml.load(config)
    toolConfig = config["tool"]

    host = toolConfig["host"]
    bindDN = toolConfig["bindDN"]
    password = toolConfig["password"]

    buttonID = args.buttonID
    uid = args.uid

    iRocLdap = IRocLDAP(host, bindDN, password)

    status = iRocLdap.linkButtonToUid(buttonID, uid)
Esempio n. 6
0
def main():

	parser = argparse.ArgumentParser()

	parser.add_argument('--uid', dest='uid', required=True)
	parser.add_argument('--name', dest='name', required=True)
	parser.add_argument('--address', dest='address', required=True)
	parser.add_argument('--alias', dest='alias', required=True)
	parser.add_argument('--econtact', dest='econtact', required=True)
	parser.add_argument('--status', dest='status', required=True)
	parser.add_argument('--level', dest='level', required=True)

	parser.add_argument('-v', dest='verbose', action='store_true')

	args = parser.parse_args()

	config = file('config.yaml', 'r')
	config = yaml.load(config)
	toolConfig = config['tool']

	host     = toolConfig['host']
	bindDN   = toolConfig['bindDN']
	password = toolConfig['password']


	uid      = args.uid
	name     = args.name
	address  = args.address
	alias    = args.alias
	econtact = args.econtact
	status   = args.status
	level    = args.level

	iRocLdap = IRocLDAP(host, bindDN, password)

	status = iRocLdap.addHacker( uid, name, address, alias, econtact, status, level )