示例#1
0
                             token=token)
        print "Uploaded to %s" % uploaded

    elif flags.FLAGS.subparser_name == "upload_artifact":
        json.load(open(flags.FLAGS.file, "rb"))  # Check it will parse.
        base_urn = aff4.ROOT_URN.Add("artifact_store")
        try:
            artifact.UploadArtifactYamlFile(
                open(flags.FLAGS.file, "rb").read(1000000),
                base_urn=base_urn,
                token=None,
                overwrite=flags.FLAGS.overwrite_artifact)
        except artifact_registry.ArtifactDefinitionError as e:
            print "Error %s. You may need to set --overwrite_artifact." % e

    elif flags.FLAGS.subparser_name == "delete_artifacts":
        artifact_list = flags.FLAGS.artifact
        if not artifact_list:
            raise ValueError("No artifact to delete given.")
        artifact.DeleteArtifactsFromDatastore(artifact_list, token=token)
        print "Artifacts %s deleted." % artifact_list

    elif flags.FLAGS.subparser_name == "download_missing_rekall_profiles":
        print "Downloading missing Rekall profiles."
        s = rekall_profile_server.GRRRekallProfileServer()
        s.GetMissingProfiles()


if __name__ == "__main__":
    flags.StartMain(main)
示例#2
0
 def setUp(self):
   self.server = rekall_profile_server.GRRRekallProfileServer()
   super(ProfileServerTest, self).setUp()