官术网_书友最值得收藏!

Scripting in Kali Linux

Kali Linux is relatively verbose—you can leverage bash scripting to create complex scripts, which you can then leverage for penetration testing.

A sample script that performs a Nmap scan is as follows:

read -p "Target IP/Range: " $targetIP
echo "$targetIP"
Nmap -sS -O -v "$targetIP"

In this script, we are telling the system to print out the read -p "Target IP/Range: text, which we tie to the variable of $targetIP. In the next line, we are displaying the IP range using the echo command, which is passed as an argument. In the last line, we perform a simple Nmap scan, using the switches of -sS, which performs a TCP SYN port scan; the -O, which performs remote operating system detection; and -vwhich increases the verbosity level, as shown in Figure 23:

Figure 23: A sample Nmap script

During the course of this book, we will explore additional scripts (for example, in Chapter 3, Performing Information Gathering, using a script to search Shodan, and more). As you progress on your penetration testing journey, you will likely develop your own useful list of scripts.

主站蜘蛛池模板: 宜昌市| 凉山| 稷山县| 乌审旗| 宁都县| 西城区| 山东省| 双柏县| 大化| 鄂尔多斯市| 汝南县| 景洪市| 九寨沟县| 普安县| 旬阳县| 新和县| 阳朔县| 庆云县| 同江市| 邓州市| 右玉县| 墨江| 环江| 儋州市| 桐柏县| 顺义区| 灵璧县| 陇南市| 苍梧县| 四子王旗| 通渭县| 瓦房店市| 新邵县| 长阳| 永州市| 大洼县| 万盛区| 繁峙县| 庐江县| 威远县| 平山县|