add compat check to msftidy - #20862
Conversation
|
|
|
ping @dledda-r7 since we had talked about this |
|
Also, is there a definitive list of items? I just grabbed some out of modules I found, but there must be a better way to generate this. |
About the list, I could be wrong but i think there is auto-generated from
so the it becomes |
| def check_compat | ||
| rules = { | ||
| # compat, [functions_that_need_it] | ||
| 'core_channel_open' => ['.net.socket'], | ||
| 'stdapi_fs_delete_dir' => ['.fs.dir.rmdir'], | ||
| 'stdapi_fs_delete_file' => ['.fs.file.rm'], | ||
| 'stdapi_fs_search' => ['.fs.file.search'], | ||
| 'stdapi_fs_stat' => ['.fs.file.stat'], | ||
| 'stdapi_railgun_api' => ['.railgun.kernel32'], | ||
| 'stdapi_railgun_memread' => ['.railgun.memread'], | ||
| 'stdapi_sys_config_getenv' => ['.sys.config.getenv'], | ||
| 'stdapi_sys_config_getuid' => ['.sys.config.getuid'], | ||
| 'stdapi_sys_config_sysinfo' => ['.sys.config.sysinfo'], | ||
| # 'stdapi_sys_process_attach' => [''], | ||
| 'stdapi_sys_process_execute' => ['.sys.process.execute'], | ||
| 'stdapi_sys_process_kill' => ['.sys.process.kill'], | ||
| 'stdapi_sys_process_memory_allocate' => ['.memory.allocate'], | ||
| 'stdapi_sys_process_memory_write' => ['.memory.write'], | ||
| 'stdapi_sys_process_thread_create' => ['.thread.create'] | ||
| } |
There was a problem hiding this comment.
I have no idea if there is a way to make this "smarter", the problem is that there you are not catching mixins etc... not sure how doable it is
As per discussion here implements a rudimentary check on meterpreter compatibilities.
Also includes a check for
attack.mitre.orgURLs and suggests using theATT&CKtype instead.Of note, this will not check if any included libraries
Verification
tools/dev/msftidy.rb modules/ | grep "Missing Module Compat"tools/dev/msftidy.rb modules/ | grep "ATT&CK"