It does not work because Facebook requires you to submit more information. By simply monitoring the network traffic you can see that the "Login" is done in:
https://m.facebook.com/login/async/
It also sends a lot of data and not simply "email" and "password":
m_ts:
li:
try_number:
unrecognized_tries:
email:
pass:
m_sess:
fb_dtsg:
lsd:
__dyn:
__req:
__ajax__:
__user:
If you disable Javascript, you will use https://m.facebook.com/login.php
, the same as your cURL, but containing the information in the body:
lsd:
m_ts:
li:
try_number:
unrecognized_tries:
email:
pass:
login:
_fb_noscript:
So, you need to figure out how they are generated and what they mean and then reproduce it in cURL, so you can log in.
If you keep sending only email
and pass
you will never be able to access, at least it would not be logical for Facebook to allow this, perhaps some information may not be sent, but this will have to be tested one by one. p>
Remember that Facebook has an API using OAuth, which is much safer than using login / password.