Skip to content

Instantly share code, notes, and snippets.

@sobi3ch
Created February 2, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sobi3ch/60f071c546747bf79b9e to your computer and use it in GitHub Desktop.
Save sobi3ch/60f071c546747bf79b9e to your computer and use it in GitHub Desktop.
Login to Drupal via https
#!/bin/bash
# Obviously change name and pass values and example.com domain
curl --insecure \
--cookie ./cookie.txt \
--cookie-jar ./cookie.txt \
-e example.com \
-d "name=admin" \
-d "pass=admin" \
-d "form_id=user_login" \
https://example.com/user
@sobi3ch
Copy link
Author

sobi3ch commented Feb 2, 2015

Then you can do authenticate requests like for instance download file from private directory:
$ curl --insecure --cookie cookie.txt -O https://example.com/admin/config/system/backup_migrate/settings/destination/downloadfile/manual/Example.com-2025-12-02T06-29-37.mysql.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment