Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

troubleshooting help #1

Open
Nwinternights opened this issue Apr 9, 2016 · 0 comments
Open

troubleshooting help #1

Nwinternights opened this issue Apr 9, 2016 · 0 comments

Comments

@Nwinternights
Copy link

Hello, I followed the guide you wrote but I can't make it works properly. I edited the yaragen.py with my environments but still no luck.
the report is always empty (ERROR :-( File not found).
here is my conf
import os
import stat
import logging
import subprocess
import shlex

from lib.cuckoo.common.abstracts import Auxiliary
from lib.cuckoo.common.config import Config
from lib.cuckoo.common.objects import File

log = logging.getLogger(name)

class YaraGen(Auxiliary):
def start(self):

if "yaragen" not in self.task.options:

return

    genstart = self.options.get("yarGen.py", "/home/socadmin/yarGen/yarGen.py")



    if not os.path.exists(genstart):
        log.error("yarGen doesnt exist at \"%s\", yarGen "
                  "disabled", genstart)
        return


    try:
        mal_path = os.path.dirname(os.path.abspath(self.task.target))
        mdma5 = File(self.task.target).get_md5()
        blat_id = str(self.task.id)




        #file_str = "/home/socadmin/cuckoo-modified/storage/analyses/%s/reports/%s.yara" % (blat_id , mdma5)
        file_str  = "/home/socadmin/cuckoo-modified/storage/analyses/%s/reports/report.yara" % (blat_id)
        dir_path  = os.path.dirname(file_str)

        try:
            os.stat(dir_path)
        except:
            os.makedirs(dir_path)       




        os.chdir("/home/socadmin/yarGen/")

cmd_str = "python yarGen.py -m %s -o /home/socadmin/cuckoo-modified/storage/analysis/%s/reports/%s.yara -noop" % (mal_path, blat_id , mdma5)

        cmd_str = "python yarGen.py -m %s -o %s -noop" % (mal_path, file_str)
        cmd_args = shlex.split(cmd_str)
        subprocess.Popen(cmd_args)

cmd_str = "cd /home/socadmin/yarGen/ && python yarGen.py -m %s -o /home/socadmin/yarGen/this_should_be_changed.yara -noop" % (mal_path)

os.system(cmd_str)

cmd_args = shlex.split(cmd_str)

self.proc = subprocess.Popen(cmd_args , shell=True)

subprocess.call(pargs)

    except (OSError, ValueError):
        log.exception("Failed to start yarGen for %s", str(self.task.target))
        return

    log.info("Started yarGen for %s", str(self.task.target))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant