Can I get a virus by visiting an unknown website using python's requests package?

1.6k views Asked by At

I'm visiting an unknown and possibly malicious website. Lots of them. Python's requests do not run javascript. Can I get infected? Should I consider using a virtual machine?

1

There are 1 answers

4
Martijn Pieters On BEST ANSWER

No, merely downloading HTTP data won't install a virus.

A virus needs to be activated too, and requests doesn't do anything with the downloaded data for that to happen. Normally, a virus uses bugs in the browser (or more commonly, a plugin in the browser) to trigger code execution, or by tricking the user into executing the downloaded file. For example, bugs in the Flash player executing a Flash file could be used to run arbitrary code, or the user is tricked into believing they downloaded a document but it is really an executable program.