Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

Create listing_files.py

Abdul Wahab Junaid409cc15b7969
diff --git a/Python Tools/Ftp Server/listing_files.py b/Python Tools/Ftp Server/listing_files.py
new file mode 100644
index 0000000..e030beb
--- /dev/null
+++ b/Python Tools/Ftp Server/listing_files.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+from ftplib import FTP
+
+ftp_client=FTP('ftp.be.debian.org')
+print("Server: ",ftp_client.getwelcome())
+print(ftp_client.login())
+print("Files and directories in the root directory:")
+ftp_client.dir()
+
+ftp_client.cwd('/pub/linux/kernel')
+files=ftp_client.nlst()
+files.sort()
+print("%d files in /pub/linux/kernel directory:"%len(files))
+for file in files:
+ print(file)
+
+ftp_client.quit()