搜索此博客

2017年1月18日星期三

xrkmon-基于ImmunityDebugger的api调用监控脚本

本邮件内容由第三方提供,如果您不想继续收到该邮件,可 点此退订
xrkmon-基于ImmunityDebugger的api调用监控脚本  阅读原文»

github地址:https://github.com/humblepride/xrkmon

简述

基于调试器Immunity Debugger的一套Python脚本,可以监控API调用、修改API调用参数及结果,可以很方便的解决调试中遇到的很多小问题,在一定程度上提高调试效率。 事实上,在熟悉代码的基础上,可以很容易的添加更多高级的功能。

What is this:

a set of py scripts for Immunity Debugger, to to monitor api calls, modify api rets, etc... u can add functionalities of your own.

disadvantags:

  • buggy. not fully tested.
  • slow. it doesn't matter how many api hooks are installed, but it does matter if hooked apis too frequently invoked.
  • sometimes might not work. it depends on "hooking system" of Immunity Debugger. if imm fails, this will fail too.
  • this is not some "ONE CLICK" thing, u're recommanded to read source code, to create functionality of your own.

features:

  • api call monitor, but only pre-defined apis. of course, u can easily add apis of your own.
  • call stack filter. only apis directly invoked by interested dlls will be logged/displyed.
  • use "symbol" exported by ida.
  • ...

file structures:

  • x.py:write code for specific sample, and type:!x
  • xrkcloud.py:get/set data from/to "cloud"
  • xrkcst.py:some const data
  • xrkcstk.py:call stack functionality
  • xrkdbg.py:sync between xrkmon and debugger
  • xrkdef.py:classes and basic methods
  • xrkhook.py:hook classes and basic methods
  • xrklog.py:logging
  • xrkmd.py:memory module
  • xrkmon.py:main entry
  • xrkmonapis.py:pre-defined apis and categories
  • xrkmoncfg.py:pre-defined config for xrkmon
  • xrkmonctrl.py:control class and methods
  • xrkmonrun.py:run_cbk of all apis, and some common methods
  • xrkpefilex.py:wrapper of pefile.py
  • xrksym.py:symbol thing(dbghelp.dll and ida)
  • xrkutil.py:utility

setup:

[crayon-5880225185b15813088311/]

usage:

  1. imm cmd line, apply pre-defined configs: [crayon-5880225185b2b287310878/] to list all pre-defined configs, type: [crayon-5880225185b34002813815/] for details, read the code. u can add config of your own, and use it in the same way.
  2. imm cmd line, operate on hook or cloud(control behaviour of hooked api indirectly): [crayon-5880225185b3c995523032/] for more details, type: [crayon-5880225185b44554783835/]
  3. by coding:
    [crayon-5880225185b4b028337573/]
    u can put code inx.py, and type: [crayon-5880225185b52304341543/]

examples:

  • checkout global config: [crayon-5880225185b5a402324857/]
  • change work mode [crayon-5880225185b61087064328/]
  • force all ws2_32 apis return success [crayon-5880225185b69987201796/]
  • shorten sleep mescs [crayon-5880225185b70352507680/]
  • pause when modify file system and process creation [crayon-5880225185b77935839719/]
  • hook all ws2_32 apis and pause when hit [crayon-5880225185b7f135880134/]
  • remove all ws2_32 apis and install wininet apis and not pause when hit [crayon-5880225185b86671374855/]
  • not pause all hooked/hooking apis [crayon-5880225185b8d945478999/]

api category:

apis are divided into categories, check outxrkmonapis.py: [crayon-5880225185b95645948565/]

add api:

  1. definerun_xxxinxrkmonrun.py:
    [crayon-5880225185b9d487731629/]
  2. add api config toxrkmonctrl.py(existing category or category of your own):
    [crayon-5880225185ba4958984147/]
  3. if u have special config for this api, add toxrkmonctrl.py(ctrlCmn.dft_api_config:
    [crayon-5880225185bac080444708/]
    and access config atrun_xxxinxrkmonrun.py:
    [crayon-5880225185bb9421974405/]

add category:

  1. define category inxrkmonapis.py:
    [crayon-5880225185bc2718533492/]
    add a name to it in global variableapi_cat_dict:
    [crayon-5880225185bc9825624391/]
    then u can use it by typing: [crayon-5880225185bd1207395483/]

add config:

  1. add configItem obj to variablev_config_dictinxrkmoncfg.py:
    [crayon-5880225185bd8203760300/]
    then u can use it by typing: [crayon-5880225185be0515225391/]

ida "symbol":

  1. ida script to export "symbol":
[crayon-5880225185be8104532839/]
  1. rename exported file as xxxx_ida_names.txt, and place it under same dir of debuggee, xrkmon will parse it automatically(when resolving symbol).

working mode:

  1. 2 "work_mode":
  2. debug(default)
    • api call log to "Log Window"
  3. log
    • api call log to "cloud", and u print summary by typing:
    [crayon-5880225185bf2622593201/]
  4. "work_mode" only takes effect in 'xrkmonrun.py(xrk_api_call)':
    [crayon-5880225185bf9842548480/]
  5. u can easily modify "work_mode" on the fly by typing: [crayon-5880225185c01708825036/]

output

  1. api call will print in "Log Window" only in "debug" mode
  2. api call is always printed, but params and call stack are optional(default is yes)
  3. u can config this by typing:!xrkmon -k global --attr is_log_cstk --false !xrkmon -k global --attr is_log_params --true

bug report:

please report an issues, or email to763090709@qq.com

TODO:

  1. integrate with pydbg
  2. compatiable with x64dbg

黑客技术官网地址:http://www.hackdig.com/

匡恩网络发布"2016物联网安全报告"  阅读原文»

物联网已经被视为继计算机和互联网之后的第三次信息技术革命。2017年也被行业称为物联网商用元年。然而,随着物联网产业和技术的快速发展,物联网的安全问题日趋突显。

由于物联网技术将虚拟世界与物理世界结合在一起,通过虚拟世界的数字信息就可以控制物理世界的关键设备甚至基础设施,因此物联网的安全关系国家安全与社会稳定。

匡恩网络于今日发布《2016年度物联网安全研究报告》(以下简称《研究报告》),从政策指导、物联网安全架构技术分析及物联网产业落地发展等,多角度分析了2016年物联网产业环境,显示出我国物联网产业已经进入多行业落地阶段,而物联网安全建设也已成为物联网发展的关键因素。其中工业物联网安全是物联网安全的重要有机组成部分。

认识物联网,掌握安全框架

%e5%9b%be3-1%e6%9c%89%e5%85%b3%e7%89%a9%e8%81%94%e7%bd%91%e7%9a%84%e5%87%a0%e7%a7%8d%e6%a6%82%e5%bf%b5%e4%b9%8b%e9%97%b4%e7%9a%84%e5%85%b3%e7%b3%bb%e7%a4%ba%e6%84%8f%e5%9b%be-400

有关物联网的几种概念之间的关系示意图

物联网并非新生事物,而是信息技术发展到一定阶段的产物。经过几年的讨论与论证,目前学术界、产业以及政府管理部门都比较认同物联网是由感知层、网络传输层和处理应用层组成。

物联网的网络传输层和处理应用层都属于传统信息系统中的组成部分,所不同的是规模上较传统信息系统有更高的要求,例如传输更可靠、处理更智能等。而物联网的感知层才是区别传统信息系统与物联网系统的根本要素,也是将虚拟世界与现实物理世界相结合的关键部分。

《研究报告》中对物联网感知层、网络传输层、处理应用层的技术发展状况及最新进展进行汇总,并对各层安全保护技术进行详细分析,为行业产业技术发展做好借鉴。

工业物联网安全,物联网安全建设重中之重

%e5%9b%be3-2-%e5%b7%a5%e4%b8%9a%e7%89%a9%e8%81%94%e7%bd%91%e6%9e%b6%e6%9e%84%e5%9b%be-800

(a)物联网的三层架构 (b)工业物联网的三层架构

工业物联网架构图

目前,物联网已经进入了实际产业化阶段。根据工信部的权威数据,2015 年中国物联网产业规模已经达到 7500 亿元,同比增长 29.3%,媒体预测到 2020 年,中国物联网的整体规模将超过 1.8万亿元。而在物联网安全建设方面迫切需求专业的、完整闭环安全生态模式的第三方安全解决方案提供商与服务商。

《研究报告》对智慧交通、智慧水利、智慧管网、智慧农业、智慧城市等关键技术发展及行业落地情况进行汇总分析。

在物联网安全建设中,工业物联网安全防护是物联网安全防护的重中之重。目前,越来越多的工业企业开始构建工业物联网体系,而日趋联网的工业控制系统网络安全则是工业物联网安全的关键。

《研究报告》整体分析了工业物联网安全环境,将工业物联网系统架构分为数据采集层、数据传输层、数据处理层,更明确了工业物联网这一特殊行业应用系统的安全架构。另外《研究报告》对工业物联网漏洞做出详细分析,公布了2016年工业物联网top10大漏洞和其他重要安全问题。

趋势预判,物联网安全产业发展

%e5%9b%be5-1-ihs%e5%af%b9%e7%89%a9%e8%81%94%e7%bd%91%e5%b8%82%e5%9c%ba%e7%9a%84%e9%a2%84%e6%b5%8b%e5%9b%be-800

IHS对物联网市场的预测图(数据来源:IHS)

根据报告,IHS预测全球物联网设备的安装基数将从2015年的154亿台增长到2020年的307亿台。并且,2025年设备的安装基数更将达到 754 亿台。在物联网迅猛发展的同时,物联网安全成了产业痛点。10 月 21 日,美国上千家网站遭受大规模 DDoS 攻击,攻击源头是大批被入侵的物联网设备,给物联网产业安全发展敲响了警钟。

《研究报告》根据不同机构对物联网市场的预测,对物联网产业安全发展做出整体的预判,预计物联网生产相关企业在物联网安全方面的投入比例会逐步提高,而且物联网安全产业规模的发展速度将快于物联网产业的整体发展速度。

建言献策,共同促进产业健康发展

近几年,物联网安全攻击事件已经表现出专业化团队作战的特征,各个国家也都在不断提高对网络的安全防范意识。2016年12月,美国宽带互联网技术咨询组 (BITAG)发布报告提出建立物联网安全供应链,从六个方面对物联网安全建设提出建议。在此之外,匡恩网络在《研究报告》从物联网安全体系建设;感知层的安全防护;业务数据安全方案设计与建设;物联网设备的防护机制;工业物联网的网络连接;隐私信息保护等方面向物联网设备和系统相关开发商、生产商、管理者及个人提供了安全建设建议,旨在共同促进基于物联网技术的产业健康发展。

报告下载:

http://www.kuangn.com/upload/file/20170118/8cb49c2f2d6040a8b362a1b52cac34e7.pdf

 


黑客技术官网地址:http://www.hackdig.com/

阅读更多内容

没有评论: