Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven committed Sep 28, 2024
1 parent 301a4c8 commit a7057f2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
35 changes: 20 additions & 15 deletions modules/auxiliary/AzSniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@
import subprocess
from urllib.parse import urlparse

try:
from azure.core.exceptions import AzureError
from azure.identity import ClientSecretCredential
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.network.models import PacketCapture, PacketCaptureStorageLocation
from azure.mgmt.storage import StorageManagementClient
from azure.storage.blob import BlobServiceClient

HAVE_AZURE = True
except ImportError:
HAVE_AZURE = False
print("Missing machinery-required libraries.")
print(
"poetry run python -m pip install azure-identity msrest msrestazure azure-mgmt-compute azure-mgmt-network azure-mgmt-storage azure-storage-blob"
)
from lib.cuckoo.common.config import Config

HAVE_AZURE = False
cfg = Config()
if cfg.cuckoo.machinery == "az":
try:
from azure.core.exceptions import AzureError
from azure.identity import ClientSecretCredential
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.network.models import PacketCapture, PacketCaptureStorageLocation
from azure.mgmt.storage import StorageManagementClient
from azure.storage.blob import BlobServiceClient

HAVE_AZURE = True
except ImportError:
HAVE_AZURE = False
print("Missing machinery-required libraries.")
print(
"poetry run python -m pip install azure-identity msrest msrestazure azure-mgmt-compute azure-mgmt-network azure-mgmt-storage azure-storage-blob"
)

from lib.cuckoo.common.abstracts import Auxiliary
from lib.cuckoo.common.config import Config
Expand Down
3 changes: 2 additions & 1 deletion modules/machinery/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
from lib.cuckoo.core.database import Machine

cfg = Config()
HAVE_BOTO3 = False
if cfg.cuckoo.machinery == "aws":
try:
import boto3

HAVE_BOTO3 = True
except ImportError:
sys.exit("Missed boto3 dependency: poetry run pip install boto3")
HAVE_BOTO3 = False


from lib.cuckoo.common.abstracts import Machinery
from lib.cuckoo.common.config import Config
Expand Down
3 changes: 2 additions & 1 deletion modules/machinery/az.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from lib.cuckoo.common.config import Config

HAVE_AZURE = False
cfg = Config()
if cfg.cuckoo.machinery == "az":
try:
Expand All @@ -23,7 +24,7 @@

HAVE_AZURE = True
except ImportError:
HAVE_AZURE = False

print("Missing machinery-required libraries.")
print("poetry run pip install azure-identity msrest msrestazure azure-mgmt-compute azure-mgmt-network")

Expand Down

0 comments on commit a7057f2

Please sign in to comment.