This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/multi_step/b_Hijack_Tests.robot

220 lines
20 KiB
Plaintext
Raw Normal View History

2020-07-29 20:20:03 +08:00
*** Settings ***
Force Tags tsg_adc_wp proxy_policy adc_verify
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
2021-02-03 21:01:12 +08:00
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../03-Variable/ApplicationID.txt
Resource ../../../05-Other/AllFlowCaseVariable.txt
2020-07-29 20:20:03 +08:00
*** Test Cases ***
Proxy-Policy-hijack-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
... ELSE Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-03 21:01:12 +08:00
Comment 改变拦截策略
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-hijack-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${hijack_objectId43}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
Comment 改变Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-hijack-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId},"protocol":"HTTP"} filterList=${hijack_objectId43}|TSG_FIELD_HTTP_HOST,${hijack_objectId39}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
2021-02-03 21:01:12 +08:00
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
sleep 5
2021-02-03 21:01:12 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00001.bat
... ELSE set variable curl -kv https://vator.tv/news
2021-02-03 21:01:12 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
... ELSE Create List 6b72:f91d:6f81:bfcd:5b0f:e81d:f827:e075 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 失效拦截策略
${policyDict} Create Dictionary policyId=${intercept_hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-hijack-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${hijack_objectId43}|TSG_FIELD_SSL_SNI isValid=${0} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 失效hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId} source=${hijack_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-hijack-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId},"protocol":"HTTP"} filterList=${hijack_objectId43}|TSG_FIELD_HTTP_HOST,${hijack_objectId39}|TSG_FIELD_HTTP_URL isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
2020-07-29 20:20:03 +08:00
Proxy-Policy-hijack-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00002.bat
2021-02-03 21:01:12 +08:00
... ELSE set variable curl -kv https://www.uqur.cn/index_0.shtml
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00003
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003.bat
2021-02-03 21:01:12 +08:00
... ELSE set variable curl -kv https://www.lexus.ru/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_1.bat
2021-02-03 21:01:12 +08:00
... ELSE set variable curl -kv https://oktrucking.org/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_2.bat
2021-02-03 21:01:12 +08:00
... ELSE set variable curl -kv https://www.federalsignal.com/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_3.bat
2021-02-03 21:01:12 +08:00
... ELSE set variable curl -kv https://peasedev.org/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00003_3.bat
... ELSE set variable curl -kv https://peasedev.org/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.huoshan.com/greenlive/union_hall/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-03 21:01:12 +08:00
Comment 改变重Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId3} policyName=Proxy-Policy-hijack-00004-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId3},"protocol":"HTTP"} filterList=${hijack_objectId44}|TSG_FIELD_HTTP_URL,${hijack_objectId45}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00004.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.huoshan.com/greenlive/union_hall/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
2020-07-29 20:20:03 +08:00
Proxy-Policy-hijack-00005
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00005.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.ixigua.com/channel/dianying/
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00006
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00006.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.dcdapp.com/?zt=dongchediapp
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00007
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00007.bat
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gogokid.com.cn/teacher
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-2.gif Tango Secure Gateway CA
... ELSE Create List test-2.gif Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00008
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00008.bat
... ELSE set variable curl http://www.mafengwo.cn/mdd/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
2021-02-03 21:01:12 +08:00
Comment 改变重Hijack策略
${policyDict} Create Dictionary policyId=${hijack_policyId7} policyName=Proxy-Policy-hijack-00008-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"hijack","hijack_profile":${hijack_profileId7},"protocol":"HTTP"} filterList=${hijack_objectId17}|TSG_FIELD_HTTP_URL,${hijack_objectId46}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00008.bat
... ELSE set variable curl http://www.mafengwo.cn/mdd/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
2020-07-29 20:20:03 +08:00
Proxy-Policy-hijack-00009
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00009.bat
... ELSE set variable curl -kv http://quote.hexun.com/default.htm#forex
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00010
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00010.bat
... ELSE set variable curl http://chaxun.1616.net/jiemeng.htm
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动
... ELSE Create List 控制小蛇在地图范围内移动
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00011
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00011.bat
... ELSE set variable curl http://www.airwargame.com/eng/start/
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00011.bat
... ELSE set variable curl http://www.airwargame.com/eng/start/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00012
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.reval.com/corporates/
sleep 3
2020-07-29 20:20:03 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00012.bat
... ELSE set variable curl -kv --cookie "lQfQ_2132_saltkey=t8WY1oPe; lQfQ_2132_lastvisit=1595381790; lQfQ_2132_sid=vqXOg6; lQfQ_2132_lastact=1595385400%09forum.php%09image" --referer 'https://www.baidu.com/' \ https://www.reval.com/corporates/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List bFiles-test-5.png Tango Secure Gateway CA
... ELSE Create List bFiles-test-5.png Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00013
2021-02-03 21:01:12 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
2020-07-29 20:20:03 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013.bat
... ELSE set variable curl -kv https://nsscreencast.com/episodes
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_1.bat
... ELSE set variable curl -kv https://www.edreams.net/merch/trends/
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_2.bat
... ELSE set variable curl -kv https://boutiquehotel.me/paris/
2021-02-03 21:01:12 +08:00
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_2.bat
... ELSE set variable curl -kv https://boutiquehotel.me/paris/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00013_3.bat
... ELSE set variable curl -kv https://www.united.com/zh-hans/cn
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-4.jpeg Tango Secure Gateway CA
... ELSE Create List test-4.jpeg Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}
Proxy-Policy-hijack-00014
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_hijack_00014.bat
... ELSE set variable curl -kv \ --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" \ --cookie "__cfduid=d5c21129d57e7124b729fd86dc82abdcd1596020306; __stripe_sid=2940d4d5-6822-4daf-8b38-9cd18d745beb; __stripe_mid=dd118cd8-845c-4b6e-98ce-81e8d5bdd52c" --referer 'https://www.baidu.com/' \ https://www.travelzoo.com/cn/collections/hotels/ihg-group-meta/
2020-07-29 20:20:03 +08:00
${stringlist} run keyword if '${systemType}'=='Windows' Create List test-2.gif Tango Secure Gateway CA
... ELSE Create List test-2.gif Tango Secure Gateway CA
${rescode} SystemCommands ${commandstr} ${stringlist}