Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wellington1993/3f7d736b091c3914a57cdafbef7f5f07 to your computer and use it in GitHub Desktop.
Save wellington1993/3f7d736b091c3914a57cdafbef7f5f07 to your computer and use it in GitHub Desktop.
PHP, exemplo busca de CSRF Token do Rails, usando meta tags
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
# phpinfo();
$url = 'https://lablaudo.com.br/home';
$tags = get_meta_tags($url);
# print_r($tags);
printf($tags['csrf-token']);
?>
<input name="Teste" value="<?php echo $tags['csrf-token']; ?>" />
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
# phpinfo();
$url = 'https://lablaudo.com.br/acesso_chave/?serie=0000';
$tags = get_meta_tags($url);
# print_r($tags);
printf($tags['csrf-token']);
?>
<input name="Teste" value="<?php echo $tags['csrf-token']; ?>" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment