NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


import smtplib
import os
import time

# SMTP email server configuration
SMTP_SERVER = 'smtp.example.com'
SMTP_PORT = 587
SMTP_USERNAME = '[email protected]'
SMTP_PASSWORD = 'mxgab4T'

# Sender and recipient email addresses
SENDER_EMAIL = '[email protected]'
RECIPIENT_EMAIL = '[email protected]'

# Path to Sliver C2 log file
SLIVER_LOG_FILE = '/path/to/sliver.log'

def check_sliver_logs():
# Check if the Sliver log file exists
if not os.path.isfile(SLIVER_LOG_FILE):
print("Sliver log file not found.")
return

# Read the last modified time of the log file
last_modified_time = os.path.getmtime(SLIVER_LOG_FILE)

# Store the last seen modified time
last_seen_modified_time = last_modified_time

while True:
# Check if the log file has been modified
current_modified_time = os.path.getmtime(SLIVER_LOG_FILE)

if current_modified_time != last_seen_modified_time:
# The log file has been modified, process the changes
with open(SLIVER_LOG_FILE, 'r') as file:
log_content = file.read()

# Check if there are any new beacon entries
if 'beacon' in log_content.lower():
# Send email notification
send_email_notification()

# Update the last seen modified time
last_seen_modified_time = current_modified_time

# Sleep for 1 minute before checking again
time.sleep(60)

def send_email_notification():
subject = 'New Beacon Detected on Sliver C2'
body = 'A new beacon has been detected on Sliver C2.'

try:
server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
server.starttls()
server.login(SMTP_USERNAME, SMTP_PASSWORD)

message = f'Subject: {subject}nn{body}'

server.sendmail(SENDER_EMAIL, RECIPIENT_EMAIL, message)
print("Email notification sent successfully.")

except Exception as e:
print(f"Error sending email notification: {str(e)}")

finally:
server.quit()

# Start checking Sliver logs and send notifications
check_sliver_logs()
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.