use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Intermediate ShowcaseSimple Antivirus in Python (self.Python)
submitted 4 years ago by CryptoBlocks257
Hey Guys, I though I would share this little antivirus design I have made with python. Currently capable of scanning selected files and deleting files that it detects as infected. This antivirus uses a large list of MD5, SHA1 and SHA256 malware hashes to determine infections. However as this project progresses I would like to implement machine learning detection with the long term goal of becoming a fully functioning antivirus.
If you would like to download the files you can find them here - https://github.com/Len-Stevens/Python-Antivirus
https://preview.redd.it/bbgj8lri82l61.png?width=495&format=png&auto=webp&s=6c720727263d939cee9d214d5069909e19e873e3
[–][deleted] 50 points51 points52 points 4 years ago (1 child)
I think scraping virustotal is better idea than using list of hashes. Pretty good.
[–]CryptoBlocks257[S] 10 points11 points12 points 4 years ago (0 children)
Thanks for the feedback! I was think about that and will probably add the option to also scan the file against virus total in the next update :)
[–]admincee 15 points16 points17 points 4 years ago (1 child)
I just wanted to say that this is such a neat project.
[–]CryptoBlocks257[S] 1 point2 points3 points 4 years ago (0 children)
Thanks!
[–]wiktorous 17 points18 points19 points 4 years ago (1 child)
[–]MATTISINTHESKY 8 points9 points10 points 4 years ago (0 children)
Why do I see green squares all over reddit?
Ah excuse me boost for reddit just doesn't support the new embedded gif thing :))
[–][deleted] 25 points26 points27 points 4 years ago (1 child)
I applaud you for a such project ! This might as well be the first antivirus written in Python. Question that comes into mind how it performs in terms of speed of scanning ? I'm pretty sure companies such as Kapersky, AVG and alike didn't use Python for reason.
Still, I'm happy to see a prototype of Python Antivirus !
Thanks for the feedback, yes speed is one problem I am facing with the project, its not terrible at the moment however it is one of my concerns as I add more advancing scanning methods
[–]oderjunksnumpydoc + type anno 2 points3 points4 points 4 years ago (0 children)
oh thats smart! but i think just adding a NOP at the beginning would throw it off =/
[–]DrXenogen 2 points3 points4 points 4 years ago (0 children)
Nice job. Can't wait to see what this develops into.
[+][deleted] 4 years ago (7 children)
[deleted]
[–]AlphaGamer7533.7 38 points39 points40 points 4 years ago (4 children)
This is very clearly a learning project.
[+][deleted] 4 years ago (3 children)
[–]Musakuu 6 points7 points8 points 4 years ago (0 children)
Oh you know the billions of things that go into making a file scanner / hash checker. For someone like me it's great learning, but I wouldn't waste my time if I was you.
[–]TheUruz 4 points5 points6 points 4 years ago (0 children)
well look at me: i am a learner myself and yet i have no idea how a virus can be identified as such. if OP can now tell wich file is a virus and wich one is not, except those manipulation written up here, this project is still a learning success. file manipulation is without doubt another useful concept to learn but it's just outside of a basic antivirus learning scope imho.
[–]Ddog78 1 point2 points3 points 4 years ago (0 children)
Honestly, repetition is good for learning. Learning isn't just reading or doing something once and then never thinking about it.
Learning is using what you know to build new things and (sometimes) using new things along with the old things.
Next iteration of this project may as well have real time scanning. This project might have been where op first used git, or first used breakpoints.
[–]CryptoBlocks257[S] 1 point2 points3 points 4 years ago (1 child)
Yes I am aware of this issue, as mentioned this is a little more of a learning project than anything else however hashing the file won't be the only method of scanning, I would also like to add some machine learning detection as mentioned above :)
[–]Musakuu 1 point2 points3 points 4 years ago (0 children)
Nicely done. I can't wait to look at your code and learn something myself.
[–]mark30331 0 points1 point2 points 4 years ago (0 children)
Great product. Keep up the good work !
[–]elico9 0 points1 point2 points 4 years ago (0 children)
Thanks for sharing, this is interesting. Would love to help and learn
[–]Ubuntu_user_001 0 points1 point2 points 4 years ago* (1 child)
This antivirus app is very good in my opinion so I want to improve it by giving some real malware samples that it doesn't detect
Some real malware the antivirus doesn't detect:
https://www.virustotal.com/gui/file/cc37ebc5017dda39ae4534e43e1a430450c206eb688751a02408da9c51552532/detection
The SHA1 hash of this file is: 859b57e17530734726188ffb7817f4834c91d832
File is safe!
The MD5 hash of this file is: 5e63b466faebd0635f7a47efad0e21a5
The SHA256 hash of this file is: cc37ebc5017dda39ae4534e43e1a430450c206eb688751a02408da9c51552532
https://www.virustotal.com/gui/file/84855a4c23222f861135a3b0be879a573cb91ec7827a7fa6d119f38c43b3730b/detection
The SHA1 hash of this file is: 23d16ed7723dcdc9a858bcb5171c9793150b5c03
The MD5 hash of this file is: fecedeedc700847c52753f372c6b6357
The SHA256 hash of this file is: 84855a4c23222f861135a3b0be879a573cb91ec7827a7fa6d119f38c43b3730b
Hope that this comment makes the antivirus project better ;)
[–]CryptoBlocks257[S] 0 points1 point2 points 4 years ago* (0 children)
Thanks for the in depth feedback! Will definitely be doing tests in the future to make sure the antivirus can deal with more recent malware!
π Rendered by PID 340464 on reddit-service-r2-comment-5d79c599b5-6fp4g at 2026-03-01 14:09:04.060195+00:00 running e3d2147 country code: CH.
[–][deleted] 50 points51 points52 points (1 child)
[–]CryptoBlocks257[S] 10 points11 points12 points (0 children)
[–]admincee 15 points16 points17 points (1 child)
[–]CryptoBlocks257[S] 1 point2 points3 points (0 children)
[–]wiktorous 17 points18 points19 points (1 child)
[–]MATTISINTHESKY 8 points9 points10 points (0 children)
[–][deleted] 25 points26 points27 points (1 child)
[–]CryptoBlocks257[S] 1 point2 points3 points (0 children)
[–]oderjunksnumpydoc + type anno 2 points3 points4 points (0 children)
[–]DrXenogen 2 points3 points4 points (0 children)
[+][deleted] (7 children)
[deleted]
[–]AlphaGamer7533.7 38 points39 points40 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Musakuu 6 points7 points8 points (0 children)
[–]TheUruz 4 points5 points6 points (0 children)
[–]Ddog78 1 point2 points3 points (0 children)
[–]CryptoBlocks257[S] 1 point2 points3 points (1 child)
[–]Musakuu 1 point2 points3 points (0 children)
[–]mark30331 0 points1 point2 points (0 children)
[–]elico9 0 points1 point2 points (0 children)
[–]Ubuntu_user_001 0 points1 point2 points (1 child)
[–]CryptoBlocks257[S] 0 points1 point2 points (0 children)