Giter VIP home page Giter VIP logo

autheverywhere's Introduction

AuthEveryWhere

Authenticate on any website without knowing the form parameters beforehand. Very useful to create scrapers.

This tool takes advantage of the WebDrivers through the splinter Python library. I have tested this using Firefox's driver only, but with a few tweaks it could probably also work with Chrome.

You will find a demo.py script which logs into GitHub and prints your account's email addresses.

What makes it different

Nowadays, web developers use more and more Ajax requests to build their websites. It makes it very hard to authenticate on unknown websites in your Python scripts : parsing html is easy, but Javascript is another beast.

Thanks to the web drivers, it's possible to "emulate" in our scripts an entire browser, executing javascript, following redirections, etc. What this module does is basically filling the login form and clicking (yep like a mouse click) the submit button. Once it's logged in, it gathers all the authenticated cookies, and that's it ! Thanks to thoses cookies, just by sending them alongside your next requests, you will be able to perform privileged stuff (assuming the website is using cookies as session management).

Dont be suprised, on older browsers the headless mode doesn't exist. It means that while running the script, you could see a Firefox window being opened and manipulated. On modern browsers you shouldn't see anything as long as the headless mode is supported.

Usage

If you're using Firefox, install its GeckoDriver.

On Debian-like distributions :

sudo apt install geckodriver

Then all you have to do is clone this repo, install the requirements, and move the aew folder to your project (no packaged release for now) :

git clone https://github.com/ShellCode33/AuthEveryWhere.git /tmp/
pip3 install -r /tmp/AuthEveryWhere/requirements.txt
cp -r /tmp/AuthEveryWhere/aew ~/Programing/MyProject/

Then import the module in your project :

import aew

And you will have access to the auth() function which returns cookies :

authenticated_cookies = aew.auth(login_page, username, password)

If the password is not specified, the module will ask it in your terminal.

autheverywhere's People

Contributors

shellcode33 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.