Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 65 guests and 1 member online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Network Pen Testing
Non-interactive ftp on linux
EH-Net
May 18, 2013, 05:37:29 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Network Pen Testing
(Moderator:
don
) >
Non-interactive ftp on linux
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Non-interactive ftp on linux (Read 6379 times)
0 Members and 1 Guest are viewing this topic.
H1t M0nk3y
Hero Member
Offline
Posts: 864
Non-interactive ftp on linux
«
on:
June 03, 2010, 05:07:58 PM »
Hi,
I am currently searching for a way to use the basic ftp client on linux machines to download a file in a non-interactive way. So let say I want to download netcat, I would have a file named "ftp.txt" looking like this:
Quote
open 192.168.10.10 21
ftpuser
ftppwd
bin
GET nc
bye
I know on Windows, I could type
ftp -s:ftp.txt
and it would download the file automaticaly.
But the "-s" command doesn't exist on linux systems... What can I use instead? I just can't seem to find it...
Thanks
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
hayabusa
Hero Member
Offline
Posts: 1630
Re: Non-interactive ftp on linux
«
Reply #1 on:
June 03, 2010, 09:29:40 PM »
I'd write a script to do it all with input, or use the info on this page (the Linux one):
http://www.walkernews.net/2007/05/08/auto-file-transfer-via-ftp-batch-scripts/
Quote section from that URL:
1.) In the user home directory, create a hidden file called .netrc that contains these auto-ftp commands
machine 10.1.1.10
login walker-login-id-here
password walker-login-password-here
macdef init
prompt
mget *.*
quit
Leave one mandatory blank line here
Leave one mandatory blank line here
machine ftp.walkernews.net
login walker-login-id-here
password walker-login-password-here
macdef init
pwd
quit
Leave one mandatory blank line here
Leave one mandatory blank line here
2.) # Execute chmod 600 .netrc to limit only read and write permission for the login user ownership only. This is a must in order ftp client to automate file transfer!
3.) # Now, if you want to auto-ftp with ftp host 10.1.1.10, just type this command
ftp 10.1.1.10
and the Linux ftp client will automatically execute the series of ftp commands in .netrc file for the matching ftp host.
Similarly, you can type ftp ftp.walkernews.net for auto-ftp file transfer with the second ftp host.
If I scripted my own, I'd just do a
read filename
get $filename
and change the username, password, and ip / hostname for the ftp server (or you could even read them as variables, also, etc...
my 2 cents
«
Last Edit: June 03, 2010, 09:33:43 PM by hayabusa
»
Logged
~ hayabusa ~
"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'
OSCE, OSCP , GPEN, C|EH
Ketchup
Hero Member
Offline
Posts: 1021
Re: Non-interactive ftp on linux
«
Reply #2 on:
June 03, 2010, 09:36:56 PM »
I would probably just CURL if I was doing this on Linux.
Code:
curl ftp://ftp.coolsite.com/file.ext --user me:mypass
Logged
~~~~~~~~~~~~~~
Ketchup
chrisj
Hero Member
Offline
Posts: 1163
Re: Non-interactive ftp on linux
«
Reply #3 on:
June 03, 2010, 10:49:59 PM »
Quote from: Ketchup on June 03, 2010, 09:36:56 PM
I would probably just CURL if I was doing this on Linux.
Code:
curl ftp://ftp.coolsite.com/file.ext --user me:mypass
It's been a while, but I think wget (my cli get of choice) does this too.
Logged
OSWP, Sec+
H1t M0nk3y
Hero Member
Offline
Posts: 864
Re: Non-interactive ftp on linux
«
Reply #4 on:
June 04, 2010, 06:50:44 AM »
Thanks guys, but I should have mentioned that:
1) curl is not installed on the client machine;
2) Even though I am using the very basic ftp client on the client machine, I am using Pure-FTPD as a server.
So both solutions proposed aren't working (unless it is me!).
I will keep looking and post my findings, unless one of you can help me same some time...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Ketchup
Hero Member
Offline
Posts: 1021
Re: Non-interactive ftp on linux
«
Reply #5 on:
June 04, 2010, 07:25:52 AM »
What about Chris's solution? WGET should be able to pull down a file from FTP.
http://serverfault.com/questions/25199/using-wget-to-recursively-download-whole-ftp-directories
Logged
~~~~~~~~~~~~~~
Ketchup
hayabusa
Hero Member
Offline
Posts: 1630
Re: Non-interactive ftp on linux
«
Reply #6 on:
June 04, 2010, 07:46:30 AM »
OK, I'll say it again... BASH script?
Logged
~ hayabusa ~
"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'
OSCE, OSCP , GPEN, C|EH
H1t M0nk3y
Hero Member
Offline
Posts: 864
Re: Non-interactive ftp on linux
«
Reply #7 on:
June 04, 2010, 08:01:16 AM »
wget did the trick...
But I was surprised to see that
ftp -s
exists on Windows but not on Linux. At least for the default basic ftp client.
Anyway, thanks guys!
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
General Certification
: CPT Practical Submission
(0) by
z28power4u
OSCP - Offensive Security Certified Professional
: Class Scheduled 6/8 - Linux n00b
(5) by
MrTuxracer
Career Central
: Starter cert?
(0) by
Alert
Web Applications
: Nessus and Nikto
(4) by
Seen
Tutorials
: Need guidance
(7) by
impelse
Malware
: EICAR?
(2) by
SephStorm
Network Pen Testing
: Cracking salted MD5 hash
(4) by
n37sh@rk
CEH - Certified Ethical Hacker
: Passed my C|EH
(3) by
n37sh@rk
Mass Media
: EC-council hacked, irony at his best?
(0) by
j0rDy
Web Applications
: SQL Injection into an INSERT statement.
(6) by
eyenit0
Network Pen Testing
: Solution for sipXtapi INVITE Message CSeq Field Header Remote Overflow
(1) by
m0wgli
Web Applications
: dns
(2) by
H1t M0nk3y
Other
: BSides Boston
(0) by
3xban
Career Central
: InfoSec in Central, FL
(2) by
tturner
Web Applications
: Web vulnerability scanner
(4) by
H1t M0nk3y
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.