Exemple #1
0
        os.path.join("osrframework", "transforms", "uriToPort.py"),
        os.path.join("osrframework", "transforms", "uriToProtocol.py"),
    ] 
}

# Iterating through all destinations to write the info
for destiny in files_to_copy.keys():

    # Grabbing each source file to be moved
    for sourceFile in files_to_copy[destiny]:
        fileToMove = os.path.join(HERE,sourceFile)

        # Choosing the command depending on the SO
        if sys.platform == 'win32':
            cmd = "copy \"" + fileToMove + "\" \"" + destiny + "\""
        elif sys.platform == 'linux2' or sys.platform == 'darwin':   
            cmd = "sudo cp \"" + fileToMove + "\" \"" + destiny + "\""
        #print cmd
        output = os.popen(cmd).read()    

print    
print "Last part: trying to configure Maltego Transforms..."            
# Creating the configuration file
try:
    import osrframework.transforms.lib.configure_maltego as maltego
    maltego.configureMaltego(transformsConfigFolder = applicationPathTransforms, base=os.path.join(HERE,"osrframework/transforms/lib/osrframework-maltego-settings"), debug = False, backupPath = applicationPathDefaults)
except Exception, e:
    print "WARNING. The Maltego configuration file to use i3visio transforms could not be created and thus, cannot be used. Check the following error:"
    print str(e)
print
Exemple #2
0
# Iterating through all destinations to write the info
for destiny in files_to_copy.keys():
    # Grabbing each source file to be moved
    for sourceFile in files_to_copy[destiny]:
        fileToMove = os.path.join(HERE,sourceFile)

        # Choosing the command depending on the SO
        if sys.platform == 'win32':
            if os.path.isdir(fileToMove):
                cmd = "echo d | xcopy \"" + fileToMove + "\" \"" + destiny + "\" /s /e"
            else:
                cmd = "copy \"" + fileToMove + "\" \"" + destiny + "\""
        elif sys.platform == 'linux2' or sys.platform == 'darwin':
            if not os.geteuid() == 0:
                cmd = "cp \"" + fileToMove + "\" \"" + destiny + "\" -r"
            else:
                cmd = "sudo cp \"" + fileToMove + "\" \"" + destiny + "\" -r"
        #print cmd
        output = os.popen(cmd).read()

print
print "[*] Last part: trying to configure Maltego Transforms..."
# Creating the configuration file
try:
    import osrframework.transforms.lib.configure_maltego as maltego
    maltego.configureMaltego(transformsConfigFolder=paths["appPathTransforms"], base=os.path.join(HERE,"osrframework/transforms/lib/osrframework-maltego-settings"), debug=False, backupPath=paths["appPathDefaults"])
except Exception, e:
    print "[!] The Maltego configuration file to use i3visio transforms could not be created and thus, cannot be used. Check the following error:"
    print str(e)
print