How can I configure Burp Suite Professional as a web server? - burp

They seem to have documentation and a video for making Burp Suite Enterprise as a web server but it's different than my Burp Suite Pro dashboard/options and I can't find a way to do this.
The main reason why I need this is because I would like to make API calls using this example format from their site
curl --request POST \
--url [your-burp-enterprise-server-url]:[port]/graphql/v1 \
--header 'Authorization: [api-key]' \
--header 'Content-Type: application/json' \
--data '{"query":"query GetSiteTree {\nsite_tree {\nsites {\nid\nname\nscope {\nincluded_urls\nexcluded_urls\n}\napplication_logins {\nlogin_credentials {\nlabel\nusername\n}\nrecorded_logins {\nlabel\n}\n}\nparent_id\nextensions {\nid\n}\n}\nfolders {\nid\nname\n}\n}\n}","operationName":"GetSiteTree"}'
The very first part requires my Burp Suite URL, which requires me to set up Burp Suite as web server, but I'm using Professional and they only have documentation for doing it with Enterprise Edition.

Related

Access the API with HTTP request

I am using WSO2 IOT server, RaspberryPi 3 device with LED and DTH11 sensor. I can manage LED with console.
What I am trying to do is turn it On and Off with my mobile application. So, I want to know how can I send the HTTP request to the API and the request also. The server is running in localhost. Can anyone help me?
This is the command I used:
curl -k -X POST https://172.16.13.86:8243/api/device-mgt/v1.0/devices/raspberrypi/operations
-H 'accept: application/json' -H 'authorization: Bearer a7a156d7-0393-3350-8b9b-0ac956723440'
-H 'content-type: application/json' -d '{"deviceIdentifiers":[r1lovwmwg113],
"operation":{"code":"bulb","type":"CONFIG", "payLoad":"state:ON"}}'```
And this is the reply:
{"activityId":"ACTIVITY_36492","code":"bulb","type":"CONFIG","createdTimeStamp":"Fri
Dec 21 11:38:20 IST
2018","activityStatus":[{"deviceIdentifier":{"id":"r1lovwmwg113","type":"raspberrypi"},"status":"PENDING"}]}

How to call an webservice through curl with JSON Parameter?

I have web service running on server URL-http://localhost:8080/getdata
I want to call the web service through curl which take an parameter {"time":"2016-3-30 13:47:13"}
can any one help me with syntax
curl -i -X POST -H "Content-Type: application/json" -d "{\"time\":\"2016-3-30 13:47:13\"}" http://localhost:8080/getdata

how to use rest api with curl and c++ in xcode

I'm trying to POST the simple data to the Parse server using REST, but not able to do so, here is the code
#include<curl/curl.h>
curl -X POST \
-H "X-Parse-Application-Id: xxxxxxxxxx" \
-H "X-Parse-REST-API-Key: xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
https://api.parse.com/1/classes/GameScore
what is X here? do we need to define x? what connection settings need to be used to post the data successfully? and where is the return object is Json, where is is stored?
thanks.
You are trying to use a terminal command in C++, this won't work. X is a command line option for curl.
Below is a basic example of an HTTP POST request submitted with Curl using C. You should be able to adapt this to your needs.
http://curl.haxx.se/libcurl/c/http-post.html

visual studio command prompt adding web service with authentication

I need to test a web service in visual studio command prompt.
This web service needs authentication in order to be added or created.
How do I set those authentication (ie: The username and password needed to pass the web service)?
Try wget:
wget --http-user=<user> --http-password=<pass> https://<url>
For the webcall arguments see here e.g.
wget --post-file "hello.xml" --header "content-type: text/xml;charset=utf-8" --header "SOAPAction: http://tepmuri.org/myservice/IService/Hello" http://localhost/Service.svc

How to test web service using command line curl

I am building a web service for a web application, and I would like a simple tool to test this as I am developing. I have tried some firefox plug-ins (Poster, 'REST Client'), and even though these work fine I have been unable to upload files with them.
Also, I would rather have a command-line tool that I can use to easily write a set of integration tests for this web service and that I can send to consumers of this web service as an example.
I know that curl can work for this but would like a few examples, especially around authentication (using HTTP Basic) and file uploads.
Answering my own question.
curl -X GET --basic --user username:password \
https://www.example.com/mobile/resource
curl -X DELETE --basic --user username:password \
https://www.example.com/mobile/resource
curl -X PUT --basic --user username:password -d 'param1_name=param1_value' \
-d 'param2_name=param2_value' https://www.example.com/mobile/resource
POSTing a file and additional parameter
curl -X POST -F 'param_name=#/filepath/filename' \
-F 'extra_param_name=extra_param_value' --basic --user username:password \
https://www.example.com/mobile/resource
In addition to existing answers it is often desired to format the REST output (typically JSON and XML lacks indentation). Try this:
$ curl https://api.twitter.com/1/help/configuration.xml | xmllint --format -
$ curl https://api.twitter.com/1/help/configuration.json | python -mjson.tool
Tested on Ubuntu 11.0.4/11.10.
Another issue is the desired content type. Twitter uses .xml/.json extension, but more idiomatic REST would require Accept header:
$ curl -H "Accept: application/json"
From the documentation on http://curl.haxx.se/docs/httpscripting.html :
HTTP Authentication
curl --user name:password http://www.example.com
Put a file to a HTTP server with curl:
curl --upload-file uploadfile http://www.example.com/receive.cgi
Send post data with curl:
curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when.cgi