• XSS.stack #1 – первый литературный журнал от юзеров форума

Bash скрипт нужна помощь

PrikolBullet

RAM
Забанен
Регистрация
23.05.2022
Сообщения
108
Реакции
16
Пожалуйста, обратите внимание, что пользователь заблокирован
Большую часть времени не дома, нужен скрипт с любыми уведомлениями на телефон(мессенджер или что то иное) при завершении сканирования sqlmap/Брута wpscan для запуска следующего на сервере. Подскажите как лучше организовать такой механизм
 
У телеги есть понятный апи. Можно хоть curl'ом отправлять сообщения.
Как вариант, Python + модуль для удобного вам протокола (та-же телега, джаббер и ко).
 
I'll leave you an article showing a really easy way I've already tested and used many times; it will allow you to setup an alias able to forward customized notifications on Telegram using a bot.



If you need any help setting it up just let me know :)
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Я не программист, но вот что у меня получилось с гуглом. Простор для фантазии безграничен в самом деле, но это самое простейшее, главное рабочее. Завтра уже с мапой буду проверять)
Python:
import subprocess
# Задаем команду
command= 'curl google.com'
tg = ['curl', '-s', '-X', 'POST', 'https://api.telegram.org/bot&API_BOT/sendMessage', '-d', 'chat_id=&CHAT_ID', '-d', 'text="ALAAAARM"']
pop1 = subprocess.Popen(command, encoding='cp866', shell=True, stdout=subprocess.PIPE)
# окончание выполнения команды
out1 = pop1.stdout.read()
print("END".center(80, '='))
process = subprocess.Popen(tg, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
print(out1)
 
Я не программист, но вот что у меня получилось с гуглом. Простор для фантазии безграничен в самом деле, но это самое простейшее, главное рабочее. Завтра уже с мапой буду проверять)
Python:
import subprocess
# Задаем команду
command= 'curl google.com'
tg = ['curl', '-s', '-X', 'POST', 'https://api.telegram.org/bot&API_BOT/sendMessage', '-d', 'chat_id=&CHAT_ID', '-d', 'text="ALAAAARM"']
pop1 = subprocess.Popen(command, encoding='cp866', shell=True, stdout=subprocess.PIPE)
# окончание выполнения команды
out1 = pop1.stdout.read()
print("END".center(80, '='))
process = subprocess.Popen(tg, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
print(out1)
Возможно это уже не актуально, но кому-то будет полезно:
Python:
import subprocess

# Set up the command to run
command = ['curl', 'google.com']
# Set up the Telegram notification message with the correct API token and chat ID
tg = ['curl', '-s', '-X', 'POST', 'https://api.telegram.org/bot<API_TOKEN>/sendMessage', '-d', 'chat_id=<CHAT_ID>', '-d', 'text="ALAAAARM"']

# Start the command in a subprocess
pop1 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
# Wait for the command to finish
out1 = pop1.stdout.read()
print("END".center(80, '='))
# Send a Telegram notification that the command has finished
process = subprocess.Popen(tg, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
# Print the output of the command
print(out1.decode())

Большую часть времени не дома, нужен скрипт с любыми уведомлениями на телефон(мессенджер или что то иное) при завершении сканирования sqlmap/Брута wpscan для запуска следующего на сервере. Подскажите как лучше организовать такой механизм
с отправкой в ТГ, но само собой нужно редачить все под себя
Python:
import subprocess

# Set up the commands to run
sqlmap_command = ['sqlmap', '--url', 'http://example.com']
brute_command = ['wpscan', '--url', 'http://example.com']
# Set up the Telegram notification messages with the correct API token and chat ID
sqlmap_tg = ['curl', '-s', '-X', 'POST', 'https://api.telegram.org/bot<API_TOKEN>/sendMessage', '-d', 'chat_id=<CHAT_ID>', '-d', 'text="sqlmap has finished"']
brute_tg = ['curl', '-s', '-X', 'POST', 'https://api.telegram.org/bot<API_TOKEN>/sendMessage', '-d', 'chat_id=<CHAT_ID>', '-d', 'text="Brute has finished"']

# Start the sqlmap command in a subprocess
sqlmap_proc = subprocess.Popen(sqlmap_command, stdout=subprocess.PIPE)
# Wait for the sqlmap command to finish
out1 = sqlmap_proc.stdout.read()
# Send a Telegram notification that sqlmap has finished
process = subprocess.Popen(sqlmap_tg, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
# Print the output of the sqlmap command
print(out1.decode())

# Start the Brute command in a subprocess
brute_proc = subprocess.Popen(brute_command, stdout=subprocess.PIPE)
# Wait for the Brute command to finish
out2 = brute_proc.stdout.read()
# Send a Telegram notification that Brute has finished
process = subprocess.Popen(brute_tg, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
# Print the output of the Brute command
print(out2.decode())
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх