Experiencing a Security Incident? → 24/7 Response: +91 73059 79248
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security All MSSP Services →
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score Layered Security Philosophy All Maturity Services →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Briskinfosec is a CREST accredited cybersecurity firm, globally recognized for penetration testing and VAPT services Briskinfosec is a CERT-In empanelled cybersecurity company based in Chennai with global operations in Dubai
Get Your bSafe Score →
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance Services →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score → Layered Security Philosophy →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Home → Blog → What Is FTP Penetration Testing and What...
Web Application Security

What Is FTP Penetration Testing and What It Is Not?

July 05, 2022
9 min read
7,939 Views
Contents
What Is FTP Penetration Testing and What It Is Not?

What Is FTP?

File transfer protocol, a standardized protocol used to allow transmission of files between computers. It consists of a set of coded signals which are transmitted between computers, and which inform the receiving computer of the nature of a packet of information to be transmitted, and inform the transmitting computer when a packet has been successfully received.

Protocol that allows users to copy files between their local system and any system they can reach on the network.

How Does FTP Work?

FTP connection needs two distinct communication channels while establishing an FTP connection.

 The first one is called the command channel where it initiates the instruction and response.

The other one is called a data channel, where the distribution of data happens.

image

This connection can be established in two ways:

In active connection mode to get or transfer a file, an authorized user will use the protocol to request on creating changes in the server. In return, the server will grant that access.

image

The passive mode is used to establish both command and the data channel. This mode then asks the server to listen rather than to attempt to create a connection back to the user.

image

Uses Of FTP Service:

  • An FTP site is a website that allows users to easily upload and download files.
  • FTP by mail allows users who do not have Internet access to access and copy files using anonymous FTP by sending an email to ftpmail@decwrl.dec.com with the word help in the body of the message.
  • FTP Explorer is an FTP client that is built on the Windows 95 file manager (Windows 95 Explorer).
  • An FTP server is a computer that is dedicated to providing FTP services. This attracts hackers and necessitates the use of security hardware or software such as usernames, passwords, and file access control.
  • An FTP client is a computer programme that connects to an FTP server.
  • While doing so, users should use passive mode to block incoming FTP connection attempts and scan all downloaded files for viruses.

Penetration Testing On FTP Service:

Scanning is important in penetration testing because it allows attackers to determine which services and open ports are available for enumeration and attack.

In this case, we're scanning port 21 with nmap. Nmap is an abbreviation for Network Mapper. It is a free and open-source Linux command-line tool for scanning IP addresses and ports in a network and detecting installed applications.

image

FTP port scanning and version detection:

Use Nmap to find open ports on Internet facing systems with this online port scanner.

Test servers, firewalls and network perimeters with Nmap Online providing the most accurate port status of a systems Internet footprint.

                nmap -p 21 192.168.1.22 -sV

If the service is enabled on the targeted server, nmap displays an open STATE for port 21.

image

Anonymous login:

FTP users must authenticate themselves using a clear-text sign-in protocol, typically a username and password, but they can connect anonymously if the server is configured to allow it.If admin allows anonymous login to connect with FTP, then anyone can login to the server.

Using the following metasploit exploit, an attacker can easily search for anonymous login permission.

Using Metasploit:

use auxiliary/scanner/ftp/anonymous

 msf6 auxiliary(scanner/ftp/anonymous) > set rhosts 192.168.1.22

 msf6 auxiliary(scanner/ftp/anonymous) > run

image

Using Nmap:

               nmap -p 21 -sV --script=ftp-anon.nse 192.168.1.22

image

Using manual method:

      ftp 192.168.1.22

image

Disable Anonymous Login

In order to secure your server from anonymous user login then follow given below steps:

  • Open vsftpd.conf file
  • Set anonymous enable = NO
  • service vsftpd restart

Some FTP commands

  • USER username
  • PASS password
  • HELP The server indicates which commands are supported
  • PORT 127,0,0,1,0,80This will indicate the FTP server to establish a connection with the IP 127.0.0.1 in port 80 (you need to put the 5th char as "0" and the 6th as the port in decimal or use the 5th and 6th to express the port in hex).
  • EPRT |2|127.0.0.1|80|This will indicate the FTP server to establish a TCP connection (indicated by "2") with the IP 127.0.0.1 in port 80. This command supports IPv6.
  • LIST This will send the list of files in current folder
  • APPE /path/something.txt This will indicate the FTP to store the data received from a passive connection or from a PORT/EPRT connection to a file. If the filename exists, it will append the data.
  • STOR /path/something.txt Like APPE but it will overwrite the files
  • STOU /path/something.txt Like APPE, but if exists it won't do anything.
  • RETR /path/to/file A passive or a port connection must be establish. Then, the FTP server will send the indicated file through that connection
  • REST 6 This will indicate the server that next time it send something using RETR it should start in the 6th byte.
  • TYPE i Set transfer to binary
  • PASV This will open a passive connection and will indicate the user were he can connects

Common Credentials

A few common passwords or usernames (if unknown) such as admin, administrator, root, ftpuser, test etc. should be tried if anonymous authentication is disabled on the remote FTP server. This is safer than bruteforcing and it should always be tried when possible.

FTP sniffing:

The practise of gathering, collecting, and logging some or all packets that pass through a computer network, regardless of how the packet is addressed, is known as packet sniffing.

Because data transmitted over FTP on port 21 is unencrypted, an attacker could intercept network traffic and identify the credentials used for authentication.

Wireshark is a well-known network sniffing and packet analyzing tool that can be used to accomplish this.

The main screen displays all network traffic (in this case, a filter for port 21 - ftp has been applied):

image

image

FTP brute force attack using metasploit:

Launch Metasploit.

The first service we will attempt to attack is FTP, and the auxiliary that will assist us in this endeavour is auxiliary/scanner/ftp/ftp login.

To use this auxiliary, enter the following command:

msfconsole

use auxiliary/scanner/ftp/ftp_login

set RHOSTS

set RPORT

set USER_FILE

set PASS_FILE

run

image

image

Connecting FTP Service Using Winscp:

Now let’s ensure whether we can connect to FTP server through winscp.

Protocol to: FTP

Encryption To: No Encryption

Host name: IP of the FTP Server

Port: 21

Username and Password: anonymous: anonymous

Click on login

image

Similarly, an attacker can gain access to your FTP server; therefore, it is critical for administrators to not grant anonymous users access to the server.

image

Browser Connection:

You can connect to a FTP server using a browser (like Firefox) using a URL like:

ftp://username:password@192.168.1.22

Note that if a web application is sending data controlled by a user directly to a FTP server you can send double URL encode %0d%0a (in double URL encode this is %250d%250a) bytes and make the FTP server perform arbitrary actions. One of this possible arbitrary action is to download content from a user’s-controlled server, perform port scanning or try to talk to other plain-text based services (like http).

FTP Hardening:

Depending on the software you're using for your FTP server, the specified options may be located in different locations and have different names.

Check the steps below and find guides to configure your specific server software; remember to restart your FTP server after each change.

  • Turn off anonymous login. Open your server configuration and disable the anonymous login connection. Only authorised users with strong passwords should be granted access.
  • Hide the banner. Changes the configuration to conceal the name and version of the software you're using.
  • To prevent credential theft, use an SSL certificate. SSL is an abbreviation for Secure Sockets Layer, a protocol that provides secure, encrypted communications between server and client. This protocol encrypts data packets travelling between server-client networks. If a hacker sniffs your connection, he will be unable to read the captured information because the entire data will be displayed in the form of cypher text.
  • Set a policy for account lockouts based on a certain threshold. For example, if the password is entered incorrectly three times within a minute, the account should be locked; if there are five incorrect connections from a given IP address within one minute, the connection from this address should be blocked for 24 hours. This can be accomplished through the use of firewall rules or software such as ufw, portsentry, or fail2ban.
  • Allow a specific IP address to connect to the FTP server. Simply create a whitelist of addresses that can connect to the FTP server while blocking connections from other locations.

Additionally, you can change the default port from 21 to 5021. Vulnerability scanners typically scan the default ports to perform automatic reconnaissance and analysis of a potential attack.

image

Frequently Asked questions

What makes FTP vulnerable?

FTP was not designed to be secure.

It is widely regarded as an insecure protocol because it relies on clear-text usernames and passwords for authentication and does not employ encryption.

FTP data is vulnerable to sniffing, spoofing, and brute force attacks, among other common attack methods.

Should I disable FTP?

You should disable plain FTP on your file transfer server because it transmits data in plaintext. This means that the transmission can be intercepted by a packet sniffer, and whoever is using the packet sniffer can easily obtain sensitive information such as the user's username and password. However, you can create an SSL certificate to secure the transmission.

Web Application Security Network Security
Share this article
A
Written by
Arulselvar Thomas Founder & Director
Cybersecurity expert at Briskinfosec Technology and Consulting, specializing in security assessments, compliance, and helping organizations build resilient security postures.
Recent Blogs
Building an AI-Augmented SOC That Actually Works
How to Create a Secure AWS IAM Audit User for Cloud Security Assessments
The Cyber Capability Gap Between Mythos, GPT-5.5 and Open-Weight Models Explained
Related Services
VAPT Cloud Security Red Team Network Security API Security Mobile App Security
Latest Videos
Navigating Compliance in Cybersecurity Laws, Privacy laws and Your Business
Navigating Compliance in Cybersecurity Laws,...
Apr 26, 2024
Beyond Size: How to Elevate your SOC Cybersecurity Monitoring
Beyond Size: How to Elevate your SOC Cybersec...
Mar 20, 2024
Red Team Assessment
Red Team Assessment
Mar 13, 2024
Get Protected

Discuss your security posture with our certified experts. Get a free initial assessment.

Schedule Free Consultation WhatsApp Us

Related Articles

Zero Trust Architecture Beyond the Traditional Network Perimeter
Zero Trust Architecture Beyond the Traditional Network Perimeter
Feb 06, 2026 · 1,076
Ransomware The Deadliest Threat to Modern Cybersecurity
Ransomware The Deadliest Threat to Modern Cybersecurity
Jun 18, 2024 · 5,023
Mastering Web App VAPT The Complete Guide
Mastering Web App VAPT The Complete Guide
Apr 26, 2024 · 9,352
Read Next (Top Blog)
Getting Started with Frida

Ready to Strengthen Your Security?

Talk to our CREST-certified security experts today

WhatsApp Us
Chat instantly with our security team
AI Presales Bot
Get instant answers from LURA AI
Schedule Consultation
Book a free security consultation
Email Us
contact@briskinfosec.com
Link copied to clipboard!
About Us
About Briskinfosec Certin Our Clients Testimonials Press Room
Services
Application Security Mobile App Security Cloud Security Red Team Operations SOC as a Service MSSP All Services →
Compliance
ISO 27001 SOC 2 PCI-DSS GDPR HIPAA All Compliance →
Resources
Blog Videos Case Studies Threatsploit Reports All Resources →
Connect
Careers Partnership Contact Us Responsible Disclosure Terms and Conditions Privacy Policy
India (HQ) Bascon Futura Sv It Park, 12th Floor, 10/2,
Venkatanarayana Rd, T. Nagar, Chennai, Tamil Nadu 600017
+91 73059 79248 · contact@briskinfosec.com
UAE (Dubai) IFZA Business Park, Building A1, Dubai Digital Park,
Dubai Silicon Oasis, Post Box 342001, UAE
contact@briskinfosec.com
Briskinfosec CREST accredited cybersecurity company and globally recognized provider of penetration testing and VAPT services CERT-In empanelled cybersecurity company with headquarters in Chennai and operations in Dubai offering VAPT services Briskinfosec ISO 27001 certified company ensuring robust information security management system Briskinfosec ISO 9001:2015 certified cybersecurity company committed to quality management in India Briskinfosec is a DUNS registered cybersecurity company with a verified global business identity offering VAPT services
© 2026 Briskinfosec Technology & Consulting Pvt Ltd. All rights reserved.
Scope Your Security Program
Chat on WhatsApp Ask LURA AI AI