rkd77 / elinks

Fork of elinks
Other
349 stars 38 forks source link

Always get a Forbidden access error on wiki.debian.org #226

Closed aelmahmoudy closed 1 year ago

aelmahmoudy commented 1 year ago

I always get a 403 Forbidden access error on https://wiki.debian.org. I tried with: elinks -no-connect -no-home , assuming that there could be a probkem with some config option or some old cookie, yet I still get forbidden access, I also tried changing the Agent identification string to Mozilla, yet the same error.

rkd77 commented 1 year ago

On main page, too? Main page was displayed for me. I have no account to check login. In src/network/socket.c there is:

/* To enable logging of tranfers, for debugging purposes. */
#if 0

#define DEBUG_TRANSFER_LOGFILE "/tmp/log"

You can change it to #if 1, recompile, browse and save log somewhere. Similar option has links2 (in connect.c). Just define LOG_TRANSFER. You can compare later both logs. Cookies or request headers might be wrong.

rkd77 commented 1 year ago

Did this commit help or not? Does it work on elinks-0.16?

aelmahmoudy commented 1 year ago

No, this commit didn't fix it. links2 gives the same problem. The issue is in elinks 0.16, but not in elinks 0.13.2

aelmahmoudy commented 1 year ago

On main page, too? Main page was displayed for me. I have no account to check login. In src/network/socket.c there is:

/* To enable logging of tranfers, for debugging purposes. */
#if 0

#define DEBUG_TRANSFER_LOGFILE "/tmp/log"

You can change it to #if 1, recompile, browse and save log somewhere. Similar option has links2 (in connect.c). Just define LOG_TRANSFER. You can compare later both logs. Cookies or request headers might be wrong.

Did that, here's the log:

CONNECTION: wiki.debian.org
GET / HTTP/1.1 
Host: wiki.debian.org 
User-Agent: ELinks/0.16.0 (textmode; Linux 5.4.0-144-generic x86_64; 83x40-2) 
Accept: text/html, text/*;q=0.9, */*;q=0.8 
Accept-Language: en 
Connection: Keep-Alive 

HTTP/1.1 301 Moved Permanently 
Date: Thu, 27 Apr 2023 23:48:58 GMT 
Server: Apache 
X-Content-Type-Options: nosniff 
X-Frame-Options: sameorigin 
Referrer-Policy: no-referrer 
X-Xss-Protection: 1 
Permissions-Policy: interest-cohort=() 
Location: https://wiki.debian.org/ 
Content-Length: 297 
Keep-Alive: timeout=5, max=100 
Connection: Keep-Alive 
Content-Type: text/html; charset=iso-8859-1 

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://wiki.debian.org/">here</a>.</p>
<hr>
<address>Apache Server at wiki.debian.org Port 80</address>
</body></html>

CONNECTION: wiki.debian.org
GET / HTTP/1.1 
Host: wiki.debian.org 
User-Agent: ELinks/0.16.0 (textmode; Linux 5.4.0-144-generic x86_64; 83x40-2) 
Referer: http://wiki.debian.org/ 
Accept: text/html, text/*;q=0.9, */*;q=0.8 
Accept-Language: en 
Connection: Keep-Alive 

HTTP/1.1 403 FORBIDDEN 
Date: Thu, 27 Apr 2023 23:48:58 GMT 
Server: Apache 
X-Content-Type-Options: nosniff 
X-Frame-Options: sameorigin 
Referrer-Policy: no-referrer 
X-Xss-Protection: 1 
Permissions-Policy: interest-cohort=() 
Strict-Transport-Security: max-age=15552000 
Upgrade: h2,h2c 
Connection: Upgrade, Keep-Alive 
Content-Length: 166 
X-Clacks-Overhead: GNU Terry Pratchett 
Keep-Alive: timeout=5, max=100 
Content-Type: text/html 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>403 Forbidden</title>
<h1>Forbidden</h1>
<p>&lt;p&gt;You are not allowed to access this!&lt;/p&gt;</p>
rkd77 commented 1 year ago

I can't reproduce it. It is question for admins of wiki.debian.org . There can be block based on geoip for example.

aelmahmoudy commented 1 year ago

Indeed I tested from another machine and it worked !