Scripts for notifying a action taken in the honeypots.

login.py 740B

123456789101112131415161718
  1. import requests
  2. from bs4 import BeautifulSoup
  3. s= requests.Session()
  4. r=s.get('http://localhost/moodle/login/index.php')
  5. soup = BeautifulSoup(r.text, 'html.parser')
  6. logintoken = soup.find('input', {"name": "logintoken"} )['value']
  7. login_data= {'logintoken':logintoken,'username':'dummy1' ,'password': 'Dummy@123'}
  8. s.post('http://localhost/moodle/login/index.php', login_data)
  9. url = 'http://localhost/moodle/pluginfile.php/37/mod_resource/content/1/silabo-de-lengua-i-1-728.jpg'
  10. r= s.get(url)
  11. with open('something.jpg', 'wb') as f:
  12. f.write(r.content)
  13. url='http://localhost/moodle/pluginfile.php/38/mod_resource/content/1/Greetings.pdf'
  14. r= s.get(url)
  15. with open('espanol.pdf', 'wb') as f:
  16. f.write(r.content)
  17. requests.Session().close()