51Testing软件测试论坛
标题:
关于SOCKET参数化的一个实际应用问题
[打印本页]
作者:
断寒
时间:
2009-8-14 11:02
标题:
关于SOCKET参数化的一个实际应用问题
lr_start_transaction("建立数据库连接");
lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=192.168.66.21:2383", LrsLastArg);
lrs_send("socket1", "buf3", LrsLastArg);
lrs_receive("socket1", "buf4", LrsLastArg);
lrs_save_searched_string("socket1", LRS_LAST_RECEIVED, "Parameter1", "LB/BIN=<SspiHandshake>", "RB/BIN=</SspiHandshake>", 1, 0, -1);
lrs_save_searched_string("socket1", LRS_LAST_RECEIVED, "Parameter2", "LB/BIN=</soap:Body></soap:Envelope>", NULL, 1, 0, 1);
lrs_send("socket1", "buf5", LrsLastArg);
lrs_receive("socket1", "buf6", LrsLastArg);
......
中间省略大约10组lrs_send与lrs_receive
lr_end_transaction("建立数据库连接", LR_AUTO);
以下是buf3,buf4,buf5,buf6的信息,储存在data.ws中:
send buf3 316
"\x0e\x10\x00\x04\x00\x00\x00"
"\b"
"\x00\x00\x01"
"\""
"\x18\x00\x00\x00"
"text/xml<soap:Envelope xmlns:soap=\"
http://schemas.xmlsoap.org/soap/envelo
"
"pe/\"><soap:Body><Authenticate xmlns=\"
http://schemas.microsoft.com/analys
"
"isservices/2003/ext\"><SspiHandshake>TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAA"
"AAAAAAFASgKAAAADw== \n"
"</SspiHandshake></Authenticate></soap:Body></soap:Envelope>"
"\x00\x00"
recv buf4 504
"\x0e\x10\x00\x04\x00\x00\x00"
"\b"
"\x00\x00\x01\xdf\x18\x00\x00\x00"
"text/xml<soap:Envelope xmlns:soap=\"
http://schemas.xmlsoap.org/soap/envelo
"
"pe/\"><soap:Body><AuthenticateResponse xmlns=\"
http://schemas.microsoft.co
"
"m/analysisservices/2003/ext\"><return><SspiHandshake>TlRMTVNTUAACAAAAEAAQA"
"DgAAAA1goricoZLJwyNzFkAAAAAAAAAAFQAVABIAAAABQLODgAAAA9E \n"
"AEMAUwBFAFIAVgBFAFIAAgAQAEQAQwBTAEUAUgBWAEUAUgABABAARABDAFMARQBSAFYARQBSAA"
"QA \n"
"EABkAGMAcwBlAHIAdgBlAHIAAwAQAGQAYwBzAGUAcgB2AGUAcgAAAAAA \n"
"</SspiHandshake></return></AuthenticateResponse></soap:Body></soap:Envelop"
"e>G"
send buf5 524
"\x0e\x10\x00\x04\x00\x00\x00"
"\b"
"\x00\x00\x01\xf4\x19\x00\x00\x00"
"text/xml<soap:Envelope xmlns:soap=\"
http://schemas.xmlsoap.org/soap/envelo
"
"pe/\"><soap:Body><Authenticate xmlns=\"
http://schemas.microsoft.com/analys
"
"isservices/2003/ext\"><SspiHandshake>TlRMTVNTUAADAAAAGAAYAIIAAAAYABgAmgAAA"
"BAAEABIAAAAGgAaAFgAAAAQABAAcgAAABAAEACy \n"
"AAAANYKI4gUBKAoAAAAPVwBBAE4ARwBSAE8ATgBHAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAH"
"IA \n"
"VwBBAE4ARwBSAE8ATgBHAAB6DHpBvFa2AAAAAAAAAAAAAAAAAAAAAIJt4pOb73mIR48zywWfH4"
"7J \n"
"bkF3U6raAmC8c/EExCLOF32ky4Y9Ih8= \n"
"</SspiHandshake></Authenticate></soap:Body></soap:Envelope>"
recv buf6 396
"\x0e\x10\x00\x04\x00\x00\x00\x15\x00\x00\x01"
"a"
"\x18\x00\x00\x00"
"application/sx+xpress"
"\x00"
"悙o"
"\x02\x00\x00"
"Y"
"\x01\x00\x00\x00\x00\x00\x00\xdf\xff\x01\xb0\x04\xfe\x03"
"1"
"\x00"
"."
"\x00"
"0"
"\x00\xfd\x06"
"U"
"\x00"
"T"
"\x00"
"F"
"\x00"
"-"
"\x00"
"1"
"\x00"
"6"
"\x00\x00\xf0"
")h"
"\x00"
"T"
"\x11\x00"
"At\b"
"\x00"
"p"
"\x00"
":"
"\x00"
"/\b"
"\x00"
"s"
"\x00"
"c"
"\x00"
"h"
"\x00"
"e"
"\x00"
"m"
"\x00"
"aX"
"\x00"
"."
"\x00"
"xH"
"\x00"
"lH"
"\x00"
"ox"
"\x00"
"px"
"\x00"
"o"
"\x00\x00\x11"
"*"
"\x1a"
"r"
"\x00"
"g:"
"\x01\x8b\x00"
"/X"
"\x01"
"n"
"\x00"
"v("
"\x00"
"l"
"\x88\x00"
"p8"
"\x00"
"/"
"\x00\xf0\x04\xed\x00\xf0"
"\bE"
"\xef\x00"
"躏"
"\x01\x02\x03\xf8\x01\xf0"
"\n"
"\x04\x00\x05"
""
"\x02"
"n8"
"\x02"
":"
"\x18\x00"
"k"
"\x01\xef\x00\x04\x00\xf6\x02\x0e\x8f\x04"
"<BX"
"\x00"
"d"
"\x00"
"y"
"\x00\xef\x01\x02\x05"
"貘"
"\x03\xf0"
"6'"
"\x03\xff\x05"
"m"
"\x00"
"猌i"
"\x88\x00"
"r"
"\xa0\x01\xb1\x02"
"fH"
"\x01"
".x"
"\x00"
"o"
"\xb8\x00"
"/\b"
"\x01"
"n"
"\x18\x00"
"l`"
"\x02"
"s("
"\x01"
"s\b"
"\x00"
"eH"
"\x01"
"vX"
"\x00"
"cH"
"\x00"
"s\b"
"\x01"
"28\v0阿\r("
"\x00"
"3H"
"\x00"
"ep"
"\x05"
"t"
"\x00\xf0\x14"
"A"
"\x00"
"u8"
"\x00"
"\t"
"\x03"
"n8"
"\x00"
"I"
"\x01"
"a8"
"\x00"
"e"
"\x00"
"R"
"\x18\x00"
"s("
"\x04"
"o"
"\xb8\x00"
"9"
"\x02\xef\x06\x00\x07\x05\xac\x04"
"\f"
"\xf8\x04\xf0\x05"
"#"
"\x07\x99\x00\xef\x00"
"\b"
"\x00\xf6\x05\x0e\x7f\x05"
"U"
"\x06"
"rH"
"\x00"
"t"
"\x98\x05"
"r"
"\xd8\x01\x98\x04"
"\t貘"
"\x06\xf0"
"\rS`"
"\x01"
"p"
"\xb0\x01\xff\x07"
"`THp"
"\x02"
"nh\n"
"s"
"\x10\x04"
"a"
"\x00"
"kP"
"\x01\x10\x01"
"\n"
"\xf8\x07"
"\f"
"\x00"
"鼢鼢鼹"
"\x81"
"\t"
[
本帖最后由 断寒 于 2009-8-14 11:05 编辑
]
作者:
smilecoffee
时间:
2009-8-14 11:08
呵呵,没用过socket,学习学习,
作者:
断寒
时间:
2009-8-14 11:10
问题是:
第1个lrs_send中使用的buf3一直是不变的,获取的buf4直接关联就能执行通过,
第2个lrs_send中使用的buf5每次录制得到的data都不一样,看不出有什么规律,都是一组乱排序的字符串.这个时候怎么对buf5进行参数化??
以下我在附上几次录制时buf5的data:
send buf5 524
"\x0e\x10\x00\x04\x00\x00\x00"
"\b"
"\x00\x00\x01\xf4\x19\x00\x00\x00"
"text/xml<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelo"
"pe/\"><soap:Body><Authenticate xmlns=\"http://schemas.microsoft.com/analys"
"isservices/2003/ext\"><SspiHandshake>TlRMTVNTUAADAAAAGAAYAIIAAAAYABgAmgAAA"
"BAAEABIAAAAGgAaAFgAAAAQABAAcgAAABAAEACy \n"
"AAAANYKI4gUBKAoAAAAPVwBBAE4ARwBSAE8ATgBHAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAH"
"IA \n"
"VwBBAE4ARwBSAE8ATgBHACYbiK519akbAAAAAAAAAAAAAAAAAAAAAPfwp4xBDOiIH00shIH4w+"
"54 \n"
"JmuK1PIX82X46vFeCM7y8bPzLatZ0Oo= \n"
"</SspiHandshake></Authenticate></soap:Body></soap:Envelope>"
send buf5 524
"\x0e\x10\x00\x04\x00\x00\x00"
"\b"
"\x00\x00\x01\xf4\x19\x00\x00\x00"
"text/xml<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelo"
"pe/\"><soap:Body><Authenticate xmlns=\"http://schemas.microsoft.com/analys"
"isservices/2003/ext\"><SspiHandshake>TlRMTVNTUAADAAAAGAAYAIIAAAAYABgAmgAAA"
"BAAEABIAAAAGgAaAFgAAAAQABAAcgAAABAAEACy \n"
"AAAANYKI4gUBKAoAAAAPVwBBAE4ARwBSAE8ATgBHAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAH"
"IA \n"
"VwBBAE4ARwBSAE8ATgBHAC2Dvna63ia7AAAAAAAAAAAAAAAAAAAAABNCdHQu6nuCYlmKGWyZoF"
"Ny \n"
"oyuLrP6a1Dx6wN9K/yozn3uCjZki/1E= \n"
"</SspiHandshake></Authenticate></soap:Body></soap:Envelope>"
作者:
断寒
时间:
2009-8-14 11:20
录制的socket连接的data中可以看出有SspiHandshake,这个是MS的安全支持提供器接口所使用的一个交互接口,里面的传输数据都是经过加密的,这个时候怎么参数化?
作者:
lijian422202
时间:
2009-8-14 12:58
首先从你的脚本中看到好象可以用webservice来做,一般来说最好用上层协议来完成测试;如果一定要用socket参数化的话,就需要找到MS提供的接口(我想应该是一个DLL),然后调用它,得到加密数据,然后通过lr_save_string的方式参数化
作者:
caiw0418
时间:
2010-12-2 17:09
回复
5#
lijian422202
怎么调用 能否说具体点
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2