@@ -543,12 +543,13 @@ def cmd_sleep(*args)
543543 '-t' => [ true , "Transport type: #{ Rex ::Post ::Meterpreter ::ClientCore ::VALID_TRANSPORTS . keys . join ( ', ' ) } " ] ,
544544 '-l' => [ true , 'LHOST parameter (for reverse transports)' ] ,
545545 '-p' => [ true , 'LPORT parameter' ] ,
546- '-ua' => [ true , 'User agent for http(s) transports (optional)' ] ,
547- '-ph' => [ true , 'Proxy host for http(s) transports (optional)' ] ,
548- '-pp' => [ true , 'Proxy port for http(s) transports (optional)' ] ,
549- '-pu' => [ true , 'Proxy username for http(s) transports (optional)' ] ,
550- '-ps' => [ true , 'Proxy password for http(s) transports (optional)' ] ,
551- '-pt' => [ true , 'Proxy type for http(s) transports (optional: http, socks; default: http)' ] ,
546+ '-u' => [ true , 'Custom URI for HTTP/S transports (used when removing transports)' ] ,
547+ '-ua' => [ true , 'User agent for HTTP/S transports (optional)' ] ,
548+ '-ph' => [ true , 'Proxy host for HTTP/S transports (optional)' ] ,
549+ '-pp' => [ true , 'Proxy port for HTTP/S transports (optional)' ] ,
550+ '-pu' => [ true , 'Proxy username for HTTP/S transports (optional)' ] ,
551+ '-ps' => [ true , 'Proxy password for HTTP/S transports (optional)' ] ,
552+ '-pt' => [ true , 'Proxy type for HTTP/S transports (optional: http, socks; default: http)' ] ,
552553 '-c' => [ true , 'SSL certificate path for https transport verification (optional)' ] ,
553554 '-to' => [ true , 'Comms timeout (seconds) (default: same as current session)' ] ,
554555 '-ex' => [ true , 'Expiration timout (seconds) (default: same as current session)' ] ,
@@ -592,6 +593,7 @@ def cmd_transport(*args)
592593 :transport => nil ,
593594 :lhost => nil ,
594595 :lport => nil ,
596+ :uri => nil ,
595597 :ua => nil ,
596598 :proxy_host => nil ,
597599 :proxy_port => nil ,
@@ -611,6 +613,8 @@ def cmd_transport(*args)
611613 case opt
612614 when '-c'
613615 opts [ :cert ] = val
616+ when '-u'
617+ opts [ :uri ] = val
614618 when '-ph'
615619 opts [ :proxy_host ] = val
616620 when '-pp'
@@ -735,6 +739,11 @@ def cmd_transport(*args)
735739 print_error ( "Failed to add transport, please check the parameters" )
736740 end
737741 when 'remove'
742+ if !opts [ :transport ] . end_with? ( '_tcp' ) && opts [ :uri ] . nil?
743+ print_error ( "HTTP/S transport specified without session URI" )
744+ return
745+ end
746+
738747 print_status ( "Removing transport ..." )
739748 if client . core . transport_remove ( opts )
740749 print_good ( "Successfully removed #{ opts [ :transport ] } transport." )
0 commit comments