document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.applet.Applet;
  2. import java.awt.*;
  3. import sun.net.dns.* ;
  4. import java.util.* ;
  5. import java.lang.* ;
  6. import java.net.InetAddress ;
  7. import java.security.* ;
  8.  
  9. public class DNSChangerDetector extends Applet {
  10.  
  11.     public java.util.List nsList ;
  12.     public String infected = "FALSE" ;
  13.    
  14.     boolean ready = false ;
  15.    
  16.     String[] fromIP = { "85.255.112.0", "67.210.0.0", "93.188.60.0", "77.67.83.0", "213.109.64.0", "64.28.176.0" } ;
  17.     String[] toIP = { "85.255.127.255", "67.210.15.255", "93.188.167.255", "77.67.83.255", "213.109.79.255", "64.28.191.255" } ;
  18.    
  19.     public static long ipToLong(InetAddress ip) {
  20.    
  21.         byte[] octets = ip.getAddress();
  22.        
  23.         long result = 0;
  24.        
  25.         for (int i = 0; i < octets.length; i++) {
  26.        
  27.             result |= octets[i] & 0xff;
  28.            
  29.             if (i < octets.length - 1) {
  30.                 result <<= 8;
  31.             }
  32.            
  33.         }
  34.        
  35.         return result;
  36.        
  37.     }
  38.    
  39.     public String isReady() {
  40.        if (ready) { return("TRUE"); } else { return("FALSE"); }
  41.     }
  42.  
  43.     public String getEntries() {
  44.         return(nsList.toString()) ;
  45.     }
  46.  
  47.     public String isInfected() {
  48.         return(infected) ;
  49.     }
  50.    
  51.    
  52.     public void init() {
  53.    
  54.         nsList = AccessController.doPrivileged(new PrivilegedAction<java.util.List>() {
  55.        
  56.             boolean found = false ;
  57.    
  58.             public java.util.List run() {
  59.            
  60.                 try {
  61.                
  62.                     ResolverConfiguration rc = sun.net.dns.ResolverConfiguration.open() ;
  63.            
  64.                     java.util.List ns = rc.nameservers() ;
  65.                    
  66.                     System.err.println("DNS Servers") ;
  67.                     System.err.println(ns) ;
  68.                    
  69.                     for (Object dns : ns) {
  70.                    
  71.                         for (int i=0; i<6; i++) {
  72.                    
  73.                             System.err.println("Checking if " + dns + " is in [" + fromIP[i] + "-" + toIP[i] + "]" );
  74.                    
  75.                             long ipLo = ipToLong(InetAddress.getByName(fromIP[i]));
  76.                             long ipHi = ipToLong(InetAddress.getByName(toIP[i]));
  77.                             long ipToTest = ipToLong(InetAddress.getByName(dns.toString()));
  78.                            
  79.                             if (ipToTest >= ipLo && ipToTest <= ipHi) {
  80.                                found = true ;
  81.                             }
  82.                                                        
  83.                         }
  84.                        
  85.                     }
  86.                
  87.                     if (!found) {  
  88.                         System.err.println("\\nYou do not appear to be infected") ;
  89.                         infected = "FALSE" ;
  90.                     } else {
  91.                         System.err.println("\\nYou appear to be infected, please visit https://forms.fbi.gov/check-to-see-if-your-computer-is-using-rogue-DNS for more information") ;
  92.                         infected = "TRUE" ;
  93.                     };
  94.                    
  95.                     return (ns) ;
  96.                    
  97.                 } catch (Exception e) {
  98.                 }
  99.                
  100.                 return null;
  101.                
  102.             }
  103.        
  104.         });
  105.    
  106.         ready = true ;
  107.        
  108.     };
  109.    
  110. }
');