i want to make cron job for the url of nodejs - node.js

Inside postman my URL "http://localhost:1000/api/coupon/coupondeactivate" working fine. I want to make this URL in cron job. So I used it in below form.
wget http://localhost:1000/api/coupon/coupondeactivate --header "Referer: localhost:1000"
But when I try to paste above URL in CMD then I found below bug so please kindly help me to solve this issue.
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:1000... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-12-27 12:27:19 ERROR 404: Not Found.

hello please try the following curl request for your url.
watch -n 5 curl --request POST urlname
run above in cmd it working fine for me

Related

curl ip returned 404, but type ip into chrome, everything works well,why?

Description:
I resolve the ip of www.baidu.com, which is 103.235.46.39. Then I curl it curl 103.235.46.39, curl returned HTTP 404. And then I type the ip address to chrome browser, everything goes well.
Question:
What happend to Curl? Did I omit some Curl option?

Using WGET command upload files to http

I'm using wget command upload files to http.
wget --no-check-certificate --user=username --password=password --header="Content-type: multipart/form-data boundary=FILEUPLOAD" --post-file filename http://exmaple#.net
This is my error message:
`FOLDER_NAME'
Resolving EXAMPLE.NET... i
Connecting to EXAMPLE.NET|10.00.00.009|:80... connected.
HTTP request sent, awaiting response... 401 Access denied
Connecting to EXAMPLE.NET|10.00.00.009|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
Please help resolve the error.
Note : curl is not install in Server
ERROR => `FOLDER_NAME' Resolving EXAMPLE.NET... i Connecting to EXAMPLE.NET|10.00.00.009|:80... connected. HTTP request sent, awaiting response... 401 Access denied Connecting to EXAMPLE.NET|10.00.00.009|:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error
The first response from the server is an access denied. I would look into the credentials you provided to authenticate. After that see if the error 500 still shows. And test by manually uploading instead of using wget to see that the form works.
After many tries I was not able to upload using wget. Kept getting bad requests.
I managed to use curl instead:
curl -v -F filename=image.jpg -F upload=#image.jpg http://localhost:8080/api/upload

Verify path traversal vulnerability in web server

I want to verify that my web application does not have a path traversal vulnerability.
I'm trying to use curl for that, like this:
$ curl -v http://www.example.com/directory/../
I would like the HTTP request to be explicitly made to the /directory/../ URL, to test that a specific nginx rule involving proxy is not vulnerable to path traversal. I.e., I would like this HTTP request to be sent:
> GET /directory/../ HTTP/1.1
But curl is rewriting the request as to the / URL, as can be seen in the output:
* Rebuilt URL to: http://www.example.com/
(...)
> GET / HTTP/1.1
Is it possible to use curl for this test, forcing it to pass the exact URL in the request? If not, what would be an appropriate way?
The curl flag you are looking for is curl --path-as-is .
I'm not aware of a way to do it via curl, but you could always use telnet. Try this command:
telnet www.example.com 80
You'll see:
Trying xxx.xxx.xxx.xxx...
Connected to www.example.com.
Escape character is '^]'.
You now have an open connection to www.example.com. Now just type in your command to fetch the page:
GET /directory/../ HTTP/1.1
And you should see your result. e.g.
HTTP/1.1 400 Bad Request
You can use an intercepting proxy to capture a request to your application and repeat the request with parameters changed, such as the raw URL that is requested from the application.
The free version of Burp Suite will allow this using the Repeater.
However, there are alternatives that should also allow this such as Zap, WebScarab and Fiddler2.

curl succeeds but wget gives 502 error for a request on custom port

$ curl http://localhost:7810/test
hello world!
$
$
$ wget http://localhost:7810/test
--2011-09-27 07:04:06-- http://localhost:7810/test
Resolving <snipped>
Connecting to <snipped> connected.
Proxy request sent, awaiting response... 502 Bad Gateway
2011-09-27 07:04:06 ERROR 502: Bad Gateway.
$
It seems that wget is looking at port 80 even though I specified 7810. How can I work around this issue?
You have a config file, possibly ~/.wgetrc, where a proxy is specified.

how to get response from a remote server by using curl command through proxy?

Please give a simple syntax for making a curl command that will connect to the remote server through proxy......
curl -x my-proxy:8080 www.bbc.co.uk
Try here for more details: http://curl.haxx.se/docs/manual.html

Resources