File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
modules/exploits/multi/http Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -659,6 +659,34 @@ def my_target_host
659
659
my_target_host = "http://#{ rhost . to_s } :#{ rport . to_s } #{ normalize_uri ( datastore [ 'PATH' ] ) } "
660
660
end
661
661
662
+
663
+ def report_cred ( opts )
664
+ service_data = {
665
+ address : rhost ,
666
+ port : rport ,
667
+ service_name : 'glassfish' ,
668
+ protocol : 'tcp' ,
669
+ workspace_id : myworkspace_id
670
+ }
671
+
672
+ credential_data = {
673
+ module_fullname : fullname ,
674
+ post_reference_name : self . refname ,
675
+ private_data : opts [ :password ] ,
676
+ origin_type : :service ,
677
+ private_type : :password ,
678
+ username : opts [ :user ]
679
+ } . merge ( service_data )
680
+
681
+ login_data = {
682
+ core : create_credential ( credential_data ) ,
683
+ status : Metasploit ::Model ::Login ::Status ::SUCCESSFUL ,
684
+ last_attempted_at : DateTime . now
685
+ } . merge ( service_data )
686
+
687
+ create_credential_login ( login_data )
688
+ end
689
+
662
690
def try_normal_login ( version )
663
691
init_loginscanner
664
692
@@ -693,6 +721,7 @@ def try_normal_login(version)
693
721
print_status ( "Trying to login as #{ cred . public } :#{ cred . private } " )
694
722
result = @scanner . attempt_login ( cred )
695
723
if result . status == Metasploit ::Model ::Login ::Status ::SUCCESSFUL
724
+ report_cred ( user : cred . public , password : cred . private )
696
725
return @scanner . jsession
697
726
end
698
727
end
You can’t perform that action at this time.
0 commit comments