BC-SECURITY / Empire

Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and Penetration Testers.
https://bc-security.gitbook.io/empire-wiki/
BSD 3-Clause "New" or "Revised" License
4.06k stars 564 forks source link

[BUG] Module: New-GPOImmediateTask does not work #733

Open cspain opened 1 month ago

cspain commented 1 month ago

Is there an existing issue for this?

Empire Version

5.10.3

Python Version

3.12.2

Operating System

Ubuntu 22.04

Database

SQLite

Current Behavior

When executing New-GPOImmediateTask no new agents connect as expected. Looking at the output on the command line for the server I see:

[ERROR]: Error in retrieving dependencies for function New-GPOImmediateTask ! [ERROR]: Key error with function New-GPOImmediateTask !

Expected Behavior

No error messages Agents from hosts on the same Active Directory Domain callback

Steps To Reproduce

  1. Setup http listener on port 80
  2. Setup stager to use windows_launcher
  3. Download and execute launcher on target host machine
  4. Verify new Agent setup
  5. Use module New-GPOImmediateTask
  6. Set listener and agent
  7. Execute and view cmdline output on server terminal to see error

Anything else?

The missing function is being searched for within the script: .../empire/server/data/module_source/situational_awareness/network/powerview.ps1

It looks like this function was removed from PowerSploit some time ago:

https://github.com/PowerShellMafia/PowerSploit/commit/7c32bf69f334b7c15c644cdb41188bdfe1a0b0e8

Comment in commit was: Removed functions:
    Get-ComputerProperty, Get-UserProperty, Find-ComputerField, Find-UserField
    Get-NameField (translated to ValueFromPipelineByPropertyName calls)
    Invoke-DowngradeAccount - not used
    Add-NetUser - split into New-DomainUser/others
    Add-NetGroupUser - split into Add-DomainGroupMember/others
    New-GPOImmediateTask - inconsistent and better done manually
    Invoke-StealthUserHunter - combined into Find-DomainUserLocation
    Get-ExploitableSystem