Scripts for notifying a action taken in the honeypots.

notifywebteacher.py 661B

1234567891011121314151617181920
  1. import smtplib, ssl
  2. import requests
  3. from bs4 import BeautifulSoup
  4. email="josedeception00@gmail.com"
  5. port = 465
  6. password = "honeypot2020"
  7. s= requests.Session()
  8. r=s.get('http://localhost/moodle/login/index.php')
  9. soup = BeautifulSoup(r.text, 'html.parser')
  10. logintoken = soup.find('input', {"name": "logintoken"} )['value']
  11. login_data= {'logintoken':logintoken,'username':'joserico' ,'password': 'W@tcher2020'}
  12. s.post('http://localhost/moodle/login/index.php', login_data)
  13. url = 'http://localhost/moodle/user/profile.php?id=3'
  14. r= s.get(url)
  15. soup = BeautifulSoup(r.text, 'html.parser')
  16. time=soup.find_all('dd')
  17. time=time[4]
  18. print(time)
  19. requests.Session().close()