![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=1739284532-X0qEopi2a8EWwqQBXdKsJZS1vdCNqshi-0-2e72a408476257baeacfb9c0b69a6741)
- 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=1739284532-32kD17X8CtRkOszjglyJlFzlHkfmcDPL-0-a2ba89a53785e10fe83036d5b95c8d5f)
- 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=1739284532-nvqG5hMDqrqdYUkbwbikQd27DwDvrXoJ-0-525814ed15391bf27fb96ca02cdb8f3e)
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.