我正在学习一本书:实用安全自动化和测试。在124页上有一个脚本,该脚本将RIDE与SSHLibrary一起使用。
但我使用的是Eclipse,所以我尝试安装它。
pip安装轮
pip install --升级robotframework-sshlibrary
成功了,现在您可以开始编辑.robot脚本了。
我做到了这一点:(所以它与书中的不同,但这适用于Eclipse)
*** Settings ***
Library SSHLibrary
*** Variables ***
${HOST_URL} http://demo.testfire.net
${output}= Execute Command python sqlmap.py -u ${HOST_URL} --batch --banner
*** Test Cases ***
SQL Injection Testing
Should Not Contain ${output} vulnerable现在的问题是:它显示‘通过’,但当我在我确信它会失败的地方修改host_url时,它也显示‘通过’。换句话说:它似乎不检查或做任何事情。
我不知道我做错了什么。需要帮助。
发布于 2020-07-30 13:21:00
您根本没有执行该命令-不能在Variables部分中调用关键字。这行在这里
*** Variables ***
${HOST_URL} http://demo.testfire.net
${output}= Execute Command python sqlmap.py -u ${HOST_URL} --batch --banner将只创建一个包含该内容的字符串变量。将其移动到案例中(或在其自身的关键字中)
*** Test Cases ***
SQL Injection Testing
${output}= Execute Command python sqlmap.py -u ${HOST_URL} --batch --banner
Should Not Contain ${output} vulnerable发布于 2020-07-31 01:05:53
我混合了124页和126页的内容(本书:实用安全自动化和测试)
126页有一个错误。游乐设施图像的代码实际上是RBFW的代码。
这就是它是如何在没有错误的情况下出现的:
*** Settings ***
Library SSHLibrary
Library Collections
Library String
Library RequestsLibrary
Library OperatingSystem
*** Variables ***
${HOST_URL} http://demo.testfire.net
${url} http://demo.testfire.net
${SpiderScan} http://localhost:8090/JSON/spider/action/scan/?zapapiformat=JSON&formatMethod=GETurl=${url}&maxChildren=&recurse=&ontextName=&subtreeOnly=
*** Test Cases ***
SQL Injection Testing
Get Connection host=http://demo.testfire.net
${output}= Execute Command python sqlmap.py -u ${HOST_URL} --batch --banner
Should Not Contain ${output} vulnerable
ZAP Spider Scan
[Tags] get skip
Create session ZAP ${SpiderScan}
${resp}= Get Request ZAP /
Should Be Equal As Strings ${resp.status_code} 200https://stackoverflow.com/questions/63150406
复制相似问题