Making Simple Spyware to steal Chrome passwords

Ali Pardhan
Aug 7 · 5 min read

chromePasswordThieve is an easy to develop program that is so elementary, that it evades anti virus

We start by creating a file called chromePasswordThieve.py with the following imports and constants

Be sure to change FROM PASSWORD TO to your desired values

Now that we have our basic setup out of the way, we can get started

we begin by creating two functions getPass() and sendEmail()

We will base our get pass functions from @darkarp

Using sqlite3 and win32crypt.CryptUnprotectData to select user data from the database. if you are wondering why to is so easy, you can read this, the inner workings of this function be read here.

We modify lines 145-196 to create the body of our getPass()

Next from stackoverflow.com we figure out how to send an email with attachments

The code I ended up with is:

Finally we call our two functions

The code works as expected

Website: https://www.facebook.com/login/device-based/regular/login/
User/email:
email@live.ca
Password: b’password’

Website: https://www.investopedia.com/accounts/login.aspx
User/email:
email@gmail.com
Password: b’password’

Website: https://portal.aws.amazon.com/billing/signup
User/email: alik604
Password: b’password’

Now let’s attempt to do above and beyond.

Not all people will click the ‘save password’ in chrome, perhaps they have a password manager … lets deal with that

In order for this to be of benefit, our code will need to run a second time in the future. Including this code is of marginal cost to use, so we might as well

we set our path variable to their corresponding chrome extension folders. we get the extension id with the following

To run this script we would either need to have python installed on the target computer, or convert to an executable

@lpoblet Has a detailed tutorial on creating an executable

While on the other hand a more concise tutorial can be found on Stackoverflow

Checking if chromePasswordThieve.py evades antivirus

“VirusTotal aggregates many antivirus products and online scan engines to check for viruses that the user’s own antivirus may have missed, or to verify against any false positives.”- Wikipedia

The following is an example on how more openly malicious programs evade antivirus

On a final note, let’s discuss persistence mechanisms

attack.mitre.org has a proper list of Persistence. Many are advanced and difficult to do due to both lack of educational resources, and complexity. examples of professional/government grade persistence would be hooking, and Process Injection, more details on the latter may be found here.

To make chromePasswordThieve.py persistent we can use techniques such as Shortcut Modification, or placing a compatible program in the startup folder.

To find the windows startup folder we refer to the following

We can easily pair the above with shutil.copyfile to copy our file into the startup folder. It is advisable to delete the original instance.

More information on persistence mechanisms can be found here

I am releasing the core code at on my Github

you can read to core for my other projects at: github.com/alik604/ReadMe a few on my interesting python or security projects are myPyBackDoor and data science

About me:

3rd-year Cognitive science marjor, VP of Cognitive Science Student Society. Interested in Machine learning, Computational Data science, and Finance. Research Interests are Applications of Quantitative Analytics in Finance and Human behavior.