Wireless Army
This is a blog / tips and tricks website for web developers and security researchers.
follow us in feedly


ftp vulnerability checker
by admin
 at 2017-05-22 04:08:00.

#!/usr/bin/env python
import socket

socket.setdefaulttimeout(2)
s = socket.socket()
try:
	s.connect(("wirelessarmy.com",21))
except Exception, e:
	print "[-] Error = "+str(e)
ans = s.recv(1024)

if ("FreeFloat Ftp Server (Version 1.00)" in ans):
	print "[+] Free Float FTP Server is vunerable."
elif ("3com 3CDaemon FTP Server version 2.0" in ans):
	print "[+] 3CDaemon FTP Server is vunerable."
elif ("Ability Server 2.34" in ans):
	print "[+] Ability FTP Server is vunerable."
elif ("Sami FTP server 2.0.2" in ans):
	print "[+] Sami FTP Server is vunerable."
else:
	print ans


more detailed

# if you are on linux it will use python to run the script instead of bash
#!/usr/bin/env python
#to make tcp connections
import socket 

#a default time out
socket.setdefaulttimeout(2)
s = socket.socket()
#the ip address and the port of the target (the try except will give and error if the ftp server is down)
try:
s.connect(("127.0.0.1",21))
except Exception, e:
	print "[-] Error = "+str(e)
# it will recive only the first 1024 bytes of data
ans = s.recv(1024)

#if it can find the string then print
if ("FreeFloat Ftp Server (Version 1.00)" in ans):
    print "[+] Free Float FTP Server is vunerable."
elif ("3com 3CDaemon FTP Server version 2.0" in ans):
    print "[+] 3CDaemon FTP Server is vunerable."
elif ("Ability Server 2.34" in ans):
    print "[+] Ability FTP Server is vunerable."
elif ("Sami FTP server 2.0.2" in ans):
    print "[+] Sami FTP Server is vunerable."
#if non was true then just print the data captured
else: print ans