10

I have a PHP script set up that makes cURL requests whenever an action is performed on a site. The problem is that the information is being POSTed twice whenever the action is run.

I need to work out if this is a problem on my end (cURL is being run twice) or the URL it's POSTing to is doing something twice.

I imagine the best way to do this would be to view the outgoing http POST requests from the server.

Is this the best option? If so, how do I go about it?

2 Answers 2

10

You can use tcpdump to sniff some packets on the server, something like this:

# tcpdump -vv -s0 tcp port 80 -w /tmp/apache_outgoing.pcap

and run your PHP script to see what happens.


Is there any way to restrict it to a) Only POST data,

You can sniff all and filter with http.request.method == POST in Wireshark.

b) Only coming from 1.1.1.1

# tcpdump -vv -s0 tcp port 80 and src host 1.1.1.1

and c) only going to 2.2.2.2 ?

# tcpdump -vv -s0 tcp port 80 and dst host 2.2.2.2

Read the tcpdump's man page for more details.

1
  • Thanks, this gives me way too much information to process though. Is there any way to restrict it to a) Only POST data, b) Only coming from 1.1.1.1 and c) only going to 2.2.2.2 ?
    – Sam
    Sep 2, 2011 at 15:15
0

Better To filter this way

tcpdump src host YOUR-OUTGOING-INterface-IP and dst port 80 or dst port 443
1
  • I'm not sure why this was downvoted so many times. It brought me to what I needed. May 3, 2019 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .