User Tools

Site Tools


portugues_guia_aircrack-ng_no_linux_para_novatos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
portugues_guia_aircrack-ng_no_linux_para_novatos [2008/01/08 02:02] jaymessmithportugues_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: Maio 14, 2007\\ 
-Tradução e Adaptação (em andamento): JaymesSmith (06/01/08)\\ 
-\\ 
-Este tutorial te dará a base para começar usando o pacote Aircrack-ng.  É impossível providenciar cada pedaço de informação que você precisa e cubrir cada cenário.  Então esteja preparado para fazer algum dever de cada e pesquisa por conta própria.  O [[http://forum.tinyshell.be/|Forum]] e o [[http://aircrack-ng.org/doku.php|Wiki]] possuem muitos tutoriais suplementares e informações. 
  
-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 "traço duplo bssid" está mostrada como "- -bssid" Lembre-se de remover o espaço entre os dois traços quando usá-lo na vida real.  Isso serve também para "- -ivs", "- -arpreplay", "- -deauth" e "- -fakeauth". 
- 
-====== Configurando Hardware, Instalando Aircrack-ng ====== 
- 
-O primeiro passo para fazer o Aircrack-ng funcionar corretamente no seu sistema Linux é instalando e aplicando o 'patch' no driver apropriado para sua placa wireless.  Várias placas funcionam com múltiplos drivers, alguns deles providenciam as características necessárias para usar o Aircrack-ng, e outros não. 
- 
-Nem precisa dizer que você precisa de uma placa wireless compatível com o pacote Aircrack-ng, ou seja, hardware completamente compatível e que pode fazer injeção de pacotes.  Uma placa wireless compatível pode ser utilizada para quebrar um Access Point wireless em menos de uma hora. 
- 
-Para determinar a qual categoria sua placa pertence, veja [[compatibility_drivers|página de compatibilidade de hardware]]. Leia [[http://aircrack-ng.org/doku.php?id=compatible_cards|Tutorial: Minha Placa Wireless é Compatível?]] se você não sabe onde procurar nessa tabelha.  Ainda assim compensa dar uma lida nesse tutorial para melhorar seu conhecimento e confirmar os atributos da sua placa. 
- 
-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.  A [[compatibility_drivers#drivers|seção de drivers]] te dirá quais drivers você precisa para seu chipset específico.  Baixe-os e então pegue o 'patch' correspondente de http://patches.aircrack-ng.org. (Esses 'patches' ativam o suporte à injeção.) 
- 
-Como eu possuo um dispositivo Ralink USB, estou providenciando os passos para fazê-lo funcionar com o Aircrack-ng.  Antes que você esteja pronto para compilar e instalar os drivers, você precisa ter os kernel-sources para sua distribuição instalados.  
- 
-Se você possui um outro tipo de placa, confira a página [[install_drivers|instalando drivers]] para instruções sobre outros drivers.  Do mesmo modo, faça uma procura na internet se você está inseguro de como instalá-los. 
- 
- 
- 
-===== 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://homepages.tu-darmstadt.de/~p_larbig/wlan/ Estes são drivers especialmente modificados, que suportam injeção e tem relatos de que funcionam melhores com o Aircrack-ng. Eles não precisam de 'patch'. Claro que esses drivers também funcionam para uso normal da placa. 
- 
-Vamos extrair, compilar e instalar os drivers: 
- 
-  tar xfj rt2570-k2wrlz-1.3.0.tar.bz2 
-  cd rt2570-k2wrlz-1.3.0/Module 
-  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://www.aircrack-ng.org 
-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://dag.wieers.com/home-made/apt/|Dag Wieers]] ou [[http://dries.studentenweb.org/rpm/|Dries]]. 
- 
-  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://dag.wieers.com/rpm/packages/aircrack-ng/aircrack-ng-0.7-1.el4.rf.i386.rpm 
- 
-IMPORTANTE: Consulte http://dag.wieers.com/rpm/packages/aircrack-ng/ para a última versão do pacote Aircrack-ng e mude o comando acima para referenciar a última versão. (onde xxxxx será a última versão em .../aircrack-ng-xxxxx.rpm) 
- 
- 
-====== 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, estas funcionando com Access Points (AP).  Cada AP envia por volta de 10 (os tão chamados) beacon frames por segundo. Esses pacotes contém as seguintes informações: 
- 
-  * 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 <interface> scan** e quando você executa [[airodump-ng]]. 
- 
-Cada AP tem um único endereço MAC (48 bits, 6 pares de números hexadecimais). É algo parecido com 00:01:23:4A:BC:DE. Cada dispositivo de hardware de rede possui tais endereços, e dispositivos de rede comunicam-se utilizando esses endereços MAC. Então é basicamente como um nome único.  Endereços MAC são únicos, nem quaisquer dois dispositivos de rede no mundo tem o mesmo endereço MAC. 
- 
- 
- 
-===== 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.  (Opcional: Se quiser aprender mais sobre autenticação, dê uma olhada [[http://documentation.netgear.com/reference/fra/wireless/WirelessNetworkingBasics-3-06.html|aqui]].) 
- 
-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, Filtro MAC. 
-  * Access Point usa Autenticação por Chave Compartilhada((Shared Key Authentication - SKA)), você precisa fornecer a chave WEP correta para conseguir conectar-se.  (Veja o [[http://aircrack-ng.org/doku.php?id=shared_key|Tutorial: Como Fazer Autenticação Falsa por Chave Compartilhada]] para técnicas avançadas.)  
- 
- 
-====== Sniffing (Farejamento) e Quebra Simples ====== 
- 
- 
- 
- 
-===== Descobrindo as Redes ===== 
- 
-A primeira coisa a fazer é procurar por um alvo em potencial. O pacote Aircrack-ng contém o [[airodump-ng]] para isso - mas outros programas como o 
-[[http://www.kismetwireless.net/|Kismet]] podem ser usados também. 
- 
-Antes de procurar por redes, você precisa colocar sua placa wireless no chamado "modo monitor" Modo Monitor é um modo especial que permite que sua placa wireless escute cada pacote wireless trafegado no ar.  É semelhante ao Modo Promíscuo em redes cabeadas, mas aqui o meio deixa de ser um cabo de redes, e passa a ser o ar.  Esse Modo Monitor também permite, opcionalmente, injetar pacotes em uma rede.  Injeção será abordado mais adiante neste tutorial. 
- 
-Para colocar sua placa wireless em Modo Monitor: 
- 
-[[airmon-ng]] start rausb0 
- 
-Lembrando! O "__rausb0__" acima está sendo utilizado porque a placa wireless usada como exemplo aqui é a citada no início do tutorial. 
-Para confirmar se está em Modo Monitor, execute **iwconfig** e verifique o modo no qual sua placa está.  A [[airmon-ng|página airmon-ng]] no Wiki tem informações gerais e como iniciá-lo, para outros drivers. 
- 
-Então, inicie o airodump-ng para procurar por redes: 
- 
-  airodump-ng rausb0 
- 
-Mais uma vez! "__rausb0__" é o nome da interface de rede. Se você está usando um dispositivo Wi-Fi diferente de um rt2570 então deve utilizar um nome de interface de rede diferente, próprio para sua placa. 
-Dê uma olhada na documentação do driver da sua placa. 
- 
-Se o airodump-ng puder conectar-se ao dispositivo Wi-Fi, você verá uma tela como esta: 
- 
-{{http://www.aircrack-ng.org/img/newbie_airodump.png}} 
- 
-O [[airodump-ng]] salta de canal em canal e mostra todos os Access Points dos quais consegue receber beacons. Canais do 1 ao 14 são utilizados para 802.11b e g (nos Estados Unidos só são permitidos utilizar os canais do 1 ao 11; do 1 ao 13 na Europa, com algumas exceções; do 1 ao 14 no Japão; e no Brasil, como na maiora da América Latina, segue-se o padrão americado, do 1 ao 11). Canais entre 36 e 149 são utilizados no padrão 802.11a.\\  
-O canal atual é mostrado no canto superior esquerdo. 
- 
-Após um curto período de tempo, alguns APs e (com sorte) alguns clientes associados apareçerão. 
- 
-O bloco dados superior mostra os Access Points encontrados: 
- 
-^ BSSID        | The MAC address of the AP  | 
-^ PWR          | Signal strength. Some drivers don't report it  | 
-^ Beacons      | Number of beacon frames received. If you don't have a signal strength you can estimate it by the number of beacons: the more beacons, the better the signal quality | 
-^ 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      | The MAC of the client itself  | 
-^ PWR          | Signal strength. Some drivers don't report it  | 
-^ Packets      | Number of data frames recieved   | 
-^ Probes       | Network names (ESSIDs) this client has probed  | 
- 
-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://aircrack-ng.org/doku.php?id=how_to_crack_wep_with_no_clients|How to crack wep with no clients]]). It should use WEP encryption and have a high signal strength. Maybe you can re-position your antenna to get a better signal. Often a few centimeters make a big difference in signal strength. 
- 
-In the example above the net 00:01:02:03:04:05 would be the only possible target because it's the only one with an associated client. But it also has a high signal strength so it's really a good target to practice. 
- 
- 
-===== 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:01:02:03:04:05 -w dump rausb0 
- 
-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" combined with the AP MAC address limits the capture to the one AP.  The "- -bssid" option is only available on new versions of irodump-ng. 
- 
-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:01:02:03:04:05 dump-01.cap 
- 
-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 "n" different IVs from the AP or that you'll need millions (like 5 to 7 million) to crack the key. Search in the [[http://forum.tinyshell.be/|Forum]], there are some threads about cases like this and what to do. 
- 
-====== 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.  Sometimes this table is not up-to-date, so if you see a "NO" for your driver there don't give up yet, but look at the driver homepage, the driver mailing list or our [[http://forum.tinyshell.be/|Forum]]. If you were able to successfully replay using a driver which is not listed as supported, don't hesitate to update the [[compatibility_drivers|compatibility page]] table and add a link to a short howto. 
- 
-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.  Make sure to perform this test prior to proceeding.  Your card must be able to successfully inject in order to perform the following steps. 
- 
-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 "HWaddr", usually divided by ":" or "-"). 
- 
-Then you can try to connect to your AP using [[aireplay-ng]]: 
- 
-  aireplay-ng - -fakeauth 0 -e "your network ESSID" -a 00:01:02:03:04:05 -h 00:11:22:33:44:55 rausb0 
- 
-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:14:06  Sending Authentication Request 
-  12:14:06  Authentication successful 
-  12:14:06  Sending Association Request 
-  12:14:07  Association successful :-) 
- 
-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 "0", try "6000 -o 1 -q 10" 
- 
-===== 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://en.wikipedia.org/wiki/Address_Resolution_Protocol|ARP]] works (simplified) by broadcasting a query for an IP and the device that has this IP 
-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:01:02:03:04:05 -h 00:04:05:06:07:08 rausb0 
- 
--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, you'll see something like this: 
- 
-  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 <filename> option. 
- 
-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.  You must capture the full packet in airodump-ng, meaning do not use the "- - ivs" option when starting it.  For [[aircrack-ng]], use "aircrack -z <file name>". 
- 
-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:01:02:03:04:05 -c 00:04:05:06:07:08 rausb0 
- 
--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://www.tuto-fr.com/tutoriaux/crack-wep/aircrack-ng.php|Tutorial em francês para o Aircrack-ng]] [[http://www.tuto-fr.com/tutoriaux/tutorial-crack-wep-aircrack.php|ou em inglês]] 
portugues_guia_aircrack-ng_no_linux_para_novatos.1199754143.txt.gz · Last modified: 2008/01/08 02:02 by jaymessmith