BC-SECURITY / Starkiller

Starkiller is a Frontend for PowerShell Empire.
https://www.bc-security.org/post/an-introduction-to-starkiller
MIT License
1.37k stars 196 forks source link

File Browser icon keeps circling and never finishes, and error in console #67

Open sdcampbell opened 3 years ago

sdcampbell commented 3 years ago

Empire Version

Starkiller Version starkiller-1.8.0.AppImage, and issue is also in starkiller-1.9.0-Sponsors.AppImage

OS Information (Linux flavor, Python version)

Describe the bug

The "File Browser" never displays files, and I see an error in the console.

To Reproduce

Steps to reproduce the behavior:

  1. Interact with an agent.

  2. click on File Browser

  3. Notice that circling dots never complete and never shows files.

  4. See error in the console or Tasks: "[!] error running command: The term 'ConvertTo-Json' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

Expected behavior

I should see a list of files and directories.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context

Empire server is running in a Docker container built from Empire-Sponsors "sponsors-master" branch.

git clone https://github.com/BC-SECURITY/Empire-Sponsors.git && cd Empire-Sponsors
sudo docker build -t empire-sponsor:4.1.0 .
sudo docker create -v /empire --name data empire-sponsor:4.1.0
sudo docker run -it --privileged --net=host --volumes-from data empire-sponsor:4.1.0

I'm able to create a listener and stager, and after running the stager on the Windows target system, I get an agent check-in. I can interact with the agent and run commands. When I click on File Browser, the dots circling never stop and I see the "ConvertTo-Json" error I included above.

sdcampbell commented 3 years ago

After chatting with Vinniebod in Discord, I found that the issue is caused by the fact that Powershell version 2 doesn't have the "ConvertTo-Json" function.

C:\>powershell -c $PSversiontable

Name                           Value                                           
----                           -----                                           
CLRVersion                     2.0.50727.8762                                  
BuildVersion                   6.1.7601.17514                                  
PSVersion                      2.0                                             
WSManStackVersion              2.0                                             
PSCompatibleVersions           {1.0, 2.0}                                      
SerializationVersion           1.1.0.1                                         
PSRemotingProtocolVersion      2.1       
C:\>powershell -version 2 -c "Get-date | select-object -Property * | ConvertTo-Json"
The term 'ConvertTo-Json' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the spelling of the name, or if a path 
was included, verify that the path is correct and try again.

I don't know if you want to close this issue, or keep it open and include some type of error handling, or maybe disable the File Browser if it detects version 2?