Hack Forums
CURL grab text from Ajax page - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43)
+---- Thread: CURL grab text from Ajax page (/showthread.php?tid=6226930)



CURL grab text from Ajax page - zazas - Nov 7, 2022

Hi, how to read data with PHP CURL from Ajax page? I want read text but CURL dont see anything, what I should do to grab text?


RE: CURL grab text from Ajax page - Mr. Robot - Nov 7, 2022

Can you link an example site


RE: CURL grab text from Ajax page - zazas - Nov 7, 2022

(Nov 7, 2022 02:04 AM)Mr. Robot Wrote:  Can you link an example site

This site needs login, but I can show you screen shot how it looks https://part.lt/img/c59a6b11b3d324781c084cbe3bf500cf585.jpg


RE: CURL grab text from Ajax page - Mr. Robot - Nov 7, 2022

(Nov 7, 2022 02:18 AM)zazas Wrote:  This site  needs login, but I can show you screen shot how it looks https://part.lt/img/c59a6b11b3d324781c084cbe3bf500cf585.jpg

Have you tried setting cookies in your curl request?


RE: CURL grab text from Ajax page - zazas - Nov 7, 2022

(Nov 7, 2022 02:23 AM)Mr. Robot Wrote:  Have you tried setting cookies in your curl request?

Yes, I login in that site, everything is ok but I can't see Javascript text, only links visible. I know that site using Ajax and Javascript


RE: CURL grab text from Ajax page - Mr. Robot - Nov 7, 2022

(Nov 7, 2022 02:31 AM)zazas Wrote:  Yes, I login in that site, everything is ok but I can't see Javascript text, only links visible. I know that site using Ajax and Javascript

Yes but are you specifying your cookies manually in your curl request. It wont take it from your browser session.


RE: CURL grab text from Ajax page - zazas - Nov 7, 2022

(Nov 7, 2022 02:41 AM)Mr. Robot Wrote:  Yes but are you specifying your cookies manually in your curl request. It wont take it from your browser session.

Manually no. Why cookies so important at this point? Sorry newbie here.

My curl answer: https://part.lt/img/0c21cf1caf9c84e16ef35afee30e53fe716.png


RE: CURL grab text from Ajax page - Mr. Robot - Nov 7, 2022

(Nov 7, 2022 03:00 AM)zazas Wrote:  Manually no. Why cookies so important at this point? Sorry newbie here.

My curl answer: https://part.lt/img/0c21cf1caf9c84e16ef35afee30e53fe716.png

Cookies are important because they tell the script you are logged in - if that's the only way to see them then you have to specify them.


RE: CURL grab text from Ajax page - BX1xrang - Nov 8, 2022

(Nov 7, 2022 05:52 AM)Mr. Robot Wrote:  Cookies are important because they tell the script you are logged in - if that's the only way to see them then you have to specify them.

Don't modern website use local storage to store auth token?


RE: CURL grab text from Ajax page - Mr. Robot - Nov 8, 2022

(Nov 8, 2022 12:25 PM)BX1xrang Wrote:  Don't modern website use local storage to store auth token?

Yes but he will be running his curl request outside of that session.


RE: CURL grab text from Ajax page - Brief - Nov 9, 2022

(Nov 8, 2022 12:25 PM)BX1xrang Wrote:  Don't modern website use local storage to store auth token?

I am currently learning about cookies. I understand how cURL needs to be specified cookie in the request. Mr. Robot seemed to understand the point you were trying to make, but I don't.

How do you mean by that?


RE: CURL grab text from Ajax page - Mr. Robot - Nov 10, 2022

(Nov 9, 2022 11:31 AM)Bl4ckfir3 Wrote:  I am currently learning about cookies. I understand how cURL needs to be specified cookie in the request. Mr. Robot seemed to understand the point you were trying to make, but I don't.

How do you mean by that?

Login to the website, right click it - click inspect element, click the storage/application tab then under storage click cookies.


RE: CURL grab text from Ajax page - Brief - Nov 11, 2022

I see what he meant now. Thanks.