![Kali Linux:An Ethical Hacker's Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/772/36698772/b_36698772.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
Let's perform the following steps:
- Run the following command to install brutespray on Kali:
apt install brutespray
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/2ccabb61-de14-488f-9806-162a42f8598b.png?sign=1738855890-ogZdOBZdaPvNMqIaQTrMLaZR3d3RU46y-0-ac0aadd4011e2671ac54adce14cb9498)
- Once it is installed, we can run the tool with the -h flag to view the list of all features.
- To run a default brute force on all of the services that were discovered by a previously run Nmap scan, we can use the following command:
brutespray --file scan.xml --threads 5
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/f8459907-aaa3-411e-bfa2-5107ff2fa81b.png?sign=1738855890-odx0PejDF77ks1ChzZPg7fqtoGgQrgYb-0-d1337d94ee818838d3eb998ac4a37422)
- To run the tool on one particular service, we can use the -s flag and define the service we want to perform a brute force attack on. In the following example, we will use the Nmap scan that was done on a host and only check the default credentials on the FTP service:
brutespray -file scan.xml -t 5 -s ftp
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/cf1fe93d-f753-4f74-984d-340198c73ee3.png?sign=1738855890-xbsMLG0COojvMb1q0EIcWdrU430aDtO4-0-b7de2d2d1cf7dcb80e4ff87ee721fa0f)
In the preceding screenshot, we can see that the FTP allows anonymous login, which is why the tool gave a success output for the credentials that were shown.