• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Plesk request with authtentification PLESKSESSID redirect

WhoIsIt

New Pleskian
Server operating system version
Ubuntu 18.04.4 LTS
Plesk version and microupdate number
Plesk Obsidian 18.0.33
Hello,
I just installed plesk
Ubuntu 18.04.4 LTS
Plesk Obsidian 18.0.33


I try to create a domain name using requests but when I make my requests it returns me quests.exceptions.ConnectionError: HTTPSConnectionPool(host='suspicious-feistel.178-170-9-6.plesk .pagewpb-site.tld', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001BAC4C570A0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed '))

Script:
def generate_PLESKSESSID(): headers = { 'Content-Type': 'text/xml', 'HTTP_AUTH_LOGIN': USER, 'HTTP_AUTH_PASSWD': PASSWORD, 'HTTP_PRETTY_PRINT': 'TRUE', } client_ip = getip() data = f""" <?xml version='1.0'?> <packet version="1.6.3.5"> <server> <create_session> <login>{USER}</login> <data> <!-- Base64-encoded IP address of client, who logs into Plesk --> <user_ip>{client_ip}</user_ip> <!-- Base64-encoded hostname of computer from which the request is sent --> <source_server>d3BiLXNpdGUudGxk</source_server> </data> </create_session> </server> </packet>""".replace("\n", "") response = s.post(plesk_link + "/enterprise/control/agent.php", headers=headers, data=data, verify=False).text PLESKSESSID = response.split("<id>")[1].split("</id>")[0] response = s.get(plesk_link + f"/smb/web/add-domain?PLESKSESSID=" + PLESKSESSID) return PLESKSESSID def create_domain(plesk_username): plesk_name = "test.plesk" + "".join(choices("123456789", k=3)) token = generate_token() headers = { 'authority': 'suspicious-feistel.178-170-9-6.plesk.page', 'accept': '*/*', 'accept-language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7', 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryBFapGll9PCN79K2N', 'origin': 'https://suspicious-feistel.178-170-9-6.plesk.page', 'referer': 'https://suspicious-feistel.178-170-9-6.plesk.page/smb/web/add-domain', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'sec-gpc': '1', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36', 'x-forgery-protection-token': token, 'x-requested-with': 'XMLHttpRequest', } cookies = { 'PLESKSESSID': generate_PLESKSESSID(), } json_data = { "applicationName": "upload-files", "hidden": "", "forgery_protection_token": token, "domainName[name]": plesk_name, "domainName[type]": "custom", "domainName[webspace]": "new", "hostingType[hosting]": "hosting", "dnsSettings[dns]": "master", "mailSettings[mail]": "1", "domainInfo[userName]": plesk_username.lower(), "domainInfo[password]": "".join(choices("abcdefghijklmnopqrstuvwxyz", k=5)).capitalize() + "#" + "".join(choices("123456789", k=6)), "domainInfo[ipSelector][ipv4]": "1", "domainInfo[ipSelector][ipv6]": "none", "forwardingSettings[forwardTo]": "" , "forwardingSettings[forwardingType]": "std_fwd301", "hostingSettings[root]": plesk_name, "hostingSettings[rootPattern]": "httpdocs", "hostingSettings[seoRedirectDirection]": "none", "sslit[blocked]": "0", "sslit[enabled]": "0", "sslit[decoratorsHack_49b09d88ed1e550a1ed210fd32251aa3]": "" } response = s.post('https://suspicious-feistel.178-170-9-6.plesk.page/smb/web/add-domain', json=json_data, headers=headers, cookies=cookies) #here is the problem
 
Back
Top