|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
其实就是类似网络封包拦截修改的流氓软件,只是研究下相关技术。 还有浏览器不是自己写,最后一个包recv中指定buflen最大1024字节,但是好像不能返回8192字节数据。 |
|
[讨论]新人报道求眼熟
临时会员申请转正! |
|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
Get请求包中,把gzip编码去掉,直接修改明文,应该没什么问题。 如果不去掉gzip编码,不知道能否修改网页内容? 假设打开一个网页,分8次返回8192字节的数据,每次返回1024字节。 浏览器每调用一次recv函数,就执行一次WSPRecv函数, recv函数指定一个buf和buflen,buflen指定1024字节(分8次调用recv函数); int WSPAPI WSPRecv(......) { int iRet = NextProcTable.lpWSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno); lpBuffers返回负载数据 lpNumberOfBytesRecvd返回已成功接收的负载长度 } 如果在收到第一个200 OK消息后,WSPRecv函数不返回,在循环调用7次NextProcTable.lpWSPRecv,收到完整gzip包, gzip解码,修改明文,重新编码后,分8次向lpBuffers拷贝修改后的gzip数据(修改后gzip数据总长度不超过8192字节)。 不知道这样是否可行? |
|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
调用NextProcTable.lpWSPRecv后接收缓冲区lpBuffers才被填充内容,在此之前lpBuffers->buf中不是有效的内容。 若要对接收包追加数据可能不行,因为接收缓冲区的大小位置是由应用程序(IE)提供的。 WSPRecv是由IE的recv函数调用的,它只会读取它设定的大小。 //////////////////////////////////////////////////////////////////////////////////////////// //收到第一个200 OK包后,循环调用NextProcTable.lpWSPRecv,收到完整包后WSPRecv函数才返回 int WSPAPI WSPRecv(......) { int iRet = NextProcTable.lpWSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno); 假设本地IE在5060端口,分8次收到8192字节数据,每次接收1024字节(recv中指定buf和buflen) 收到200 OK包后,继续循环调用NextProcTable.lpWSPRecv,接收其他8192-1024=7168字节数据,才让WSPRecv函数返回。 收到完整包后,后面再进入WSPRecv没有本地端口是5060的Socket。 不能把接收的所有完整包,一次都返回给IE,因为返回的数据包长度不能超过recv指定的长度。 } //////////////////////////////////////////////////////////////////////////////////////////// //收到第一个200 OK包开始,到收到完整包结束,都返回SOCKET_ERROR int WSPAPI WSPRecv(......) { int iRet = NextProcTable.lpWSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno); 假设本地IE在5060端口,分8次收到8192字节数据,每次接收1024字节(recv中指定buf和buflen) 收到200 OK包后,修改读取的数据长度和错误码,并且返回SOCKET_ERROR *lpNumberOfBytesRecvd = 0; *lpErrno = WSA_IO_PENDING; 收到完整包后,后面再进入WSPRecv没有本地端口是5060的Socket。 不能把接收的所有完整包,一次都返回给IE,因为返回的数据包长度不能超过recv指定的长度。 } //////////////////////////////////////////////////////////////////////////////////////////// |
|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
调用NextProcTable.lpWSPRecv后接收缓冲区lpBuffers才被填充内容,在此之前lpBuffers->buf中不是有效的内容。 若要对接收包追加数据可能不行,因为接收缓冲区的大小位置是由应用程序(IE)提供的。 WSPRecv是由IE的recv函数调用的,它只会读取它设定的大小。 int WSPAPI WSPRecv(......) { int iRet = NextProcTable.lpWSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno); lpBuffers返回负载数据 lpNumberOfBytesRecvd返回已成功接收的负载长度 收到200 OK的包后,该函数不返回,继续循环调用7次NextProcTable.lpWSPRecv,收到完整的包后,至多返回1024字节数据(IE的recv函数中指定的大小) 后面再进入WSPRecv,执行NextProcTable.lpWSPRecv函数,负载数据就收不到了,因为前面在一次调用WSPRecv后,强制调用了7次NextProcTable.lpWSPRecv。 } |
|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
=================== 解析出https包,如果不走代理转发模式,估计是不可能解析出来的。 基于本地浏览器代理转发模式的Fiddler(官网有C#语言源码和开发包),是可以实时解析https报文。 |
|
[求助]基于SPI的WSPRecv能否重组和修改网络封包?
Get请求包中,把gzip编码去掉,直接修改明文,应该没什么问题。 如果不去掉gzip编码,不知道能否修改网页内容? 假设打开一个网页,分8次返回8192字节的数据,每次返回1024字节。 浏览器每调用一次recv函数,就执行一次WSPRecv函数, recv函数指定一个buf和buflen,buflen指定1024字节(分8次调用recv函数); int WSPAPI WSPRecv(......) { int iRet = NextProcTable.lpWSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno); lpBuffers返回负载数据 lpNumberOfBytesRecvd返回已成功接收的负载长度 } 如果在收到第一个200 OK消息后,WSPRecv函数不返回,在循环调用7次NextProcTable.lpWSPRecv,收到完整gzip包, gzip解码,修改明文,重新编码后,分8次向lpBuffers拷贝修改后的gzip数据(修改后gzip数据总长度不超过8192字节)。 不知道这样是否可行? |
|
[求助]基于SPI的WSPRecv接收数据包,返回数据长度有问题!
重新用WireShark抓包看了下,是之前拦截数据包时用miniSniffer抓的包有问题。 WSPSend和WSPRecv拦截的收发包,没有问题。 |
|
[求助]基于SPI的WSPRecv接收数据包,返回数据长度有问题!
接收数据包时发现WSPSelect也被调用 每次进入WSPRecv判断都不是IO重叠模式 if (!lpOverlapped && !lpCompletionRoutine) { } |
|
转正发贴
转正了,恭喜。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值