在 boofuzz 中,我试图根据从 s_group 中选择的值创建嵌套的 s_block。
我遇到两个错误,1)BLOCK NAME ALREADY EXISTS: 1,
当我尝试使用两个具有相同操作码的组时。我有一个外部 s_group 包含可能的操作码值 ["1", "2", "3"] 和内部 s_group 具有可能的值 ["1", "2"]
2) 我想使用 s_block 中的值来依赖于 s_group 中选择的值。
我正在使用的代码如下: -
s_initialize(name="LOGIN-RQ")
with s_block("LOGIN"):
s_group("Priority", ["1","2","3"])
if(s_block_start("1", dep="Priority", dep_value="1", dep_compare="==")):
# handle '1' - for A priority
s_static("A")
s_group("Type", ["1","2"])
# handle '11 - for A priority Emergency'
if(s_block_start("1", dep="Type", dep_value="1", dep_compare="==")):
s_static("Emergency")
s_static("#")
s_string("1ab121-2345-2212-123ad21") # auth id
s_static("#")
s_static("Registered")
s_block_end()
if(s_block_start("2", dep_value="2", dep_compare="==")):
s_static("Frequent")
s_block_end()
s_block_end()
if(s_block_start("2", dep="Priority", dep_value="2", dep_compare="==")):
s_static("B")
s_block_end()
if(s_block_start("3")):
s_static("C")
s_group("Category", ["1","2"])
if(s_block_start("1", dep="Category", dep_value="1", dep_compare="==")):
s_static("Anonymous")
# handle anonymous category
s_block_end()
if(s_block_start("2", dep="Category", dep_value="2", dep_compare="==")):
s_static("Registered")
s_block_end()
s_block_end()
session.connect(session.root, s_get("LOGIN-RQ"))
session.fuzz()
预期可能的结果:-
1A1Emergency#1ab121-2345-2212-123ad21#Registered
1A2Frequent
2B
3C1Anonymous
3C2Registered
请帮助