mohd-tanveer / Malware-detection-using-Machine-Learning-Algorithms

Current antivirus software’s are effective against known viruses, if a malware with new signature is introduced then it will be difficult to detect that it is malicious. Signature-based detection is not that effective during zero-day attacks. Till the signature is created for new (unseen) malware, distributed to the systems and added to the anti-malware database, the systems can be exploited by that malware. But Machine learning methods can be used to create more effective antimalware software which is capable of detecting previously unknown malware, zero-day attack etc. We propose an approach that learns from the header data of PE32 files. We examine various features of the PE32 header and check those which are suitable for machine learning classifier. We hypothesize that machine learning classifiers can tell apart the difference between malware and benign software. Various machine learning methods such as Support Vector Machine (SVM), Decision tree, Logistic Regression and Naive Bayes will be used
5 stars 0 forks source link

Bug sklearn.ensemble.forest to sklearn.ensemble._forest #1

Open MandiYang opened 3 years ago

MandiYang commented 3 years ago

Traceback (most recent call last): File "/home/mandi/Downloads/Malware-detection-using-Machine-Learning-Algorithms-main/home_window.py", line 116, in scanMethod pred=classify(0,self.file) File "/home/mandi/Downloads/Malware-detection-using-Machine-Learning-Algorithms-main/one.py", line 68, in classify pred=classifier(df) File "/home/mandi/Downloads/Malware-detection-using-Machine-Learning-Algorithms-main/classifier.py", line 20, in classifier classifier= cPickle.load(fid) ModuleNotFoundError: No module named 'sklearn.ensemble.forest'

No module named sklearn.ensemble.forest, solution to the problem it's to use the sklearn.ensemble._forest module instead.

mohd-tanveer commented 3 years ago

you are missing the library can you please check on that

MandiYang commented 3 years ago

I installed scikit-learn and there is no module named sklearn.ensemble.forest but a module named sklearn.ensemble._forest so use that module instead. Tell me what library I am missing.

mohd-tanveer commented 3 years ago

Not sure what exactly you are missing but it is working fine in my machine

rithuaugustine commented 2 years ago

Hi I am facing the same issue. Did you resolve it @MandiYang ? and Could you tell me which version of python did you use @mohd-tanveer ?

mohd-tanveer commented 2 years ago

I used python 3, pandas, scikt-learn,numpy

MandiYang commented 2 years ago

https://stackoverflow.com/questions/65758102/no-module-name-sklearn-ensemble-forest

sklearn.ensemble.forest was renamed to sklearn.ensemble._forest in 437ca05 on Oct 16, 2019. You need to install an older sklearn. Try version 0.21.3 released on Jul 30, 2019:

pip install -U scikit-learn==0.21.3

Please be warned that the authors provided wheels up to Python 3.7. For 3.8 or 3.9 you will need to compile from sources.

suryaingithub commented 2 years ago

['E:/C and C++ Projects/Hello World.c'] file selected [['E:/C and C++ Projects/Hello World.c']] []

[['E:/C and C++ Projects/Hello World.c']]

in for loop c.dlroW olleH/stcejorP ++C dna C/:E Hello World.c

['Hello World.c'] [['E:/C and C++ Projects/Hello World.c']] ['Name', 'NumberOfSections', 'TimeDateStamp', 'PointerToSymbolTable', 'NumberOfSymbols', 'Characteristics', 'AddressOfEntryPoint', 'BaseOfCode', 'BaseOfData', 'CheckSum', 'DllCharacteristics', 'FileAlignment', 'ImageBase', 'MajorImageVersion', 'MajorLinkerVersion', 'MajorOperatingSystemVersion', 'MajorSubsystemVersion', 'MinorImageVersion', 'MinorLinkerVersion', 'MinorOperatingSystemVersion', 'MinorSubsystemVersion', 'NumberOfRvaAndSizes', 'SectionAlignment', 'SizeOfCode', 'SizeOfHeaders', 'SizeOfHeapReserve', 'ImageBase', 'SizeOfInitializedData', 'SizeOfStackCommit', 'SizeOfStackReserve', 'SizeOfUninitializedData', 'Subsystem', 'e_cparhdr', 'e_lfarlc', 'e_oeminfo', 'e_maxalloc', 'e_ip', 'e_lfanew', 'e_csum', 'e_ovno', 'e_minalloc', 'e_cp', 'e_cblp', 'e_sp', 'IMAGE_FILE_RELOCS_STRIPPED', 'IMAGE_FILE_LINE_NUMS_STRIPPED', 'IMAGE_FILE_LOCAL_SYMS_STRIPPED', 'IMAGE_FILE_BYTES_REVERSED_LO', 'IMAGE_FILE_DEBUG_STRIPPED', 'IMAGE_FILE_DLL', 'IMAGE_FILE_BYTES_REVERSED_HI', 'mal']

could not extract features

[Done] exited with code=3221226505 in 113.018 seconds

What does this mean???

MandiYang commented 1 year ago

@suryaingithub

['E:/C and C++ Projects/Hello World.c'] file selected [['E:/C and C++ Projects/Hello World.c']] []

[['E:/C and C++ Projects/Hello World.c']]

in for loop c.dlroW olleH/stcejorP ++C dna C/:E Hello World.c

['Hello World.c'] [['E:/C and C++ Projects/Hello World.c']] ['Name', 'NumberOfSections', 'TimeDateStamp', 'PointerToSymbolTable', 'NumberOfSymbols', 'Characteristics', 'AddressOfEntryPoint', 'BaseOfCode', 'BaseOfData', 'CheckSum', 'DllCharacteristics', 'FileAlignment', 'ImageBase', 'MajorImageVersion', 'MajorLinkerVersion', 'MajorOperatingSystemVersion', 'MajorSubsystemVersion', 'MinorImageVersion', 'MinorLinkerVersion', 'MinorOperatingSystemVersion', 'MinorSubsystemVersion', 'NumberOfRvaAndSizes', 'SectionAlignment', 'SizeOfCode', 'SizeOfHeaders', 'SizeOfHeapReserve', 'ImageBase', 'SizeOfInitializedData', 'SizeOfStackCommit', 'SizeOfStackReserve', 'SizeOfUninitializedData', 'Subsystem', 'e_cparhdr', 'e_lfarlc', 'e_oeminfo', 'e_maxalloc', 'e_ip', 'e_lfanew', 'e_csum', 'e_ovno', 'e_minalloc', 'e_cp', 'e_cblp', 'e_sp', 'IMAGE_FILE_RELOCS_STRIPPED', 'IMAGE_FILE_LINE_NUMS_STRIPPED', 'IMAGE_FILE_LOCAL_SYMS_STRIPPED', 'IMAGE_FILE_BYTES_REVERSED_LO', 'IMAGE_FILE_DEBUG_STRIPPED', 'IMAGE_FILE_DLL', 'IMAGE_FILE_BYTES_REVERSED_HI', 'mal']

could not extract features

[Done] exited with code=3221226505 in 113.018 seconds

What does this mean???

How is this relevant to the issue???