-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch_id.py
More file actions
36 lines (33 loc) · 1.23 KB
/
Copy pathswitch_id.py
File metadata and controls
36 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import time
import subprocess
import sys
import re
fhand = open("password.txt", "r")
fw = open("edited.txt", "a")
user_list = []
pass_list = []
for line in fhand :
username,password = map(str, line.split())
user_list.append(username)
pass_list.append(password)
fhand.close()
for i in range(len(user_list)):
# print " username is %s and password is %s " %(username, password)
cmd = "curl -k -d mode=191 -d username={0} -d password={1} https://10.1.0.10:8090/login.xml".format(user_list[i], pass_list[i])
subprocess.call(cmd)
str1 = str(os.popen(cmd).readlines())
if re.findall('could not log you on.', str1) :
print "wrong combination, username= ",user_list[i]
else :
if re.findall('data transfer has been exceeded,', str1) :
print " data limit exceeded for username= ",user_list[i]
elif re.findall('deactivated', str1) :
print "Account deactivated"
else :
strn = "{0}, {1}\n".format(user_list[i], pass_list[i])
fw.write(strn);
time.sleep(1800)
cmd1 = "curl -k -d mode=193 -d username={0} https://10.1.0.10:8090/logout.xml".format(user_list[i])
subprocess.call(cmd1)
# time.sleep(15)