Skip to content

How to simulate a Minerva Login with curl

Nicholas Paun edited this page Sep 8, 2016 · 1 revision

Method

  1. Get the login page: curl -D - https://horizon.mcgill.ca/pban1/twbkwbis.P_WWWLogin -b cookies.tmp -c cookies.tmp
  2. Submit the login page: curl -D - --data 'sid=<mcgill id goes here>&PIN=<minerva pin goes here>' https://horizon.mcgill.ca/pban1/twbkwbis.P_ValLogin -b cookies.tmp -c cookies.tmp
  3. Get a page to prove you're logged in: curl -D - 'https://horizon.mcgill.ca/pban1/twbkwbis.P_GenMenu?name=bmenu.P_MainMnu' -b cookies.tmp -c cookies.tmp

Explanation

  • -D -: Prints headers so you can better see what Minerva is doing.
  • -b: Load cookies from the file cookies.tmp.
  • -c: Save cookies to the file cookies.tmp.

Hints

  • Set the Referer header. Some Minerva functions seem to require it.
  • Try to echo back all the form fields received. Some pages, especially in the registration menu depend on the order of fields received and their content.

Clone this wiki locally