How to Push and Pull Remote Files Securely Over SSH with Pipes « Null Byte :: WonderHowTo

You can use a secure shell to route traffic or access files, but there's something else you can do. Transfer files. There are loads of solutions for transferring files, like Dropbox, FTP, torrents, etc., but what about for a special ordeal? Most commonly, the way people get shells are from free servers online.The reason that we consider using free shells a "special ordeal' is because we are often times not allowed to use any form of X session over a SSH tunnel, so programs like Dropbox get ousted, and even FTP, because most servers do not allow hosting of that kind for free. So we need to be able to push and pull files... yet somehow not use anything but the tools that come stock on the server.Our answer? Pipe commands. And no... not SCP.In this Null Byte, get ready to learn how to send and receive files over SSH using only pipe commands and some clever command line tricks.RequirementsSHH client installedLinuxPushing & Pulling FilesUsing strictly pipes and BASH tricks, follow along with me in the video below and watch me push and pull a file named "cow".Please enable JavaScript to watch this video.Commandscatlocalfile| sshuser@server.comcat ">"remotefilesshtarget_addresscatremotefile>localfileYou could turn this into a cool Python program, too. I picture something like this would be used to create the shortest possible script.os.system('cat '+sys.argv[2]+' | ssh '+sys.argv[1]+' ">" '+sys.argv[3])With a syntax like:program.py <user@host> <localfile> <remotefile>Be a Part of Null Byte!Post to theforumsChat onIRCFollow onTwitterCircle onGoogle+Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicensePhoto bymetroRelatedHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 15 (Creating a Secure Tunnel to MySQL)How To:Run Your Favorite Graphical X Applications Over SSHHow To:Use Remote Port Forwarding to Slip Past Firewall Restrictions UnnoticedSPLOIT:How to Make an SSH Brute-Forcer in PythonHacking Windows 10:How to Use SSH Tunnels to Forward Requests & Hack Remote RoutersHow To:Use the Chrome Browser Secure Shell App to SSH into Remote DevicesHow To:Set up SSH tunneling to securely transmit HTTP trafficHow To:Browse securely with SSH and a SOCKS proxyHow To:Create a Reusable Burner OS with Docker, Part 3: Storing Our Hacking Container RemotelyHow To:Locate & Exploit Devices Vulnerable to the Libssh Security FlawHow To:Configure a Reverse SSH Shell (Raspberry Pi Hacking Box)How To:Use SSH Local Port Forwarding to Pivot into Restricted NetworksHow To:Securely Sync Files Between Two Machines Using SyncthingHow To:Spy on SSH Sessions with SSHPry2.0How To:Set Up an SSH Server with Tor to Hide It from Shodan & HackersHow To:Cap off a water pipeHow To:Hack Metasploitable 2 Part 1How To:Share Your LAN Minecraft World with Your Linux-Savvy FriendsHow To:Enable the New Native SSH Client on Windows 10How To:Create an SSH tunnel for your Mac Mini serverHacking Windows 10:How to Turn Compromised Windows PCs into Web ProxiesHow To:Use copper push-fit fittings to connect pipingHow To:Create a Native SSH Server on Your Windows 10 SystemSSH the World:Mac, Linux, Windows, iDevices and Android.How To:Create a Free SSH Account on Shellmix to Use as a Webhost & MoreHow To:Remotely Control Computers Over VNC Securely with SSHHow To:Safely Log In to Your SSH Account Without a PasswordNews:Snakes in a HotelHow To:Create an SSH Tunnel Server and Client in LinuxHow To:Open and Pour a Bottle of ChampagneWeekend Homework:How to Become a Null Byte Contributor (2/10/2012)How To:Create a Reverse Shell to Remotely Execute Root Commands Over Any Open Port Using NetCat or BASHHow To:Make a Human Blockade LockboxNews:Shocking EndHow To:Make a High-Powered Compressed Air Rocket GunNews:Make your own vintage-inspired brooch bouquetHow To:Mask Your IP Address and Remain Anonymous with OpenVPN for LinuxNews:Sticky WakeupContest:Spud GunNews:PVC Pipe Trellis for Gourds