Aug 22, 2025 08:19 PM
(This post was last modified: Aug 22, 2025 08:21 PM by LawrenceIII.)
Code
# spoof_sms_twilio.py
import argparse
from twilio.rest import Client
def send_sms_via_twilio(to_number: str, sender_id: str, message: str):
# Replace with your Twilio credentials
account_sid = "your_twilio_account_sid"
auth_token = "your_twilio_auth_token"
client = Client(account_sid, auth_token)
try:
message = client.messages.create(
body=message,
from_=sender_id,
to=to_number
)
print(f"Message sent successfully. SID: {message.sid}")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Send a spoofed SMS via Twilio")
parser.add_argument("--to", required=True, help="Recipient phone number (e.g. +1234567890)")
parser.add_argument("--from", dest="from_number", required=True, help="Spoofed sender ID (e.g. 'TestSender' or a Twilio number)")
parser.add_argument("--message", required=True, help="Message to send")
args = parser.parse_args()
send_sms_via_twilio(args.to, args.from_number, args.message)
[h1]spoof_sms_email.py[/h1]
import argparse
import smtplib
from email.message import EmailMessage
def send_sms_via_email_gateway(to_address: str, sender_email: str, message: str):
msg = EmailMessage()
msg.set_content(message)
msg["Subject"] = "" # Ignored for SMS
msg["From"] = sender_email
msg["To"] = to_address
# Replace with your SMTP settings (Gmail, etc.)
smtp_server = "smtp.gmail.com"
smtp_port = 587
smtp_user = "[email protected]"
smtp_pass = "your_app_password" # App password or SMTP token
try:
with smtplib.SMTP(smtp_server, smtp_port) as server:
server.starttls()
server.login(smtp_user, smtp_pass)
server.send_message(msg)
print(f"Email-to-SMS sent to {to_address} from {sender_email}")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Send a spoofed SMS via Email-to-SMS gateway")
parser.add_argument("--to", required=True, help="Carrier SMS gateway address (e.g. [email protected])")
parser.add_argument("--from", dest="from_email", required=True, help="Spoofed email sender (e.g. [email protected])")
parser.add_argument("--message", required=True, help="Message to send")
args = parser.parse_args()
send_sms_via_email_gateway(args.to, args.from_email, args.message)
python spoof_sms_twilio.py --to +1234567890 --from "TestLab" --message "This is a test"This is my first script so any constructive criticism or advice is greatly appreciated! Also posting here incase someone wants to fumble around with it for some practice.


