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

memory space check #64

Merged
merged 1 commit into from
Oct 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in

### Human Interaction [Anti-Sandbox]
- Mouse movement
- Total Physical memory (GlobalMemoryStatusEx)
- Mouse (Single click / Double click) (todo)
- DialogBox (todo)
- Scrolling (todo)
Expand Down
1 change: 1 addition & 0 deletions al-khaser/Al-khaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int main(void)
exec_check(&disk_size_wmi, TEXT("Checking hard disk size using WMI: "));
exec_check(&setupdi_diskdrive, TEXT("Checking SetupDi_diskdrive: "));
exec_check(&mouse_movement, TEXT("Checking mouse movement: "));
exec_check(&memory_space, TEXT("Checking memory space using GlobalMemoryStatusEx: "));

///* VirtualBox Detection */
print_category(TEXT("VirtualBox Detection"));
Expand Down
16 changes: 16 additions & 0 deletions al-khaser/Anti VM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,20 @@ BOOL mouse_movement() {

else
return FALSE;
}

/*
Check if the machine have enough memory space, usually VM get a small ammount,
one reason if because several VMs are running on the same servers so they can run
more tasks at the same time.
*/
BOOL memory_space()
{
DWORDLONG ullMinRam = (1024LL * (1024LL * (1024LL * 1LL))); // 1GB
MEMORYSTATUSEX statex = {0};

statex.dwLength = sizeof(statex);
GlobalMemoryStatusEx(&statex);

return (statex.ullTotalPhys < ullMinRam) ? TRUE : FALSE;
}
3 changes: 2 additions & 1 deletion al-khaser/Anti VM/Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ BOOL str_trick();
BOOL number_cores_wmi();
BOOL disk_size_wmi();
BOOL setupdi_diskdrive();
BOOL mouse_movement();
BOOL mouse_movement();
BOOL memory_space();