This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Using wireshark to control a website’s AJAX

0

I asked this question on stackoverflow and was told "Use Wireshark". I'm a noob, and see nothing on your site I recognize as related to my question.

I'm using perl to scrape data from a website. Now the website has changed, so it only loads the data via AJAX in response to entry into a textbox and clicking a submit button.

How can my perl program simulate that user input and capture the resulting new page?

Is this something that Wireshark can help me with?

asked 16 Mar '14, 00:32

hsfrey's gravatar image

hsfrey
11112
accept rate: 0%


3 Answers:

0

The guys at StackOverflow probably meant that you could use Wireshark to capture the traffic of a normal website visit (via manually browsing to it), and than capture what your perl script does and compare the requests and answer content. At least that's what I would do to make sure my script mimics the manual way of accessing the site.

Very often a site not only looks at the URL that you pass in the request, but also the referrer, user agent, cookies and other details carried in the HTTP header of the request. So Wireshark can show you what they are when surfing on the site with a browser. Use these values and mimic them in your script, and it should work.

answered 16 Mar '14, 04:58

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

0

I recognize as related to my question.

well, what was you question on stackoverflow !?!

How can my perl program simulate that user input and capture the resulting new page?

how did you figure out the structure of the web site in the first place? Just repeat that step for the new site structure

Is this something that Wireshark can help me with?

It will show you requests and responses to/from the site. However, in your case any browser developer tool (like Firebug for Firefox) would be much better.

Regards
Kurt

answered 16 Mar '14, 05:12

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 16 Mar '14, 13:15

0

You might also want to take a look at an intercepting web proxy like Burpsuite (http://portswigger.net/burp/). You can intercept and examine the packets flowing in each direction in real time, and use that information to make adjustments in your perl script. The free version of Burpsuite should be sufficient for the task.

answered 16 Mar '14, 07:10

griff's gravatar image

griff
36139
accept rate: 10%