đŸ•šī¸
Ghoulsec Vault
Website Toolbase
  • Welcome !
  • đŸ—ƒī¸Exam Prep Notes
    • 📔CEH V13 (Master Edition)
      • Module 02: Footprinting and Reconnaissance
      • Module 03: Scanning Networks
      • Module 04: Enumeration
      • Module 05: Vulnerability Analysis
      • Module 06: System Hacking
      • Module 07: Malware Threats
      • Module 08: Sniffing
      • Module 09 : Social Engineering
      • Module 10: Denial of Service
      • Module 11: Session Hijacking
      • Module 12: Evading IDS, Firewalls , Honeypots
      • Module 13: Hacking web servers
      • Module 14: Hacking Web Applications
      • Module 15:SQL Injection
      • Module 16: Wireless Attacks
      • Module 17: Hacking Mobile Platforms
      • Module 18: IoT & OT Hacking
      • Module 19 : Cloud Computing
      • Module 20 : Cryptography
    • 📘ISC2 -Certified in Cyber Security
      • Chapter -1 Security Principals
      • Chapter -2 Disaster Recovery,Business Continuity & Incident Response
      • Chapter -3 Access Control Concepts
      • Chapter -4 Network Security
      • Chapter -5 Security Operations
    • 📗AZ - 900
      • Basics of Cloud Computing
        • Economic of Scale
        • CapEx & OpEx
        • Consumption based model
        • Cloud Deployment Models
        • Shared Responsibility Model
        • Data centers, Regions & Availability Zones & Geographyies in Azure
        • Resources & Resource Group
        • Azure Access Tools
        • Azure Service Lifecycle
        • Azure SLAs
        • Azure Cloud Adoption Framework
      • Azure Services
        • Azure Computing Services
        • Azure Networking Services
        • Azure Storage Services
        • Azure Database Service
        • Azure Marketplace
        • Big Data & Azure
        • Azure Serverless Computing
        • IoT & Azure
        • Other Azure Services
        • Azure Resource Locks & Resource Tags
        • Azure Security Services
          • Security Groups
          • Routing Tables
          • Azure Firewall
          • Azure DDOS Protection
          • Azure Identity & Access Management (Azure AD)
          • Azure RBAC
          • Azure Security Center
          • Azure Key Vault
      • Azure policies & Blueprints
      • Azure Cost Management
      • Azure Core Tenents
    • 📗SC - 900
      • Zero Trust Model
      • Shared Responsibility Model
      • Defense in Depth
      • Security Controls
      • CIA Triad
      • Encryption / Hashing / Signing
      • Microsoft Security & Compliance Principals
      • Common Identity Attacks
      • Microsoft Identity as Primary Security Perimeter
      • Modern Authentication with Azure AD
      • Azure AD Identity Types
      • Azure External Identities
      • Hybrid Identities
      • Authentication Methods & Password Protection
      • Conditional Access
      • Azure AD Roles & RBAC
      • Governance in Azure AD
      • Azure Identity Protection
      • Azure NSG, DDOS, Firewall
      • Azure Bastion & Keyvault
      • Azure Encryption
      • Azure CSPM
      • Azure Security Center
      • Azure Defender
        • Microsoft O365 Defender
        • Azure Sentinel
      • Microsoft Cloud App Security
      • Microsoft Intune
      • Microsoft Complaince Manager
      • Information Protection
      • Microsoft insider risk capabilities
    • 📔AWS Cloud Practitioner
      • Cloud Deployment
        • AWS Global Infrastructure
      • AWS Cloud Essentials
        • AWS SNS
          • AWS SQS
      • AWS Compute & Container Services
        • AWS EC2
          • Elasticity & Agility
        • AWS Serverless Computing
        • AWS Container Services
        • AWS Beanstalk
        • AWS Load Balancing
      • AWS Storage & Databases
      • AWS Networking
      • AWS Security
        • AWS Organisation
        • AWS Compliance
        • AWS DDOS
        • Additional Security Services
      • AWS Monitoring & Analytics
        • Other Analytics Services
      • AWS Pricing & Support
      • AWS Migration & Innovation
        • Migration Statergies
        • AWS Snow Family
        • AWS Transfer Family
        • Innovation on AWS
      • AWS Well Architecture Framework
      • Other AWS Services
  • 🧑‍đŸ’ģCyber Security Base
    • Ghoul's Den
    • Cheatsheets
    • SSL Handbook
      • Installing OpenSSL
      • Encrypting Web Servers using SSL
      • Compiling .pfx file using openssl
      • De-compiling .pfx file
      • Zimbra Mail Server SSL renew
      • SSL Certificates
    • â˜ī¸Cloud Security
      • Amazon Web Services (AWS)
        • AWS - IAM & Policy Management
        • AWS Organization
        • AWS - Roles (Assume Role)
        • AWS - EC2 (Elastic Computing)
        • AWS - VPC
        • AWS - Bastion Host
        • AWS Application Load Balancer
        • AWS Auto Scaling Group
        • AWS WAF
        • AWS - VPC Peering
        • AWS Transit Gateway
        • AWS NAT Gateway
        • AWS - Route 53
        • AWS Certificates Manager
        • AWS Network Load Balancer (NLB)
    • đŸ•¸ī¸Network Security
      • Firewalls
        • Sophos - Security Suite
          • Sophos Firewalls
      • VPN
        • VPNs
          • Wireguard Tunneling
          • StrongSwan Gateway VPN Server on Ubuntu
      • IP Address and IP Subnetting
      • Basic to Advance Networking Materials
    • 🧑‍đŸ’ģVAPT
      • Sample Report Templete
      • OWASP
        • OWASP Web Application Security & WebGoat
      • Web Application testing checklist
        • Client Side Penetration Testing
          • Clickjacking
          • Websockets
          • CSRF
          • XSS Filters
        • Server Side Penetration Testing
        • Advanced Web Application Pentesting
          • OAuth
          • JWT Injection
          • Server Side Templete Injection
    • â˜„ī¸GRC
      • ISMS AUDIT PLAN
      • CIS Compliance Windows
    • 🔍Forensic
      • Forensic Tools
      • EMAIL Forensics
      • File header forensics
    • Trend Micro
      • Deep Security
        • Installation & Prerequisite
          • Microsoft SQL server 2022
          • Postgres 16 Core
          • Installation
    • Practical Malware Analysis & API Threats
  • đŸ•šī¸Server are fun !
    • Securing Linux
      • Securing SSH
      • Sudoers
      • UFW (Uncomplicated FW)
      • Unattended Upgrades
      • Password Complexiety
      • Auditing Linux
      • Samba - SMB
      • NFS - Network File System
      • FTP
      • AIDE
    • Servers
      • Linux Sever
        • OpenLDAP Server Setup
          • ldap-account-manager
          • Securing OpenLDAP
          • OpenLDAP client setup
          • Checking LDAP setup
        • Users & Groups
        • Password Policy
        • File & File Permissions
        • Automatic Updates
        • Adding GUI to Ubuntu Server
        • DNS Server
        • NTP Server
      • Windows Sever
        • Deep dive into Windows Server
        • Windows server Installation
        • Disable IPv6
        • Disable Server Manager on startup
        • Promoting OS to AD server
        • AD DNS
        • AD DHCP
        • AD Activation
        • AD Users & Groups
        • AD FileServer
        • Adding Users into AD
        • Bulk Importing users into Domain
        • Windows AD Resources
        • Group Policy Editor
          • Creating First Policy
          • Restricting CMD & Powershell
          • Password Policies
          • Audit Policies
          • Log Retention Policy
          • Windows Defender Firewall
          • Patch Management & Window Updates
        • Setting Up local accounts for windows hosts
    • Hacking Systems
      • Linux Systems
        • Battery Charge Threshold (Linux)
        • Metasploitable OS Complete Solved
      • Tricking Windows
        • Bitlocker & Time based policy bypass
    • Monitoring HeartBeats
    • RAID Technology
    • Managing Partitions
      • Parted
      • Fdisk
      • LVM
        • Re-claiming unused disk space
        • Adding physical volume into VG
        • Removing physical volume from VG
      • SWAP Memory
    • Virtualization
      • Proxmox
        • Proxmox VE Installation
        • Default Storage Expansion
        • Proxmox Network Link Aggegration
        • NAT Interface Configuration
        • Importing disk into proxmox
        • Creating an LVM Thin Pool
        • Proxmox IAM
  • đŸ™â€â™‚ī¸Dan the AI Expert
    • Ollama Ollama ...
      • Ollama
        • Ollama models
        • Open Web UI & Ollama Integration
    • Microsoft Presentation using AI
  • đŸ›Ąī¸Security Operations
    • Wazuh - Open Source XDR. Open Source SIEM.
      • Components
      • Deployment Methods
      • Installation
        • Single Node Installation
          • Wazuh Indexer Installation
          • Wazuh Server Installation
          • Wazuh Dashboard Installation
          • Single node deployment with Script
        • Managing multiple Wazuh clusters with Cross-Cluster Search
          • Cluster Configuration
          • Set up Cross-Cluster Search
        • Upgrading Wazuh Central Components
        • Uninstalling Wazuh
      • Custom Decoder & Rules
        • Pfsense Decoders
        • Pfsense Rules
      • Security Operations Center Tools (Wazuh)
    • IRIS-DFIR / Case Management
    • Graylog & ElasticSearch
    • Zabbix NMS
      • Zabbix Installation
      • Zabbix Database Management
        • Zabbix Database backup
        • Zabbix Database restore
        • MySQL Replication (M-M)
        • MySQL Replication (M-W)
      • Zabbix Geomap Setup
      • Adding Hosts into Zabbix
      • Zabbix Hostgroups
      • Auto Registration Hosts Zabbix
      • Zabbix Globalscrips
      • Zabbix HA Cluster
      • Zabbix Proxy
      • Zabbix Notifications
      • Zabbix Maintainance
      • Zabbix User Management & Authentication
      • Zabbix Housekeeping
      • Scheduled Reporting
      • Service Monitoring using Zabbix
  • Git the master!!
    • Configuring git
    • Git Branches
    • Undoing changes
    • Git - Cheat sheet
    • My first git...
Powered by GitBook
On this page
  • Installing FTP
  • Configuring FTP
  • Downloading Files locally using FTP
  • Uploading files via FTP
  • Securing FTP - Limiting users to Home directory
  • Encrypting FTP Connections
  1. Server are fun !
  2. Securing Linux

FTP

FTP (File Transfer Protocol) is a TCP protocol used for downloading files between computers, and it works on a client/server model. The server component, called the FTP daemon, listens for client requests, handles logins, and manages the connection throughout the session. FTP supports two access modes:

  1. Anonymous: Users log in using a default account (usually "anonymous" or "ftp") and provide an email address as the password.

  2. Authenticated: Users must have an account and password, but this method is insecure and not recommended.

FTP does not encrypt data or credentials, making it vulnerable to interception. For secure file transfers, SFTP (SSH File Transfer Protocol) should be used. FTP also limits access to server directories based on the permissions of the login account, usually hiding the root directory and showing only the FTP home directory.


Installing FTP

we can install the FTP daemon using the following commands :

$> sudo apt install vsftpd

After installation the FTP create the default ftp user and the home directory under /srv/ftp & If you wish to change this location, to /srv/files/ftp for example, simply create a directory in another location and change the ftp user’s home directory:

sudo mkdir -p /srv/files/ftp
sudo usermod -d /srv/files/ftp ftp 

Configuring FTP

The config file of ftp is located on /etc/vsftpd.conf we can make default config changes. Now we will edit some configs to make the use cases given below.

Disbaling ANONYMOUS Reads/Writes over FTP

To disable the anonymous access we can edit the config file and set the anonymous_enable & anon_upload_enable to NO .

$> sudo nano /etc/vsftpd.conf
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO 
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=NO

This will ensure that only the authenticated users can access the FTP connections to harden the linux security.


UFW Configuration

If the environment where ufw is enabled we need to make certain changes to make ftp work smoothly

sudo ufw allow ftp 
## SPECIFIC IP 
sudo ufw allow from 10.10.10.100 to any port 21
sudo ufw allow from 10.10.10.100 to any port 20

By default the FTP servers use the passive mode connections to enable NAT & traversing firewalls for the connections, we need to config the passive_start & passive_end ports to allow them from the firewall to allow FTP completely from UFW

sudo nano /etc/vsftpd.conf

We will need to add the following lines into the config file

pasv_min_port=10000
pasv_max_port=10100

Now we will restart the service to apply the changes

sudo systemctl restart vsftpd.service

Now we will edit the firewall rule to allow this port range for FTP connections so that we can secure the connections using authenticated FTP & UFW

sudo ufw allow 10000:10100/tcp

Now we can see that the authenticated users can connect with ftp


Downloading Files locally using FTP

We can either use terminal or softwares like filezilla to download files from the remote ftp server or even from the browser.

$> ftp <IP ADDRESS>
## DOWNLOADING FILES LOCALLY
get <localfile> <remotepath>

We can also use tools like Filezilla & mobaXterm to get the GUI exprience to download and upload files via FTP


Uploading files via FTP

We need to do some config file changes to enable remote file upload on the ftp server

sudo nano /etc/vsftpd.conf

Look for the configuration FTP write and uncomment and set the write_enabled parameter value to YES

# Uncomment this to enable any form of FTP write command.
write_enable=YES

Restart the service to apply the changes

sudo systemctl restart vsftpd.service

Uploading files on the remote FTP server

ftp <IP ADDRESS>
## CONNECTION ESTABLISHED
fget <local_file_path> <remote_path>

To upload files we can also use GUI tools like filezilla & mobaXterm to make it easier


Securing FTP - Limiting users to Home directory

There are options in /etc/vsftpd.conf to help make vsftpd more secure. For example users can be limited to their home directories by uncommenting:

chroot_local_user=YES

You can also limit a specific list of users to just their home directories:

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

After uncommenting the above options, create a /etc/vsftpd.chroot_list containing a list of users one per line. Then restart vsftpd:

sudo systemctl restart vsftpd.service

Also, the /etc/ftpusers file is a list of users that are disallowed FTP access. The default list includes root, daemon, nobody, etc. To disable FTP access for additional users simply add them to the list.


Encrypting FTP Connections

FTP can also be encrypted using FTPS. Different from SFTP, FTPS is FTP over Secure Socket Layer (SSL). SFTP is a FTP like session over an encrypted SSH connection. A major difference is that users of SFTP need to have a shell account on the system, instead of a nologin shell. Providing all users with a shell may not be ideal for some environments, such as a shared web host. However, it is possible to restrict such accounts to only SFTP and disable shell interaction.

To configure FTPS, edit /etc/vsftpd.conf and at the bottom add:

ssl_enable=YES

Also, notice the certificate and key related options:

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

By default these options are set to the certificate and key provided by the ssl-cert package. In a production environment these should be replaced with a certificate and key generated for the specific host.

The below screenshots confirms that the FTPS is configured and now the connections is encrypted between the sender & the reciever with SSL/TLS

PreviousNFS - Network File SystemNextAIDE

Last updated 2 months ago

đŸ•šī¸