Here is a simple tutorial on basic virus creation using Metasploit and msfvenom.

  https://www.cybrary.it/0p3n/simple-virus-creation/