You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message=f"{vm_name} may be connected to the internet on adapter(s): {nic}. Please double check your VMs settings."
82
98
else:
83
-
message=f"{vm_name} may be connected to the internet on adapter(s): {nic}. The network adapter(s) have been disabled automatically to prevent an undesired internet connectivity. Please double check your VMs settings."
99
+
message= (
100
+
f"{vm_name} may be connected to the internet on adapter(s): {nic}."
101
+
"The network adapter(s) have been disabled automatically to prevent an undesired internet connectivity."
102
+
"Please double check your VMs settings."
103
+
)
84
104
# different commands are necessary if the machine is running.
message=f"{vm_name} may be connected to the internet on adapter(s): {invalid_nics_msg}. Please double check your VMs settings."
108
128
else:
109
-
message=f"{vm_name} may be connected to the internet on adapter(s): {invalid_nics_msg}. The network adapter(s) have been disabled automatically to prevent an undesired internet connectivity. Please double check your VMs settings."
129
+
message= (
130
+
f"{vm_name} may be connected to the internet on adapter(s): {invalid_nics_msg}."
131
+
"The network adapter(s) have been disabled automatically to prevent an undesired internet connectivity."
132
+
"Please double check your VMs settings."
133
+
)
110
134
111
135
# Show notification using PyGObject
112
136
Notify.init("VirtualBox adapter check")
@@ -128,19 +152,9 @@ def main(argv=None):
128
152
ifargvisNone:
129
153
argv=sys.argv[1:]
130
154
131
-
epilog=textwrap.dedent(
132
-
f"""
133
-
Example usage:
134
-
# Print status of all internet adapters and disable the adapters with internet access in VMs with {DYNAMIC_VM_NAME} in the name
135
-
vbox-adapter-check.vm
136
-
137
-
# Print status of all internet adapters without modifying any of them
138
-
vbox-adapter-check.vm --do_not_modify
139
-
"""
140
-
)
141
155
parser=argparse.ArgumentParser(
142
-
description=f"Print the status of all internet adapters of all VMs in VirtualBox. Notify if any VM with {DYNAMIC_VM_NAME} in the name has an adapter whose type is not allowed (internet access is undesirable for dynamic malware analysis)i. Optionally change the type of the adapters with non-allowed type to Host-Only.",
# Delete the 'CLEAN with IDA 8.4' children snapshots recursively skipping the ones that include 'clean' or 'done' in the name (case insensitive) in the 'FLARE-VM.20240604' VM
125
-
# NOTE: the 'CLEAN with IDA 8.4' root snapshot is skipped in this case
126
-
vbox-clean-snapshots.py FLARE-VM.20240604 --root_snapshot CLEAN with IDA 8.4
127
-
128
-
# Delete the 'Snapshot 3' snapshot and its children recursively skipping the ones that include 'clean' or 'done' in the name (case insensitive) in the 'FLARE-VM.20240604' VM
parser.add_argument("vm_name", help="Name of the VM to clean up")
141
145
parser.add_argument(
142
146
"--root_snapshot",
143
-
help="Snapshot name (case sensitive) to delete (and its children recursively). Leave empty to clean all snapshots in the VM.",
147
+
help="""Snapshot name (case sensitive) to delete (and its children recursively).
148
+
Leave empty to clean all snapshots in the VM.""",
144
149
)
145
150
parser.add_argument(
146
151
"--protected_snapshots",
147
152
default="clean,done",
148
153
type=lambdas: s.split(","),
149
-
help='Comma-separated list of strings. Snapshots with any of the strings included in the name (case insensitive) are not deleted. Default: "clean,done"',
154
+
help='''Comma-separated list of strings.
155
+
Snapshots with any of the strings included in the name (case insensitive) are not deleted.
DESCRIPTION="Export one or more snapshots in the same VirtualBox VM as .ova, changing the network to a single Host-Only interface. Generate a file with the SHA256 of the exported OVA(s)."
29
+
DESCRIPTION="""Export one or more snapshots in the same VirtualBox VM as .ova, changing the network to a single Host-Only interface.
30
+
Generate a file with the SHA256 of the exported OVA(s)."""
29
31
30
32
EPILOG=textwrap.dedent(
31
33
"""
@@ -201,20 +203,18 @@ def main(argv=None):
201
203
)
202
204
parser.add_argument(
203
205
"config_path",
204
-
help=textwrap.dedent(
205
-
"""
206
-
path of the JSON configuration file.
206
+
help=""" path of the JSON configuration file.
207
207
"VM_NAME" is the name of the VM to export snapshots from.
208
208
Example: "FLARE-VM.testing".
209
209
"EXPORTED_VM_NAME" is the name of the exported VMs.
210
210
Example: "FLARE-VM".
211
-
"SNAPSHOTS" is a list of lists with information of the snapshots to export: ["SNAPSHOT_NAME", "EXPORTED_VM_EXTENSION", "DESCRIPTION"].
211
+
"SNAPSHOTS" is a list of lists with information of the snapshots to export:
0 commit comments