Sildaekar Posted June 4, 2015 Share Posted June 4, 2015 (edited) I'm very new to the metasploit framework and meterpreter but I've been playing around with it a bit and managed to gain access to two different android phones I had laying around as well as a windows box. The only problem I've been able to find is that there are some commands that need to be ran almost immediately after I gain a session (persistance and the like). My question is this: Is there any way to automate these commands so that they run as soon as a session is gained? I'm sure there is as I've found only ONE reference on the topic through google but have yet to find any actual instructions. The basics of what I want to do is this: 1. Navigate to specified directory 2. Upload file to device 3. Drop to shell 4. Execute file Any and all help is greatly appreciated. PS: This question is mainly directed at the android devices. Edited June 4, 2015 by Sildaekar Quote Link to comment Share on other sites More sharing options...
V3sth4cks153 Posted June 4, 2015 Share Posted June 4, 2015 I'm very new to the metasploit framework and meterpreter but I've been playing around with it a bit and managed to gain access to two different android phones I had laying around as well as a windows box. The only problem I've been able to find is that there are some commands that need to be ran almost immediately after I gain a session (persistance and the like). My question is this: Is there any way to automate these commands so that they run as soon as a session is gained? I'm sure there is as I've found only ONE reference on the topic through google but have yet to find any actual instructions. The basics of what I want to do is this: 1. Navigate to specified directory 2. Upload file to device 3. Drop to shell 4. Execute file Any and all help is greatly appreciated. PS: This question is mainly directed at the android devices. I googled that a while ago and it seems like you can, and that it's even been implemented in Metasploit : https://offensiveinfosec.wordpress.com/tag/autorunscript/ Just have to change the commands in the rc file to the ones you want and it should work. I didn't test it though... Quote Link to comment Share on other sites More sharing options...
Sildaekar Posted June 4, 2015 Author Share Posted June 4, 2015 Awesome! Thanks man. Quote Link to comment Share on other sites More sharing options...
V3sth4cks153 Posted June 4, 2015 Share Posted June 4, 2015 Awesome! Thanks man. You're welcome ! Did you test it ?? Quote Link to comment Share on other sites More sharing options...
Sildaekar Posted June 4, 2015 Author Share Posted June 4, 2015 I haven't had a chance to been busy and going on 28hrs no sleep -_- But I'm gonna try it tomorrow and I'll report back if it works. Quote Link to comment Share on other sites More sharing options...
V3sth4cks153 Posted June 5, 2015 Share Posted June 5, 2015 (edited) I haven't had a chance to been busy and going on 28hrs no sleep -_- But I'm gonna try it tomorrow and I'll report back if it works. Ok ! I tried it with running persistence, and it worked flawlessly ! I'm going to try it with multiple commands when I get the time... Edited June 5, 2015 by V3sth4cks153 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.