设为首页 收藏本站
查看: 1293|回复: 0

[经验分享] How to crack WEP encryption (wifi security)

[复制链接]

尚未签到

发表于 2015-9-30 14:15:12 | 显示全部楼层 |阅读模式
  Efforts to crack WEP encryption have been around and even publicly discussed since the inception of the WEP protocol, and this page brings you information about how to discover andcalculate a WEP key from network traffic. This introduction to WEP cracking may be useful to anyone who intends to investigate network security.

  Cracking WEP itself is relatively easy and can take anywhere from as little as a few minutes to a few hours (depends on the amount of network traffic, connection quality, etc.). Setting up your equipment so that it does what it needs to do can take weeks (depends onwhat you have and what you already know). Before you proceed to WEP cracking, read our first page of this "tutorial" which can provide an idea about setting your computer and also about the legality of WEP cracking.
  How to crack WEP with Intel PRO/Wireless 3945ABG
  Now we can proceed to demonstrating how to crack WEP encryption.
What do I need to discover a wireless network WEP key?
  Hereis a list of assumptions that you need to meet in order to be able to discover a WEP key from network traffic. Note, the assumptions listed below are specific to this tutorial. Other tutorials on the web are based on different assumptions.

  • Software and hardware:Ubuntu, Intel PRO/Wireless 3945ABG with the ipwraw-ng-2.3.4 driver (or alternatively TP-LINK TL-WN321G network adapter with the rt73-k2wrlz-3.0.1. driver), aircrack-ng-1.0. (Of course, you can use some other adapter as well, Intel and TP-LINK is what we used.)
  • Youare physically close enough to the access point to send and receive packets. Remember that just because you can receive packets from the wireless access point does not mean you will be able to transmit packets to the access point. The wireless card strength is typically less than the access point strength, so you have to be physically close enough for your transmitted packets to reach and be received by the access point.
  • Thereis at least one wireless client connected to the network and active. The reason is that WEP cracking relies on ARP packets and if there are no active clients then there will never be any ARP request packets.
  Ensure that all of the above assumptions are true, otherwise the examples that follow will not work.
  Wehave tested WEP cracking with two network adapters: Intel PRO/Wireless 3945ABG with the ipwraw-ng-2.3.4 driver and alternatively TP-LINK TL-WN321G network adapter dongle with the rt73-k2wrlz-3.0.1. driver. TheIntel adapter is referenced as wlan0 (wifi0), and the TP-LINK adapter is referenced as rausb0. You can find the name of your network adapter by executing the iwconfig command.
Does my network adapter driver work correctly?
  One of the assumptions in this article is that your network interface drivers need to be patched for monitor mode and packet injection. (See the How to crack WEP with Intel PRO/Wireless 3945ABG link mentioned above for more details.)
Monitor mode test
  Ifyou loaded your driver module correctly, your network adapter might already be in Monitor mode. If it is not, try executing the following command:
  sudo airmon-ng start wlan0
  Wlan0 (and also wifi0) is the name of your Intel 3945 network adapter. It would be rausb0 if you worked with the TP-LINK 321. You can find the name of your network adapter by executing the iwconfig command. The print screen below shows you what you want to see in your iwconfig screen.
DSC0000.png
  If the network interface is set correctly, it should say Monitor mode.
Packet injection test
  Usethe injection test to confirm your card can inject prior to proceeding.Try executing the following two commands in your terminal window:
  aireplay-ng -9 wifi0
aireplay-ng -9 127.0.0.1:666
  They both should result in the "Injection is working!" message. You can find more details here: http://aircrack-ng.org/doku.php?id=injection_test.
How WEP cracking works?
  Ok, we have all the hardware and software ready, now it is time to explain how WEP cracking works.
  Here are the basic steps we will be going through:

  • Start the wireless interface in monitor mode
  • Start airodump-ng to discover all the available networks and find your target
  • Change your MAC address (optional)
  • Start airodump-ng on AP channel with a bssid filter to collect the new unique IVs
  • Use aireplay-ng to do a fake authentication with the target access point
  • Start aireplay-ng in ARP request replay mode to inject packets
  • Run aircrack-ng to crack key using the IVs collected
  Sounds easy? Let's get into the details.
1. Start the wireless interface in monitor mode
  Ifyou want to listen to network traffic and to capture network traffic, your network adapter needs to be in Monitor mode. We already covered this above and also on the How to crack WEP with Intel PRO/Wireless 3945ABG page.
2. Start airodump-ng to discover all the available networks
  If you want to crack WEP, you need to know a little more than just the network name. You also need to know the MAC address of the wireless access point or wireless router which you can find by executing the following command:
  sudo airodump-ng wifi0
  This is what you will get.

  Youcan see names of available wireless networks in the most right column and MAC addresses of access points in the most left column. This screen also tells you how each network is secured (WEP, WPA, OPN, etc). You canalso find out on which channel each access point operates.
3. Change your MAC address (optional)
  In order to take advantage of the packet injection technique, you need to be associated with the target wireless access point. Many wireless networks are protected not only by WEP encryption but additionally also by MAC filtering.If that is the case with your target network, you need to first discover a MAC address of an already associated user and then use that MAC address for your own authentication and association. Read the following two pages:
  How to break MAC filtering (wifi security)
How to change MAC - Macchanger
  Note,you will need to disable your network adapter before changing your MAC address and then enable it again, so it is an exercise that goes throughthe two pages referenced above as well as through point 1 and 2 again.
How do I find a MAC address?
  Remember,you need to find a client on the network that is already associated with your target access point. You can do so by executing the following command in your Ubuntu terminal window:
  sudo airodump-ng -c 11 --bssid 00:02:72:51:DB:28 -w wepdump -i wifi0
  where -c is the channel on which your target access point is broadcasting, BSSID is the MAC address of the access point, and -w wepdump -i (we will explain later).

  The screen will look similar to the screen above.
4. Start airodump-ng to collect the new unique IVs
  By now, you should have all the needed information about your target access point (name, MAC, channel, etc.), your MAC address changed to thesame address as some other client on the network, and your network interface set in Monitor mode. Now you want to start capturing all the new unique so-called Initialization Vectors (IVs) included in packets that go out of your access point. You can do this by starting airodump-ng on your access point channel with a BSSID filter (access point MAC address). Open new terminal window and do:
  sudo airodump-ng -c 11 --bssid 00:02:72:51:DB:28 -w wepdump -i wifi0
  Thisis the same command as in step 3. We used it in step 3 to find someone that is already using your wireless access point; now we use it to capture initialization vectors. The option -w wepdump is the name of file where you want to save your initialization vectors. Option -i means that you want to save initialization vectors only and discard all other data.
  The screen will look similar to the screen above in step 3.
5. Use aireplay-ng to do fake authentication with the access point
  Nowit is time to sort of "login" into your wireless network. In order for an access point to accept a packet, the source MAC address must already be associated. If the source MAC address you are injecting (later) is not associated with the access point then the access point ignores the packet and sends out a "DeAuthentication" packet in cleartext. In this state, no new initialization vectors are created because the access point is ignoring all the injected packets. The lack of association with the access point is the single biggest reason why packet injection fails. At this point you are just connectingto the access point and telling it you are here and want to talk to it.This does not give you any ability to transfer data. Open another terminal window and do:
  sudo aireplay-ng -1 0 -e datel -a 00:02:72:51:DB:28 -h 00:13:CE:EC:45:20 wifi0
  where -1 means fake authentication, 0 means reassociation timing in seconds, -e datel is the name of the network, -a is the access point MAC address, and -h is the MAC address under which you act (either your own or the spoofed one if you went through step 3).
  This is what the output should look like.

  Remember,the MAC address you target for injection must be associated with the access point by either using fake authentication or using a MAC address from an already-associated client (step 3), or both at best.
  Possible problem: If you get "Got a deauthentication packet"and then continuous retries, then you are probably dealing with MAC filtering (that is some access points are configured to only allow selected MAC addresses to associate and connect). Go back to step 3. If this is the case, you will not be able to successfully do fake authentication unless you know one of the MAC addresses on the allowed list.
  Possible problem: If you get "Waiting for beacon frame (BSSID: ...) No such BSSID available." then you are dealing with weak wifi signal. Get closer to the access point.
Sending Authentication Request [ACK]
  SendingAuthentication Request [ACK] that just keeps repeating on the aireplay-ng screen is another common problem. If you keep getting "Sending Authentication Request" or "Sending Association Request"that keep coming back, then you are too far away from the access point or are dealing with weak signal. Remember, the fact that you can capturepackets from the access point does not mean that the access point can also capture packets from your computer. The signal going out of your computer is much weaker.
  Also, check that you are communicating on the same wireless channel as the access point.
  Another problem can be that the access point utilizes MAC addressing and your MAC spoofing in step 3 did not go right. Run the ifconfig [adapter_name] and macchanger --show [adapter_name] commands to verify your computer is communicating using MAC address of some already authenticated user. (See the download Macchanger page, "How to verify" section for more details.)
  Insome cases, the access point is unable to communicate quickly enough with your computer. In this case, try to increase your delay and timing:
  sudo aireplay-ng -1 6000 -o 1 -q 10 -e datel -a 00:02:72:51:DB:28 -h 00:13:CE:EC:45:20 wifi0
  Some times, the fake authentication just does not work no matter what you do and you have to proceed without it.
5.1 WEP crack without packet injection
  Ifthe previous step fails in your case, and you are unable to do authentication with either a fake or your own MAC address, the next step6 - packet injection - will likely fail too. Try it out and see. If step 6 fails, return to this section. No worry, you can still crack WEP;it will just take more time. If you are unable to authenticate and as aresult do packet injection, you will be watching the screen which you opened in step 4 for a while.

  Yourgoal is to see at least 150,000 in the #Data column. If you look at theRXQ column in the print screen above, you can see there number 49. Thisvalue provides information about the quality of your wireless connection between the access point and your computer. Anything below 80is considered weak. If the number fluctuates a lot, you have weak signal as well.
  The RXQ value relates to the data stream going from the access point to your computer. Even if this number is above 80,the access point still may not be able to see your computer. This is the most common reason for fake authentication and packet injection to fail. If that is your case, just sit back and wait until the #Data column shows at least 150,000, and then try step 7 (WEP crack). Without authentication and packet injection, this process might take 1,5 - 2 hours. You can start trying WEP crack in step 7 as soon as the #Data reaches at least 80,000, but our experience is that WEP keys usually getcracked once having somewhere around 150,000 initiation vectors.
6. Start aireplay-ng in ARP request replay mode to inject packets
  To crack a WEP key for a wireless access point,we need to gather a lot of initialization vectors (IVs), ideally somewhere around 150,000 of them. Normal network traffic does not typically generate these initialization vectors very quickly. Theoretically, if you are patient, you can gather sufficient IVs to crack the WEP key by simply passively listening to the network traffic and saving them (step 5.1). Alternatively, you can use a technique called packet injection to actively speed up the process. Injection involves having the access point resend selected ARP packets (they include IVs) over and over very rapidly. Thisallows us to capture a large number of initialization vectors in a short period of time. So, the purpose of this step is to start aireplay-ng in a mode which listens for ARP requests then reinjects themback into the network. Open another terminal window and do:
  sudo aireplay-ng -3 -b 00:02:72:51:DB:28 -h 00:13:CE:EC:45:20 wifi0
  where -b is the access point MAC address, and -h is the MAC address under which you act (either your own or the spoofed one if you went through step 3).
  Thiscommand will start listening for ARP requests and when it hears one, aireplay-ng will immediately start injecting it. You can generate an ARPrequest by pinging some other client that is already associated.
  This is what the output should look like:

  Youcan confirm that you are injecting by checking your airodump-ng and aireplay-ng screens. The data packets should be increasing rapidly. The ”#/s” should be somewhere in the range of 300 to 400 data packets per second. It can as low as a 100/second and as high as a 500/second. The ARP packets and Sent packets should be increasing rapidly as well.
  Possible problem:Note, if the ARP packets count and the Sent count as well are stuck at zero, then your network interface is likely not associated with your access point. Or, you can also be too far away from the access point (weak signal).
  Possible problem: Message similar to "Got a deauth/disassoc packet. Is the source mac associated?" means you have lost association with the access point. Go back to your other window from step 5 and rerun fake authentication. This is not necessary if you went through step 3 though.
7. Run aircrack-ng to crack the WEP key using the IVs collected
  Once youhave captured a large number of initialization vectors, you can use them to determine the WEP key. There are two basic methods for cracking WEP: the PTW method and the FMS/Korek method.
  To crack the WEP open another terminal window and execute the following commands:
  sudo aircrack-ng -z -b 00:1A:92:77:BB:D9 wepdump*.ivs
sudo aircrack-ng -a 1 -0 -n 128 wepdump*.ivs
  where -z invokes the PTW WEP-cracking method, -b selects the access point we are interested in, wepdump*.ivs selects all files starting with "wepdump" and ending in ".ivs" (this comes from your airodump-ng command earlier), -a denotes FMS/KoreK attack, and -nselects the type of WEP key (128-bit in our case). These commands will calculate WEP key from the captured initialization vectors. This is whatthe output looks like:

  You made it! Interested in more fun stuff? Read the following two articles:
  How to find MAC and IP addresses in network data
How to break MAC filtering
  Nowthat you know how to break into a WEP-protected network and therefore have discovered the weak link in your wifi network, we would also like to draw your attention to our security tutorials. We have written a few tutorials related to wireless network security. You can read more about IPSec, VPN, MAC addressing, WPA, WPA2, PSK, and many other wireless security measures. Our wireless security tutorials help you to make your network more secure.
  And lastly, if you need more help with How to crack WEP, feel free to discuss in our IT discussion forum.We also suggest that you check the Related Content section in the right-hand side bar on this page. You can also find some help here:
  
  http://www.maxi-pedia.com/crack+WEP

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-121022-1-1.html 上篇帖子: android——wifi系统架构 下篇帖子: iOS WIFI
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表