![]() |
|
[The Brotherhood] Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Whitehat • Blue Team • Defensive Security (https://hackforums.net/forumdisplay.php?fid=448) +---- Forum: Pentesting and Forensics (https://hackforums.net/forumdisplay.php?fid=231) +---- Thread: [The Brotherhood] Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code (/showthread.php?tid=6270251) |
Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Hackers - May 4, 2024 ![]() Hello, today I will be showing you a prototype script I wrote that can fetch the details about your computer's anti-virus. This is good for making sure your software is up to date, and to verify that you are protected. Interested in more of this content? Thank Fallen members! We are using Python today, with the win32com package to interact with lower level Windows functions. Code import win32com.clientWe use COM on Windows, in combo with the WMI service. This allows us to execute basic SQL queries to find more information. Code SELECT * FROM AntivirusProductOnce we get the results, we must loop through them to analyze. We can get the display name, product state (enabled/disabled), and other information. Code for objItem in colItems:The values are represented with hex values, which can obviously be interpreted in binary or other types too. For hex, we can extract certain values to know if it is enabled or not. For example, Windows defender may have a state of "060100". This is also represented as "0x60100" You can get the "middle number", which would be "01" - as in there is "06 on the left" and "00 on the right" - if this middle number = "10" then it is enabled, and if not, it is disabled. - for Windows Defender in this case of 060100, the "01" means it is disabled. When we look at my computer, AVG is set to "041000" or "0x41000". This is "04 on left" and "00 on right", which is "10" in the middle for enabled. Code Antivirus Name: Windows DefenderLastly, we can use the last 2 numbers of t he hex value to see if it's up to date or not. If the last 2 digits are "00" this means it is updated already to latest available version, for your OS. For example "060100" ends in "00" and so does "041000" so we know that both AV options are updated on my current machine. Full Source Code: Code import win32com.clientRE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Ya_Sanya__ - May 18, 2024 Thank you, is it working for all antiviruses? RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Hackers - May 20, 2024 (May 18, 2024 12:53 PM)Ya_Sanya__ Wrote: Thank you, is it working for all antiviruses? It should be using the same formatting for statuses, so as long as it's either a minifilter or another registered product for Windows, it should show up with info. RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - 7 - May 31, 2024 Very nice. This could also be very useful for adding the right exceptions to an AV once the correct AV is detected, could it not? RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Hackers - May 31, 2024 (May 31, 2024 06:42 AM)NulldB Wrote: Very nice. Yep, exactly, if you need your personal programs to respond differently based on the AV / to support different types of features then you can do that. RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - obtainhigh - Jul 4, 2024 needed some debugging to perfect it. Working code: PHP Code RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - riesax - Jul 23, 2024 Thanks a lot. Learns a lot from these kind of things! Would love to be as good RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - Hackers - Nov 19, 2024 (Jul 4, 2024 03:06 AM)obtainhigh Wrote: needed some debugging to perfect it. Thanks, I really appreciate the effort! (Jul 23, 2024 01:30 AM)riesax Wrote: Thanks a lot. Learns a lot from these kind of things! Would love to be as good I'm still learning myself!! How's it going on your side & do you have any questions? BUMP - Stanley - Mar 16, 2026 I'm Stanley HF's helper bot. The OP (original poster) of this thread wants everyone to see this page and has elected to bump it to the top of the showthread listing. Since HF doesn't want a ton of LQP (Low Quality Posts) this is the best method of bumping your content. There is a small βyte fee for each bump. Any OP can bump any of their threads on HF from the linked icon on the top of their first post. If you haven't already read the first post of this thread we encourage you to do so. Thanks, Stanley RE: Detecting Enabled Anti-Virus | Windows COM | WMI Query | Python Source Code - yigliman - Mar 30, 2026 I'd like to know how to obfuscate my .exe file or how to make it undetectable by antivirus software. |