Wget Not working

the below link in browser download work fine however I’m trying to transfer file using wget command but it is not working however when i have a file without key in last part of link then wget work perfect.

wget https://download.{website}.com/website-backups/index.php?file=two.com.pk-2021-08-31.zip&key=cb3befd8e998ca48b47366ea6a0f119974317030

curl -O https://download.{website}.com/website-backups/index.php?file=two.com.pk-2021-08-31.zip&key=cb3befd8e998ca48b47366ea6a0f119974317030

both not working any advice on it would be highly greatful

Some web servers or site have WAF (web application firewall) and they can detect and block wget command. Try changing user agent:

wget --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0' \
'https://download.{website}.com/website-backups/index.php?file=two.com.pk-2021-08-31.zip&key=cb3befd8e998ca48b47366ea6a0f119974317030'

Does this works?

insert single qoute before https and after last charactr

They have session key and that is causing problem.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki