![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=1738835100-6pcFxlDMk6jKQVx2euN63rlRlbBiRuHS-0-fcb196242ea071676d8e3e5bd0fce24e)
- 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=1738835100-0kf8D6Div0nKOvjrXoOspyyChNJMD3H2-0-a6c67a45326c5f25e98800f02570689b)
- 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=1738835100-HDCxe78fhhOUMwOFYQax3OeIToAB92Gu-0-90a6b6b6bb5c21feeada381b52761f8a)
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.