Comments (12)
I have this issue as well, but it doesn't seem to be specific to the up arrow. I can press any key and it loads the shell.
I recorded this in a four second gif for you all to see: https://i.imgur.com/dApxP4Y.gif
from powercat.
Replacing this
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown").VirtualKeyCode)
with this (MSDN Uses something like this)
$Host.UI.RawUI.ReadKey([System.Management.Automation.Host.ReadKeyOptions]"IncludeKeyDown"-bor[System.Management.Automation.Host.ReadKeyOptions]"NoEcho"-bor[System.Management.Automation.Host.ReadKeyOptions]"IncludeKeyUp").VirtualKeyCode)
or just
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown,IncludeKeyUp").VirtualKeyCode)
Look at the way the craft the options in the MSDN examples. It doesn't look like calling comma separated strings is the correct nomenclature.
EDIT: I'm pretty sure this is what's already been suggested but hopefully seeing it this way may help someone.
https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.host.pshostrawuserinterface?view=powershellsdk-7.0.0
https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.host.pshostrawuserinterface.readkey?view=powershellsdk-7.0.0
from powercat.
I am also having this problem. Can confirm hitting the up arrow as a workaround as well.
from powercat.
I could replicate.
It seems to be due to this part of the code:
if($Host.UI.RawUI.KeyAvailable)
{
if(@(17,27) -contains ($Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown").VirtualKeyCode))
{
Write-Verbose "CTRL or ESC caught. Stopping TCP Setup..."
if($FuncVars["l"]){$Socket.Stop()}
else{$Socket.Close()}
$Stopwatch.Stop()
break
}
}
If there is latency, when we press enter to run powercat, the KeyUp event from pressing enter arrives after powercat is started. So the KeyUp event goes into the input stream, KeyAvailable returns True, and the first IF statement is executed. However the ReadKey in the second IF statement does not "IncludeKeyUp" and blocks the execution until a KeyDown is caught.
from powercat.
I could replicate as well.
Used OpenVPN/rdesktop to connect to a lab vm.
from powercat.
I am experiencing this issue as well, the workaround works for me.
from powercat.
Can someone else please validate? This seems to work... would like another verification.
Thanks @lukebaggett !!
from powercat.
Can someone else please validate? This seems to work... would like another verification.
Confirmed — I had the same symptom in the same circumstance, and applying the change in cb66833 resolved it.
Thanks @besimorhino !
from powercat.
Had the same issues. I can confirm the mentioned patch working as well.
from powercat.
Same problem, but if you just use "Arrow Up" in the Windows target the bind shell works(for example)
from powercat.
Very glad you spotted this! At least I can get it to work with the workaround :D
from powercat.
Can someone else please validate? This seems to work... would like another verification.
Thanks @lukebaggett !!
I only appended the 'IncludeKeyUp' for TCP but can confirm it worked instantly first go.
from powercat.
Related Issues (20)
- -rep parameter not working as expected?
- Powercat doesn't work with files
- Connecting to DNSCAT2. HOT 2
- powercat timeout not working? HOT 1
- Detecting Errors?
- The remote shell is disconected after execute port scanning HOT 1
- Missing License information HOT 1
- It is detected now as malware by Windows Defender and 3 of virustotal HOT 4
- Listener Not Remaining Open HOT 2
- Power Cat command not found on CMD Windows HOT 1
- Detected on Windows HOT 2
- Send input and return value HOT 1
- Installing error HOT 1
- script generated by -ge is not recognised by powershell
- IEX install with antivirus warning HOT 2
- This software looks awesome but misses a LICENSE file. HOT 1
- Extreme CPU usage while doing nothing HOT 6
- Recommendations Following PowerShell Best Practices HOT 4
- powercat -l -p 443 -ep : typing a command in the shell throws an error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powercat.