One Hat Cyber Team
Your IP :
3.144.118.174
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
sharedrads
/
oldrads
/
mailers
/
View File Name :
diskmovemailer.py
#!/opt/imh-python/bin/python3 """Copyright 2011 Erik Soroka - InMotion Hosting, Inc. - e@inmotion.net - ext 834 This script connects to an SMTP server using smtplib and sends in disk move tickets """ # libs and other stuff we need import sys from smtplib import SMTP import datetime # smtp debug level, raise for more verbosity debuglevel = 0 # lets make sure we received the necessary arguments if len(sys.argv) < 2: print( '\nThis script connects to an SMTP server using python\'s smtplib and sends in' ) print( 'disk move tickets. The message body must be passed through a pipe/stdin.\n' ) print("Usage: cat filename |", sys.argv[0], "<username> <server>\n") sys.exit(1) # setup smtp server info/credentials smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('mail.imhadmin.net', 25) smtp.login('lamar@imhadmin.net', 'QMgg-B+W35fL') # lets set variables based on arguments passed to us USERNAME = sys.argv[1] SERVER = sys.argv[2] # where our mail should come from from_addr = "IMH T3 Disk Management <no-replies@imhadmin.net>" # assign to addr from powerpanel result to_addr = "moves@imhadmin.net" # our subject subj = "DISK MOVE: " + USERNAME + " @ " + SERVER # fetch the date date = datetime.datetime.now().strftime("%m/%d/%Y %H:%M") # get the message from stdin message_text = sys.stdin.read() # send it msg = "From: {}\nTo: {}\nSubject: {}\nDate: {}\n\n{}".format( from_addr, to_addr, subj, date, message_text, ) smtp.sendmail(from_addr, to_addr, msg) smtp.quit() # EOF