Crafting HTTP POSTs that contain XML
February 20th, 2009An internal developer has been tasked with creating a communication system which will see an agent deployed to every machine enterprise-wide. The part of this system that facilitates communication is a web site running on an internal web server. The agents look to this site for communication addressed to their machine, and users can use the agent to send requests to the site.
At first glance, I wasn’t too concerned with the web site itself, because it didn’t seem there was much that could be done with it. After viewing similar sites, I could see that this was a page automatically generated by the development environment (.net or something?).
The page presents a list of supported operations. In this instance we have CreateRequest, and GetAlert. Clicking on either of these tells you EXACTLY what the site is expecting, in XML input. If only I could submit content without using the in-house developed agent..
At first I tried looking at a few Firefox extensions I’ve been meaning to try out such as HackBar and Tamper Data, but they did not understand XML elements.
Then I found this: http://snippets.dzone.com/posts/show/181
echo '
Using cURL, I could pipe XML content to it and effectively send this data to the URL that was expecting it. In one command I was able to add a request. In another, I was able to send communication to all hosts on the communication system.
The developer has since added authentication to this system.





