-2

My Python code:

import requests 

headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}

xml_data1 = "hello"

hostxml = "example.com/xmlrpc.php"

check_method = requests.post(hostxml,data='1', verify=False,headers=headers).text

print(check_method)

Output:

Not Acceptable!

An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

Cloudkollektiv
  • 11,852
  • 3
  • 44
  • 71
  • You are being blocked, either by your company, web-hosting company, firewall, etc. – Edeki Okoh Feb 04 '20 at 20:26
  • no i am not .. if i do it manually in my browser it works properly but when i using python requests post data method it showing this error – Robert Y Anderson Feb 04 '20 at 20:28
  • TLDR the website does not allow post requests to that specific route. If you post the website I can diagnose more but at this moment it is impossible to help any further – Edeki Okoh Feb 04 '20 at 20:35
  • no this is not my question – Robert Y Anderson Feb 04 '20 at 20:48
  • @RobertYAnderson What is your question? – Bernardo Duarte Feb 04 '20 at 20:50
  • Your error is occurring because the website is blocking your scraper, a common practice. Not sure why my comment was deleted but here it is again explaining why this error occurs [Related](https://stackoverflow.com/questions/32572674/python-3-web-scraping-error-403?noredirect=1&lq=1). If you look at the network tab when you go on the website using your browser you can see all of the request parameters being sent when you do a POST. Chances are you are missing some or the website detects this is a crawler and is blocking you. – Edeki Okoh Feb 04 '20 at 21:02

1 Answers1

0

Mod_Security can be configured to block POST requests on certain endpoints.

Recon the version of Mod_Security the server is using and find a vulnerability to bypass the security check.

Note that this is very illegal unless you have permission to test the server.

isopach
  • 1,783
  • 7
  • 31
  • 43