-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
186 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2016-2017 Conix Cybersecurity | ||
# | ||
# This file is part of BTG. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
from BTG import BTG | ||
from lib.io import display | ||
from requests import get | ||
from re import findall | ||
import json | ||
import config | ||
from platform import system | ||
if system() != "Windows": | ||
import requests_cache | ||
requests_cache.install_cache('%sBTG'%config.sqlite_path) | ||
|
||
class Cuckoosandbox: | ||
""" | ||
This module allow you to search IOC in CuckooSandbox database | ||
""" | ||
def __init__(self, ioc, type): | ||
if config.cuckoosandbox_enabled: | ||
self.module_name = __name__.split(".")[1] | ||
self.types = [ | ||
"MD5", "SHA256" | ||
] | ||
self.search_method = "Online" | ||
self.description = "Search IOC in CuckooSandbox database" | ||
self.author = "Conix" | ||
self.creation_date = "02-03-2017" | ||
self.type = type | ||
self.ioc = ioc | ||
if type in self.types: | ||
self.search() | ||
|
||
def search(self): | ||
display(self.module_name, self.ioc, "INFO", "Searching...") | ||
if BTG.allowedToSearch(self.search_method): | ||
if self.type in ["MD5"]: | ||
url = "%s/files/view/md5/%s"%(config.cuckoosandbox_API_url, self.ioc) | ||
elif self.type in ["SHA256"]: | ||
url = "%s/files/view/sha256/%s"%(config.cuckoosandbox_API_url, self.ioc) | ||
page = get( | ||
url, | ||
headers=config.user_agent, | ||
proxies=config.proxy_host, | ||
timeout=config.requests_timeout | ||
).text | ||
if not "Error: 404 Not Found" in page: | ||
id_analysis = json.loads(page)["sample"]["id"] | ||
display("%s_remote"%self.module_name, self.ioc, "FOUND", "%s/view/%s"%(config.cuckoosandbox_WEB_url, id_analysis)) | ||
#except: | ||
# display("%s"%self.module_name, self.ioc, "INFO", "MalekalTimeout") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2016-2017 Conix Cybersecurity | ||
# | ||
# This file is part of BTG. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
import config | ||
from lib.cache import Cache | ||
from lib.io import display | ||
|
||
class Vxvault: | ||
def __init__(self, ioc, type): | ||
if config.vxvault_enabled: | ||
self.module_name = __name__.split(".")[1] | ||
self.types = ["IPv4", "domain", "URL"] | ||
self.search_method = "Offline" | ||
self.description = "Search domain in Dshield feeds" | ||
self.author = "Conix" | ||
self.creation_date = "15-09-2016" | ||
self.type = type | ||
self.ioc = ioc | ||
if type in self.types: | ||
self.search() | ||
|
||
def search(self): | ||
display(self.module_name, self.ioc, "INFO", "Searching...") | ||
url = "http://vxvault.net/" | ||
paths = [ | ||
"URL_List.php" | ||
] | ||
for path in paths: | ||
content = Cache(self.module_name, url, path, self.search_method).content | ||
for line in content.split("\n"): | ||
if self.ioc in line: | ||
display(self.module_name, self.ioc, "FOUND", "%s%s"%(url, path)) | ||
return |