活动目录审核工具
bta的Python项目详细描述
关于BTA
bta是一个开源的active directory安全审计框架。它的目标是帮助 审核员收集他们需要回答的信息,例如:
- 谁拥有对给定对象(计算机、用户帐户等)的权限?
- 谁能读给定的邮箱?
- 哪些帐户具有域管理权限?
- 谁拥有扩展权限(userForceChangePassword、SendAs等)?
- 广告在两个时间点之间有什么变化?
框架由
- 能够将包含所有广告数据的ntds.dit文件转换为数据库的导入程序
- 查询数据库的工具
- Ad Miner框架
- ad diff实用程序
- 小型实用程序(数据库列表等)
全面的属性集被导入并可以被查询 包括所有架构扩展(Exchange、SharePoint等)。
每一个问题都可以具体化为一个广告专家作为一个矿工,所以 它可以在所有审计过程中使用,而无需再做艰苦的工作。
安装BTA
快速安装
依赖关系:
- MongoDB(^{TT4}$)
- libesedb 2012 alpha版本[1]
- https://bitbucket.org/iwseclabs/bta/downloads/libesedb-alpha-20120102.tar.gzsha-12aba34b1c9703a28b8913019044efa3ff53428fb
- 建造它。使用btaimport
安装:
- pip install bta
来源
依赖关系:
- MongoDB(^{TT9}$)
- libesedb 2012 alpha版本[1]
- https://bitbucket.org/iwseclabs/bta/downloads/libesedb-alpha-20120102.tar.gzsha-12aba34b1c9703a28b8913019044efa3ff53428fb
- 建造它。使用btaimport
- 打开PYXL(>;=2.0.2)
安装:
- python setup.py install
[1] | (1, 2) support for so called long values is a work in progress in the latest versions and is not working well yet. It is working correctly with 2012 alpha version. |
活动目录安全性分析
目标:
- 清理广告或广告林,寻找
- 不良行为
- 忘记的条目
- 后门
- 重新承诺
- BTA是一种操作工具,应该
- 确定性、可靠性
- 运行完善的程序
协议
审核步骤:
- 提取ntds.dit文件
- 在数据库中导入ntds.dit文件
- 在数据库中查找控制点
萃取
以下是在Windows 2008上运行的域控制器的ntds.dit文件备份方法。 有关详细信息或Windows 2003方法,请参见[2]。
ntdsutil activate instance ntds ifm create full c:{\bs}NTDS_saved quit quit
[2] | https://www.sstic.org/2012/presentation/audit_ace_active_directory/ |
导入
- ntds.dit无法使用。
- 一个ntds.dit导入到一个mongodb 数据库
- 能够并行导入几个ntds.dit。
示例:
ntds2db -C ::mydb /path/to/ntds.dit ntds2db /path/to/*.dit --multi \ --C-from-filename \ "::%s" "basename rmext 'DB' swap plus"
分析
- 查询数据库
- 分析数据库的控制点:btaminer
- 分析两个碱基之间的差异:btadiff
分析控制点
- 矿工将专业知识具体化
- 管理帐户列表
- 具有扩展权限的帐户列表
- 有密码错误的帐户列表
- 各种时间表的列表
btaminer -t ReST -C ::AD1 Schema --timelineCS created Analysis by miner [Schema] ========================== +---------------+-----------------------+ | Date | Affected class schema | +===============+=======================+ | 2009-02-11 18 | 234 | | 2011-12-20 00 | 267 | | 2011-12-22 14 | 3 | | 2011-12-23 18 | 46 | +---------------+-----------------------+
分析差异
- 差异
- 两个导入在不同时间点之间的差异(目前还很幼稚)
- 噪声滤波
$ btadiff --CA ::ADclean --CB ::ADbackdoor --ignore-defaults =============== Starting diffing sd_table --------------- AB,101: [] *sd_refcount['14'=>'15'] AB,108: [] *sd_refcount['39'=>'41'] A ,229: [] A ,372: [] AB,423: [] *sd_refcount['3'=>'2'] B,424: [] B,425: [] B,428: [] --------------- Table [sd_table]: 160 records checked, 2 disappeared, 3 appeared, 3 changed =============== [...]
=============== Starting diffing datatable --------------- AB,3586: [DC001] *logonCount['116'=>'117'], *lastLogon['130052518207794051L'=>'130052535716737649L'] AB,3639: [RID Set] *rIDNextRID['1153'=>'1154'] AB,8784: [A:[gc]/B:[gc DEL:346bf199-8567-4375-ac15-79ec4b42b270]] +isDeleted, *name["u'gc'"=>"u'gc\\nDEL:346bf199-8"], *dc["u'gc'"=>"u'gc\\nDEL:346bf199-8"] AB,8785: [A:[DomainDnsZones]/B:[DomainDnsZones DEL:58b2962b-708c-4c93-99ff-0b7e163131f9]] +isDeleted, *name["u'DomainDnsZones'"=>"u'DomainDnsZones\\nDE"], *dc["u'DomainDnsZones'"=>"u'DomainDnsZones\\nDE"] AB,8786: [A:[ForestDnsZones]/B:[ForestDnsZones DEL:87f7d8a2-4d05-48d0-8283-9ab084584470]] +isDeleted, *name["u'ForestDnsZones'"=>"u'ForestDnsZones\\nDE"], *dc["u'ForestDnsZones'"=>"u'ForestDnsZones\\nDE"] B,8789: [snorky insomnihack] B,8790: [gc] B,8791: [DomainDnsZones] B,8792: [ForestDnsZones] --------------- Table [datatable]: 7636 records checked, 0 disappeared, 4 appeared, 5 changed ===============
其他功能
- 可以提供不同格式的报告:
- 实时转储
- 休息文档
- 压缩的csv文件树
- 数据库中的写作审核日志
- 挖掘之前的表一致性检查