Attempt to scratch the contents of https page with php. http was easily accessible as a snoopy class, There are a lot of data that https should be done using curl, so I am writing the access code with curl.
Current code.
<?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,"https://access address");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_SSLVERSION,3);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "ID name=ID value&PW name=PW value"));
curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($ch);
curl_close ($ch);
echo $result;
?>
// The account and password delivery part were the same result even if implemented as an array.
The result is 500 codes. As far as I know, the 500 code is the result of an error in the php source code The current environment is Apache, php7. I also removed the annotation to use the curl dll file in php.ini, and I also checked that there was a dll file. If you've experienced the same thing or know how to solve it, please give me some advice!<
php https crawling
There can be many reasons why it doesn't work.
(1) We use CSRF Token to prevent you from trying to access with ID/PW only like the code you posted. So it could be a problem.
(2) Is the access address you used correct for sending account information to POST? It should be an address that sends ID/PW to Post, not a site access address.
If you want to access https and read the information, you can read it by writing:
<?php
function getHTML($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RANGE, '0-100');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$content = curl_exec($ch);
curl_close($ch);
echo $url."<br>";
echo $content;
}
getHTML("https://hashcode.co.kr");
?>
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
582 PHP ssh2_scp_send fails to send files as intended
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.