Guest User

Untitled

a guest
Nov 5th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. BASH:
  2. loginStamp=$( curl -s -c cookie.txt "http:/URLdoSTRONYlogowania" | grep loginstamp | cut -d "\"" -f8 );
  3.  
  4. curl -Ls -b cookie.txt "http://URLdoSTRONYlogowania/security_check" \
  5. -H "Referer: http://refererURL" \
  6. --data "loginstamp=$loginStamp&j_username=$userName&j_password=$passWord"
  7.  
  8. PHP:
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_URL, 'http:/URLdoSTRONYlogowania');
  11. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  13. $store=curl_exec($ch);
  14. preg_match("/loginstamp.*/", $store, $x);
  15. $ls=explode("\"", $x[0]);
  16. $loginStamp=$ls[4];
  17. curl_close($ch);
  18.  
  19. $ch = curl_init();
  20. curl_setopt($ch, CURLOPT_URL, http://URLdoSTRONYlogowania/security_check');
  21. curl_setopt($ch, CURLOPT_POST, 1);
  22. curl_setopt($ch, CURLOPT_POSTFIELDS, 'loginstamp='.$loginStamp.'&j_username='.$userName.'&j_password='.$passWord.'');
  23. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  24. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  25. curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  27. curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment