portugues_guia_aircrack-ng_no_linux_para_novatos
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
portugues_guia_aircrack-ng_no_linux_para_novatos [2008/01/08 01:36] – jaymessmith | portugues_guia_aircrack-ng_no_linux_para_novatos [2009/08/11 22:38] (current) – --- mister_x | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Guia Aircrack-ng no Linux para Novatos ====== | ||
- | Idéia e trabalho inicial: ASPj\\ | ||
- | Adicionais por: um número de boas almas\\ | ||
- | Última atualização: | ||
- | Tradução e Adaptação (em andamento): JaymesSmith (06/ | ||
- | \\ | ||
- | Este tutorial te dará a base para começar usando o pacote Aircrack-ng. | ||
- | Embora não cubra todos os passos do início ao fim, como neste tutorial, o tutorial [[simple_wep_crack|Quebra Simples da Chave Wep]] cobre os passos do Aircrack-ng atual em muito mais detalhes. | ||
- | |||
- | Nos exemplos, a opção " | ||
- | |||
- | ====== Configurando Hardware, Instalando Aircrack-ng ====== | ||
- | |||
- | O primeiro passo para fazer o Aircrack-ng funcionar corretamente no seu sistema Linux é instalando e aplicando o ' | ||
- | |||
- | Nem precisa dizer que você precisa de uma placa wireless compatível com o pacote Aircrack-ng, | ||
- | |||
- | Para determinar a qual categoria sua placa pertence, veja [[compatibility_drivers|página de compatibilidade de hardware]]. Leia [[http:// | ||
- | |||
- | Primeiro, você precisa saber qual chipset é utilizado na sua placa wireless e qual driver você necessita para ele. Você terá determinado isso usando as informações do parágrafo anterior. | ||
- | |||
- | Como eu possuo um dispositivo Ralink USB, estou providenciando os passos para fazê-lo funcionar com o Aircrack-ng. | ||
- | |||
- | Se você possui um outro tipo de placa, confira a página [[install_drivers|instalando drivers]] para instruções sobre outros drivers. | ||
- | |||
- | |||
- | |||
- | ===== Guia de Configuração do RaLink USB rt2570 ===== | ||
- | |||
- | Se você possui um dispositivo USB rt2570 (como o D-Link DWL-G122 rev. B1 ou Linksys WUSB54G v4) você deve usar os drivers de http:// | ||
- | |||
- | Vamos extrair, compilar e instalar os drivers: | ||
- | |||
- | tar xfj rt2570-k2wrlz-1.3.0.tar.bz2 | ||
- | cd rt2570-k2wrlz-1.3.0/ | ||
- | make | ||
- | make install | ||
- | |||
- | O última passo precisa ser feito como root. Use o comando **su** para mudar para usuário root. | ||
- | Agora nós podemos carregar o módulo no kernel: | ||
- | modprobe rt2570 | ||
- | |||
- | Insira sua placa, ela deve ser reconhecida como rausb0 agora. Execute **iwconfig** para lista seus dispositivos wireless e verificar se tudo está funcionando. | ||
- | |||
- | ===== Instalação do Aircrack-ng ===== | ||
- | |||
- | |||
- | ==== Fonte ==== | ||
- | |||
- | Pegue a última cópia do Aircrack-ng na página inicial: http:// | ||
- | Os comandos a seguir devem mudar se você usar uma versão mais recente do software. | ||
- | |||
- | Extraindo, compilando, instalando: | ||
- | |||
- | tar xfz aircrack-ng-0.9.1.tar.gz | ||
- | cd aircrack-ng-0.9.1 | ||
- | make | ||
- | make install | ||
- | |||
- | Como sempre, o último passo precisa ser executado como root, utilize **su** para logar como root (use **sudo make install** para Ubuntu). | ||
- | |||
- | |||
- | ==== YUM ==== | ||
- | |||
- | Se estiver usando um sistema como Redhat Linux ou Fedora Core você pode instalar o Aircrack-ng com yum. Primeiro você precisa adicionar o repositório de [[http:// | ||
- | |||
- | su | ||
- | yum -y install aircrack-ng | ||
- | |||
- | |||
- | |||
- | ==== RPM ==== | ||
- | |||
- | Se estiver usando um sistema baseado em rpm, então pode usar o caminho fácil para instalar o Aircrack-ng.\\ | ||
- | (Exemplo para Redhat Linux 4) | ||
- | |||
- | su | ||
- | rpm -ihv http:// | ||
- | |||
- | IMPORTANTE: Consulte http:// | ||
- | |||
- | |||
- | ====== Básico do IEEE 802.11 ====== | ||
- | |||
- | Certo, agora tudo está pronto, hora do intervalo antes da ação finalmente começar e aprender algo sobre como redes (locais) wireless funcionam. | ||
- | |||
- | O capítulo a seguir é muito importante, se alguma coisa não funcionar como esperado. Conhecer sobre tudo relacionado ao assunto ajuda a encontrar o problema, ou pelo menos te ajuda para descrevê-lo a alguém que pode te ajudar. Isso é um pouco científico e talvez você prefira pular. Entretanto, um pouco de conhecimento é necessário para quebrar redes wireless e isso é um pouco mais do que simplesmente digitar um comando e deixar o Aircrack-ng fazer o resto. | ||
- | |||
- | |||
- | |||
- | ===== Como uma rede wireless é encontrada ===== | ||
- | |||
- | Isso é uma curta introdução em redes gerenciadas, | ||
- | |||
- | * Nome da rede (ESSID) | ||
- | * Se alguma criptografia é utilizada (e qual criptografia é utilizada; preste atenção, isso pode não ser sempre verdade só porque o AP faz propaganda) | ||
- | * Quais taxas de dados, MBit, são suportados | ||
- | * Em qual canal a rede está | ||
- | |||
- | Essas informações são então mostradas na sua ferramenta que conecta à esta rede. É mostrada quando você faz sua placa procurar por redes com **iwlist < | ||
- | |||
- | Cada AP tem um único endereço MAC (48 bits, 6 pares de números hexadecimais). É algo parecido com 00: | ||
- | |||
- | |||
- | |||
- | ===== Conectando-se a uma rede ===== | ||
- | |||
- | Se você quer conectar-se a uma rede wireless, existem algumas possibilidades. Na maior parte dos casos, Autenticação por Sistema Aberto((Open System Authentication - OSA)) é utilizada. | ||
- | |||
- | Autenticação por Sistema Aberto: | ||
- | - Pedido de autenticação ao AP é enviado. | ||
- | - O AP responde: OK, você está autenticado. | ||
- | - Pedido de associação ao AP é enviado. | ||
- | - O AP responde: OK, você está agora conectado. | ||
- | \\ | ||
- | Esse é o caso mais simples. MAS pode haver alguns problemas se você não está autorizado a conectar: | ||
- | * WPA/WPA2 está em uso, você precisa de autenticação EAPOL. O AP negará o acesso no passo 2. | ||
- | * Access Point tem uma lista de clientes permitidos (endereços MAC), e não deixa ninguém mais conectar-se. Isso é chamado de Filtro de Endereço MAC, ou simplesmente, | ||
- | * Access Point usa Autenticação por Chave Compartilhada((Shared Key Authentication - SKA)), você precisa fornecer a chave WEP correta para conseguir conectar-se. | ||
- | |||
- | ====== Sniffing((Farejamento)) e Quebra Simples ====== | ||
- | |||
- | |||
- | |||
- | ===== Descobrindo Redes ===== | ||
- | |||
- | The first thing to do is looking out for a potential target. The aircrack-ng suite contains [[airodump-ng]] for this - but other programs like | ||
- | [[http:// | ||
- | |||
- | Prior to looking for networks, you must put your wireless card into what is called " | ||
- | |||
- | To put your wireless card into monitor mode: | ||
- | |||
- | [[airmon-ng]] start rausb0 | ||
- | |||
- | To confirm it is in monitor mode, run " | ||
- | |||
- | Then, start airodump-ng to look out for networks: | ||
- | |||
- | airodump-ng rausb0 | ||
- | |||
- | " | ||
- | Take a look in the documentation of the nic driver. | ||
- | |||
- | If airodump-ng could connect to the WLAN device, you'll see a screen like this: | ||
- | |||
- | {{http:// | ||
- | |||
- | [[airodump-ng]] hops from channel to channel and shows all access points it can receive beacons from. Channels 1 to 14 are used for 802.11b and g (in US, they only are allowed to use 1 to 11; 1 to 13 in Europe with some special cases; 1-14 in Japan). Channels between 36 and 149 are used for 802.11a. The current channel is shown in the top left corner. | ||
- | |||
- | After a short time some APs and (hopefully) some associated clients will show up. | ||
- | |||
- | The upper data block shows the access points found: | ||
- | |||
- | ^ BSSID | The MAC address of the AP | | ||
- | ^ PWR | Signal strength. Some drivers don't report it | | ||
- | ^ Beacons | ||
- | ^ Data | Number of data frames recieved | ||
- | ^ CH | Channel the AP is operating on | | ||
- | ^ MB | Speed or AP Mode. 11 is pure 802.11b, 54 pure 802.11g. Values between are a mixture | ||
- | ^ ENC | Encryption: OPN: no encryption, WEP: WEP encryption, WPA: WPA or WPA2 encryption, WEP?: WEP or WPA (don't know yet) | | ||
- | ^ ESSID | The network name. Sometimes hidden | ||
- | |||
- | The lower data block shows the clients found: | ||
- | |||
- | ^ BSSID | The MAC of the AP this client is associated to | | ||
- | ^ STATION | ||
- | ^ PWR | Signal strength. Some drivers don't report it | | ||
- | ^ Packets | ||
- | ^ Probes | ||
- | |||
- | Now you should look out for a target network. It should have a client connected because cracking networks without a client is an advanced topic (See [[http:// | ||
- | |||
- | In the example above the net 00: | ||
- | |||
- | ===== Sniffing((Farejando)) IVs ===== | ||
- | |||
- | Because of the channel hopping you won't capture all packets from your target net. So we want to listen just on one channel and additionally write all data to disk to be able to use it for cracking: | ||
- | |||
- | airodump-ng -c 11 - -bssid 00: | ||
- | |||
- | With the -c parameter you tune to a channel and the parameter after -w is the prefix to the network dumps written to disk. The "- -bssid" | ||
- | |||
- | You can also add the - -ivs parameter. This tells [[airodump-ng]] to only capture the IVs to save space. | ||
- | |||
- | Before being able to crack WEP you'll usually need between 250.000 and 500.000 different Initialization Vectors (IVs). Every data packet contains an IV. IVs can be re-used, so the number of different IVs is usually a bit lower than the number of data packets captured. | ||
- | |||
- | So you'll have to wait and capture 250K to 500K of data packets (IVs). If the network is not busy it will take a very long time. Often you can speed it up a lot by using an active attack (=packet replay). See the next chapter. | ||
- | |||
- | ===== Quebra ===== | ||
- | |||
- | If you've got enough IVs captured in one or more file, you can try to crack the WEP key: | ||
- | |||
- | aircrack-ng -b 00: | ||
- | |||
- | The MAC after the -b option is the BSSID of the target and dump-01.cap the file containing the captured packets. You can use multiple files, just add all their names or you can use a wildcard such as dump*.cap. | ||
- | |||
- | For more information about [[aircrack-ng]] parameters, description of the output and usage see the [[aircrack-ng|manual]]. | ||
- | |||
- | The number of IVs you need to crack a key is not fixed. This is because some IVs are weaker and leak more information about the key than others. Usually these weak IVs are randomly mixed in between the stonger ones. So if you are lucky, you can crack a key with only 100.000 IVs. But often this it not enough and aircrack-ng will run a long time (up to a week or even longer with a high fudge factor) and then tell you the key could not be cracked. If you have more IVs cracking can be done a lot faster and is usually done in a few minutes. Experience shows that 250.000 to 500.000 IVs is usually enough for cracking. | ||
- | |||
- | There are some more advanced APs out there that use an algorithm to filter out weak IVs. The result is either that you can't get more than " | ||
- | |||
- | ====== Ataques ativos ====== | ||
- | |||
- | ===== Suporte à injeção ===== | ||
- | Most devices don't support injection - at least not without patched drivers. Take a look at the [[compatibility_drivers|compatibility page]], column aireplay. | ||
- | |||
- | The first step is to make sure packet injection really works with your card and driver. The easiest way to test it is the [[injection_test|injection test]] attack. | ||
- | |||
- | You'll need the BSSID (AP MAC) and ESSID (network name) of an AP that does not do MAC filtering (e.g. your own) and must be in range of the AP. | ||
- | |||
- | The first thing to do is find out the MAC of your own WLAN device. Sometimes there is a label with the MAC on the device. But you can always find | ||
- | it out using the ifconfig command (the 6 Hex bytes after " | ||
- | |||
- | Then you can try to connect to your AP using [[aireplay-ng]]: | ||
- | |||
- | aireplay-ng - -fakeauth 0 -e "your network ESSID" -a 00: | ||
- | |||
- | The value after -a is the BSSID of your AP, the value after -h is the MAC of your own WLAN device. | ||
- | |||
- | If injection works you should see something like this: | ||
- | |||
- | 12: | ||
- | 12: | ||
- | 12: | ||
- | 12: | ||
- | |||
- | If not | ||
- | - double-check ESSID, BSSID and your own MAC | ||
- | - make sure your AP has MAC filtering disabled | ||
- | - test it against another AP | ||
- | - make sure your driver is properly patched and supported | ||
- | - Instead of " | ||
- | |||
- | ===== ARP replay ===== | ||
- | |||
- | Now that we know that packet injection works, we can do something to massively speed up capturing IVs: [[ARP-request reinjection]] | ||
- | |||
- | ==== A idéia ==== | ||
- | |||
- | [[http:// | ||
- | sends back an answer. Because WEP does not protect against replay, you can sniff a packet, send it out again and again and it is still valid. | ||
- | So you just have to capture and replay an ARP-request targeted at the AP to create lots of traffic (and sniff IVs). | ||
- | |||
- | |||
- | ==== A maneira preguiçosa ==== | ||
- | |||
- | First open a window with an [[airodump-ng]] sniffing for traffic (see above). [[aireplay-ng]] and [[airodump-ng]] can run together. | ||
- | Wait for a client to show up on the target network. Then start the attack: | ||
- | |||
- | aireplay-ng - -arpreplay -b 00: | ||
- | |||
- | -b specifies the target BSSID, -h the MAC of the connected client. | ||
- | |||
- | Now you have to wait for an ARP packet to arrive. Usually you'll have to wait for a few minutes (or look at the next chapter). | ||
- | |||
- | If you were successfull, | ||
- | |||
- | Saving ARP requests in replay_arp-0627-121526.cap | ||
- | You must also start airodump to capture replies. | ||
- | Read 2493 packets (got 1 ARP requests), sent 1305 packets... | ||
- | |||
- | If you have to stop replaying, you don't have to wait for the next ARP packet to show up, but you can re-use the previously captured packet(s) with | ||
- | the -r < | ||
- | |||
- | When using the arp injection technique, you can use the PTW method to crack the WEP key. This dramatically reduces the number of data packets you need and also the time needed. | ||
- | |||
- | If the number of data packets received by airodump-ng sometimes stops increasing you maybe have to reduce the replay-rate. You do this with the -x <packets per second> option. I usually start out with 50 and reduce until packets are received contiously again. Better positioning of your antenna usually also helps. | ||
- | |||
- | ==== A maneira agressiva ==== | ||
- | |||
- | Most operating sytems clear the ARP cache on disconnection. If they want to send the next packet after reconnection (or just use DHCP), they have to send out ARP requests. So the idea is to disconnect a client and force it to reconnect to capture an ARP-request. A side-effect is that you can sniff the ESSID during reconnection too. This comes in handy if the ESSID of your target is hidden. | ||
- | |||
- | Keep your airodump-ng and aireplay-ng running. Open another window and run a [[deauthentication]] attack: | ||
- | |||
- | aireplay-ng - -deauth 5 -a 00: | ||
- | |||
- | -a is the BSSID of the AP, -c the MAC of the targeted client. | ||
- | |||
- | Wait a few seconds and your arp replay should start running. | ||
- | |||
- | Most clients try to reconnect automatically. But the risk that someone recognizes this attack or at least attention is drawn to the stuff happening on the WLAN is higher | ||
- | than with other attacks. | ||
- | |||
- | |||
- | |||
- | ====== Maiores informações e mais ferramentas ====== | ||
- | [[http:// |