mirror of
https://github.com/a0rtega/pafish
synced 2024-11-21 22:01:56 +03:00
Merge pull request #16 from Thorsten-Sick/vbox_tools
scanning for VirtualBox tools
This commit is contained in:
commit
05859e7db5
@ -1,5 +1,5 @@
|
||||
CC = i686-pc-mingw32-gcc
|
||||
WINDRES = i686-pc-mingw32-windres
|
||||
CC = i686-w64-mingw32-gcc
|
||||
WINDRES = i686-w64-mingw32-windres
|
||||
OBJDIR = Objects/MingW
|
||||
SRC = $(wildcard *.c)
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/pafish_private.res
|
||||
@ -18,7 +18,7 @@ else
|
||||
RM = rm -f
|
||||
FixPath = $1
|
||||
endif
|
||||
LINK = i686-pc-mingw32-g++
|
||||
LINK = i686-w64-mingw32-g++
|
||||
|
||||
.PHONY: all all-before all-after clean clean-custom
|
||||
all: all-before $(BIN) all-after
|
||||
|
@ -289,7 +289,14 @@ int main(int argc, char *argv[])
|
||||
else {
|
||||
print_not_traced();
|
||||
}
|
||||
|
||||
|
||||
printf("[*] Looking for guest tools ");
|
||||
if (vbox_guest_tools() == 0) {
|
||||
}
|
||||
else {
|
||||
print_not_traced();
|
||||
}
|
||||
|
||||
/* VMware detection tricks */
|
||||
printf("\n[-] VMware detection\n");
|
||||
printf("[*] Scsi port->bus->target id->logical unit id-> 0 identifier ... ");
|
||||
|
@ -555,3 +555,42 @@ int vbox_processes() {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking for the VBoxControl and other vbox tools
|
||||
**/
|
||||
int vbox_guest_tools() {
|
||||
int res=1;
|
||||
HANDLE h;
|
||||
|
||||
h = CreateFile("c:\\windows\\system32\\VBoxControl.exe", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (h != INVALID_HANDLE_VALUE){
|
||||
write_log("VirtualBox VBoxControl.exe detected");
|
||||
print_traced();
|
||||
write_trace("hi_virtualbox");
|
||||
res = 0;
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
h = CreateFile("c:\\program files\\oracle\\virtualbox guest additions\\VBoxDrvInst.exe", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (h != INVALID_HANDLE_VALUE){
|
||||
write_log("VirtualBox VBoxDrvInst.exe detected");
|
||||
print_traced();
|
||||
write_trace("hi_virtualbox");
|
||||
res = 0;
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
h = CreateFile("c:\\program files\\oracle\\virtualbox guest additions\\VBoxWHQLFake.exe", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (h != INVALID_HANDLE_VALUE){
|
||||
write_log("VirtualBox VBoxWHQLFake.exe detected");
|
||||
print_traced();
|
||||
write_trace("hi_virtualbox");
|
||||
res = 0;
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,4 +36,6 @@ int vbox_network_share();
|
||||
|
||||
int vbox_processes();
|
||||
|
||||
int vbox_guest_tools();
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user