Originally Posted by aullah
hi all, can anybody show me how to capture the FTP session output from Net::FTP module to a text file or in a variable ?
Use something like tcpdump to sniff all ftp traffic.
I think something like this will work (change 'eth0' to the name of the network interface that you're using):
tcpdump -i eth0 '(port ftp or ftp-data)' -w outputfile.cap
Of course if you have more than just that perl script using the ftp protocol you'll sniff some extra stuff you don't want. If you're only doing this once it'd be easier to just read the tcpdump man and make sure it'll filter by destination/src IP or something that identifies the specific session you want. You could also install an ftp proxy with logging capabilities and tell Net:FTP to go though it with the ftp_firewall attribute.