403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/sisimai/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/sisimai/sisimai_parserold.py
import pymysql
from datetime import datetime

import os
import json
import urllib2
import psutil

def visit_link(link):
    try:
        req = urllib2.Request(link)
        response = urllib2.urlopen(req)
        html_response = response.read()
        return True
    except HTTPError, e:
        print "HTTP ERROR: %s" % e
        return False

# define process I/O niceness
p = psutil.Process()
p.ionice(psutil.IOPRIO_CLASS_IDLE)

# read JSON file which is in the next parent folder
file = '/opt/sisimai/bounces.json'
json_data= open(file).read()
json_obj = json.loads(json_data)


# connect to MySQL
con = pymysql.connect(host = 'writer-primary.cemzxojvmybt.us-east-1.rds.amazonaws.com', user = 'admin', passwd = 'xxatN6Lb8Kbwb9MiU1At', db = 'sisimai', port =3306)
cursor = con.cursor()


# parse json data to SQL insert
try:
    for i, item in enumerate(json_obj):
        subject = item.get("subject", None)
        deliverystatus = item.get("deliverystatus", None)
        token = item.get("token", None)
        feedbacktype = item.get("feedbacktype", None)
        softbounce = item.get("softbounce", None)
        rhost = item.get("rhost", None)
        smtpcommand = item.get("smtpcommand", None)
        smtpagent = item.get("smtpagent", None)
        alias = item.get("alias", None)
        lhost = item.get("lhost", None)
        diagnostictype = item.get("diagnostictype", None)
        listid = item.get("listid", None)
        action = item.get("action", None)
        timestamp = datetime.fromtimestamp(item.get("timestamp", None))
        reason = item.get("reason", None)
        replycode = item.get("replycode", None)
        messageid = item.get("messageid", None)
        recipient = item.get("recipient", None)
        destination = item.get("destination", None)
        senderdomain = item.get("senderdomain", None)
        diagnosticcode = item.get("diagnosticcode", None)
        addresser = item.get("addresser", None)
        print timestamp
        print recipient
        if recipient not in ["[email protected]"]:
            cursor.execute("INSERT INTO `sisimai`.`bounces` (`id`, `reason`, `replycode`, `messageid`, `recipient`, `destination`, `senderdomain`, `diagnosticcode`, `addresser`, `subject`, `deliverystatus`, `token`, `feedbacktype`, `softbounce`, `rhost`, `smtpcommand`, `smtpagent`, `alias`, `lhost`, `diagnostictype`, `listid`, `action`, `timestamp`) VALUES (NULL, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);", (reason, replycode, messageid, recipient, destination, senderdomain, diagnosticcode, addresser, subject, deliverystatus, token, feedbacktype, softbounce, rhost, smtpcommand, smtpagent, alias, lhost, diagnostictype, listid, action, timestamp))
            print('Adding a new netry')
    con.commit()
    con.close()
except pymysql.InternalError as e:
    print('Got error {!r}, errno is {}'.format(e, e.args[0]))

Youez - 2016 - github.com/yon3zu
LinuXploit