From 488a535fcf2ca666ac92358614f9fb79d8529f91 Mon Sep 17 00:00:00 2001 From: noud Date: Mon, 3 Sep 2012 13:53:44 +0200 Subject: [PATCH] REST cURL scripts, used besides example-rest.py to do REST testing. --- tools/curl/addEvent.sh | 2 ++ tools/curl/deleteEvent.sh | 2 ++ tools/curl/editEvent.sh | 6 ++++ tools/curl/indexEvents.sh | 2 ++ tools/curl/input/event.xml | 66 ++++++++++++++++++++++++++++++++++++++ tools/curl/viewEvent.sh | 2 ++ 6 files changed, 80 insertions(+) create mode 100755 tools/curl/addEvent.sh create mode 100755 tools/curl/deleteEvent.sh create mode 100755 tools/curl/editEvent.sh create mode 100755 tools/curl/indexEvents.sh create mode 100644 tools/curl/input/event.xml create mode 100755 tools/curl/viewEvent.sh diff --git a/tools/curl/addEvent.sh b/tools/curl/addEvent.sh new file mode 100755 index 000000000..e2cd80ba3 --- /dev/null +++ b/tools/curl/addEvent.sh @@ -0,0 +1,2 @@ +curl -i -H "Accept: application/xml" -H "content-type: text/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +--data "@input/event.xml" -X POST http://localhost/events diff --git a/tools/curl/deleteEvent.sh b/tools/curl/deleteEvent.sh new file mode 100755 index 000000000..a9ed570fc --- /dev/null +++ b/tools/curl/deleteEvent.sh @@ -0,0 +1,2 @@ +curl -H "Accept: application/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +-X DELETE http://localhost/events/$1 diff --git a/tools/curl/editEvent.sh b/tools/curl/editEvent.sh new file mode 100755 index 000000000..491340549 --- /dev/null +++ b/tools/curl/editEvent.sh @@ -0,0 +1,6 @@ +curl -H "Accept: application/xml" -H "content-type: text/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +--data "@input/event.xml" -X PUT http://localhost/events/14 + +# POST can be used as well.. +#curl -H "Accept: application/xml" -H "content-type: text/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +#--data "@input/event.xml" -X POST http://localhost/events/14 diff --git a/tools/curl/indexEvents.sh b/tools/curl/indexEvents.sh new file mode 100755 index 000000000..4deb43dc1 --- /dev/null +++ b/tools/curl/indexEvents.sh @@ -0,0 +1,2 @@ +curl -H "Accept: application/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +-X GET http://localhost/events diff --git a/tools/curl/input/event.xml b/tools/curl/input/event.xml new file mode 100644 index 000000000..ab5e7dd75 --- /dev/null +++ b/tools/curl/input/event.xml @@ -0,0 +1,66 @@ + + + 14 + NCIRC + 2012-04-12 + Medium + TT6666: malixioious XLS (EDIT 234..5) + 3 + 0 + 4f8c2c4e-00dc-42c9-83ad-76e9ff32448e + 0 + 0 + + 116 + 14 + ip-dst + Network activity + 1 + 4f8c2cc3-0410-4bf0-8559-5b9dff32448e + 1 + 0 + 1.1.1.111 + g + + + 117 + 14 + malware-sample + Payload delivery + 0 + 4f8c2d08-7e6c-4648-8730-50a7ff32448e + 1 + 0 + Summary_report_Vienna_2012 27 March + ok_z.doc|b34a8fcf8e5c81de3f6f177bb6171929 + c + + + + 115 + 14 + vulnerability + Payload delivery + 1 + 4f8c2c69-9bf8-4279-8d03-2138ff32448e + 1 + 0 + CVE-2010-3333 + c + + + 11 + 2012-04-03 + 4f8812ff-ded0-4592-9227-0615ff32448e + + + 9 + 2012-04-02 + 4f85981e-d044-4b16-bc16-0a35ff32448e + + + 6 + 2012-03-22 + 4f7a9faa-91d4-4c91-8ec6-0878ff32448e + + diff --git a/tools/curl/viewEvent.sh b/tools/curl/viewEvent.sh new file mode 100755 index 000000000..eb3844bed --- /dev/null +++ b/tools/curl/viewEvent.sh @@ -0,0 +1,2 @@ +curl -H "Accept: application/xml" -H "Authorization: vlf4o42bYSVVWLm28jLB85my4HBZWXTri8vGdySb" \ +-X GET http://localhost/events/$1