某 .NET RabbitMQ SDK 有采集行為,你怎么看?( 二 )

0:013> !U 067c835fNormal JIT generated codeSystem.Base.ApplicationContext+<>c.<HashObjectMap>b__19_0()Begin 067c7ed8, size 584...067c8333 8b3d74361904movedi,dword ptr ds:[4193674h] (Object: System.Runtime.Remoting.Proxies.__TransparentProxy)067c8339 ff75b0pushdword ptr [ebp-50h]067c833c ff75acpushdword ptr [ebp-54h]067c833f ff75a8pushdword ptr [ebp-58h]067c8342 ff75a4pushdword ptr [ebp-5Ch]067c8345 ff75a0pushdword ptr [ebp-60h]067c8348 b94e080000movecx,84Eh067c834d ff15b05d7a06calldword ptr ds:[67A5DB0h] (System.Base.ApplicationContext+<>c.zmMLEYhjSCTVEl2CxBD(Int32), mdToken: 0600009e)067c8353 50pusheax067c8354 8b55b4movedx,dword ptr [ebp-4Ch]067c8357 8bcfmovecx,edi067c8359 ff15d8016d00calldword ptr ds:[6D01D8h]...原來是 <HashObjectMap>b__19_0 方法做的調用,也就是 call dword ptr ds:[6D01D8h],不信的話可以截圖看源碼:

某 .NET RabbitMQ SDK 有采集行為,你怎么看?

文章插圖
從混淆的代碼看,有幾個特征:
  • aa 依賴于 n9UuXCvGC
  • bb 依賴于 gY03KpyvZ
  • cc 依賴于 GsvWjQg1p
  • hh 依賴于 text
等等,那怎么提取呢? 這里只演示一個 aa 參數吧,可以在匯編代碼的第一個 x4phG7d0qxdP1ZxlQa.pliOsRbOU 方法上下一個斷點,即 067c820b 處觀察方法參數,下斷點后,讓程序回流 。
0:013> !U 067c8359Normal JIT generated codeSystem.Base.ApplicationContext+<>c.<HashObjectMap>b__19_0()...067c8206 50pusheax067c8207 8bd3movedx,ebx067c8209 8bcfmovecx,edi067c820b ff15e8667a06calldword ptr ds:[67A66E8h] (System.Base.ApplicationContext+x4phG7d0qxdP1ZxlQa.pliOsRbOU(System.String, System.String, System.String), mdToken: 0600003e)067c8211 8945b4movdword ptr [ebp-4Ch],eax...0:013> bp 067c820b0:013> g-Breakpoint 1 hitTime Travel Position: 117A27:A80eax=032c0ca4 ebx=032bf94c ecx=0329e558 edx=032bf94c esi=032bea78 edi=0329e558eip=067c820b esp=079bf640 ebp=079bf6a8 iopl=0nv up ei pl zr na pe nccs=0023ss=002bds=002bes=002bfs=0053gs=002befl=00000246067c820b ff15e8667a06calldword ptr ds:[67A66E8h] ds:002b:067a66e8=067cdf000:013> ub 067c820b067c81ef 8945b8movdword ptr [ebp-48h],eax067c81f2 8b3d68361904movedi,dword ptr ds:[4193668h]067c81f8 8b5e08movebx,dword ptr [esi+8]067c81fb b914040000movecx,414h067c8200 ff15b0647a06calldword ptr ds:[67A64B0h]067c8206 50pusheax067c8207 8bd3movedx,ebx067c8209 8bcfmovecx,edi上面輸出的 ecx, edx, eax 分別就是 pliOsRbOU() 方法的三個參數 。
0:013> !do ecxName:System.StringMethodTable: 7ad924e4EEClass:7ae97690Size:40(0x28) bytesFile:C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dllString:192.168.0.106Fields:MTFieldOffsetType VTAttrValue Name7ad942a840002834System.Int321 instance13 m_stringLength7ad92c9c40002848System.Char1 instance31 m_firstChar7ad924e4400028870System.String0sharedstatic Empty>> Domain:Value00b0bce8:NotInit<<0:013> !do edxName:System.StringMethodTable: 7ad924e4EEClass:7ae97690Size:46(0x2e) bytesFile:C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dllString:N8CDEFGH+JKLM..PFields:MTFieldOffsetType VTAttrValue Name7ad942a840002834System.Int321 instance16 m_stringLength7ad92c9c40002848System.Char1 instance4e m_firstChar7ad924e4400028870System.String0sharedstatic Empty>> Domain:Value00b0bce8:NotInit<<0:013> !do eaxName:System.StringMethodTable: 7ad924e4EEClass:7ae97690Size:32(0x20) bytesFile:C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dllString:TripleDESFields:MTFieldOffsetType VTAttrValue Name7ad942a840002834System.Int321 instance9 m_stringLength7ad92c9c40002848System.Char1 instance54 m_firstChar7ad924e4400028870System.String0sharedstatic Empty>> Domain:Value00b0bce8:NotInit<<從輸出中可以看到 , aa 參數原來提取了我的 ip 地址,用同樣的方式可以提取出所有的方法參數,這里就不詳述了 , 我做了一個整理,截圖如下:
【某 .NET RabbitMQ SDK 有采集行為,你怎么看?】
某 .NET RabbitMQ SDK 有采集行為,你怎么看?

文章插圖
從圖中可以看到: AssistLog.svc 請求大概會提取:
  • IP地址
  • 機器碼
  • 機器名
  • 時間戳
  • IP地址 + 機器碼 + 時間戳
用同樣的方式調查請求 http://m.365ey.net:13063/QueryLog.svc,整理如下:
某 .NET RabbitMQ SDK 有采集行為,你怎么看?

文章插圖
這個請求中主要統計了一些接口版本等信息,并沒有發現有消息的外泄 , 分析到這里還是比較欣慰的,將信息反饋給朋友,讓朋友不要擔心,應該不會有問題 。
三: 總結總的來說我還是非常相信作者,寫一個 SDK 已經夠辛苦了,做一些違法犯罪的事情道理上說不通,作者也就是純技術心,想收集下用戶端的使用情況,不過在未經許可的情況下確實有所不妥,但初心不壞 。

推薦閱讀