Skip to content

Commit 96f2275

Browse files
authored
Merge pull request #100 from NotRequiem/main
Removed USB_DRIVE technique
2 parents da135bb + ade88dc commit 96f2275

2 files changed

Lines changed: 2 additions & 33 deletions

File tree

src/cli.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ void general(const bool enable_hyperv = true) {
278278
checker(VM::HYPERV_CPUID, "Hyper-V CPUID");
279279
checker(VM::CUCKOO_DIR, "Cuckoo directory");
280280
checker(VM::CUCKOO_PIPE, "Cuckoo pipe");
281-
checker(VM::USB_DRIVE, "USB drive absence");
282281
checker(VM::HYPERV_HOSTNAME, "Hyper-V Azure hostname");
283282
checker(VM::GENERAL_HOSTNAME, "general VM hostnames");
284283
checker(VM::SCREEN_RESOLUTION, "screen resolution");
@@ -505,4 +504,4 @@ Cuckoo
505504
}
506505

507506
return 0;
508-
}
507+
}

src/vmaware.hpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ struct VM {
393393
HYPERV_CPUID,
394394
CUCKOO_DIR,
395395
CUCKOO_PIPE,
396-
USB_DRIVE,
397396
HYPERV_HOSTNAME,
398397
GENERAL_HOSTNAME,
399398
SCREEN_RESOLUTION,
@@ -7609,34 +7608,6 @@ struct VM {
76097608
}
76107609

76117610

7612-
/**
7613-
* @brief Check for presence of USB drive
7614-
* @category Windows
7615-
* @author Thomas Roccia (fr0gger)
7616-
* @link https://unprotect.it/technique/detecting-usb-drive/
7617-
* @copyright MIT
7618-
*/
7619-
[[nodiscard]] static bool usb_drive() try {
7620-
#if (!MSVC)
7621-
return false;
7622-
#else
7623-
UINT drives = GetLogicalDrives();
7624-
7625-
for (int i = 0; i < 26; i++) {
7626-
if ((drives & (1 << i)) && GetDriveTypeA((char)('A' + i) + ":\\") == DRIVE_REMOVABLE) {
7627-
debug("USB drive detected: ", 'A' + i, ", returning false");
7628-
return false;
7629-
}
7630-
}
7631-
7632-
// at this point, no drives have been detected
7633-
return true;
7634-
#endif
7635-
}
7636-
catch (...) {
7637-
debug("USB_DRIVE: caught error, returned false");
7638-
return false;
7639-
}
76407611

76417612

76427613
/**
@@ -8800,7 +8771,6 @@ const std::map<VM::u8, VM::core::technique> VM::core::technique_table = {
88008771
{ VM::HYPERV_CPUID, { 35, VM::hyperv_cpuid }},
88018772
{ VM::CUCKOO_DIR, { 15, VM::cuckoo_dir }},
88028773
{ VM::CUCKOO_PIPE, { 20, VM::cuckoo_pipe }},
8803-
{ VM::USB_DRIVE, { 30, VM::usb_drive }},
88048774
{ VM::HYPERV_HOSTNAME, { 50, VM::hyperv_hostname }},
88058775
{ VM::GENERAL_HOSTNAME, { 20, VM::general_hostname }},
88068776
{ VM::SCREEN_RESOLUTION, { 30, VM::screen_resolution }},
@@ -8809,4 +8779,4 @@ const std::map<VM::u8, VM::core::technique> VM::core::technique_table = {
88098779
// __TABLE_LABEL, add your technique above
88108780
// { VM::FUNCTION, { POINTS, FUNCTION_POINTER }}
88118781
// ^ template
8812-
};
8782+
};

0 commit comments

Comments
 (0)