1 import jcifs.netbios.NbtAddress; 2 import jcifs.*; 3 import jcifs.smb.*; 4 5 public class CheckAllDC { 6 7 public static void main( String argv[] ) throws Exception { 8 9 if( argv.length < 2 ) { 10 System.err.println( "usage: CheckAllDC <domain> <dom;user:pass>" ); 11 System.exit(1); 12 } 13 14 NbtAddress[] addrs = NbtAddress.getAllByName( argv[0], 0x1C, null, null ); 15 16 for( int i = 0; i < addrs.length; i++ ) { 17 System.out.println( addrs[i] ); 18 UniAddress dc = new UniAddress( addrs[i] ); 19 NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication( argv[1] ); 20 SmbSession.logon( dc, auth ); 21 } 22 } 23 } 24 | Popular Tags |