Cannot type "/ etc / hosts" (without the spaces)

  • Thread starter Wrichik Basu
  • Start date
  • Tags
    Type
In summary, CloudFlare is blocking the hosts file because it is a known attack payload. You can work around the problem by using a different format for the content.
  • #1
Wrichik Basu
Science Advisor
Insights Author
Gold Member
2,158
2,719
I was trying to paste the hosts file in this thread, and ran into an exception:

1662025162260.png


I can't paste the full error message from the console because PF is not allowing me to do so. Here is the error message:

Sorry, you have been blocked
You are unable to access physicsforums.com
Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 743cfbb7cc8df8d7 • Your IP: <Removed_by_me> • Performance & security by Cloudflare

Upon further testing, it turns out that I can paste the hosts file, but cannot type / etc / hosts (without the spaces). Neither in code blocks nor as plain text.
 
Computer science news on Phys.org
  • #2
Test: ##\texttt{/} \texttt{etc} \texttt{/} \texttt{hosts}##

Works fine with me. (OK, I cheated a lot :smile:)
 
  • Haha
Likes Wrichik Basu
  • #3
Quick test.
/ etc / hosts:
/ etc / hosts
I can confirm the problem. If I leave out the spaces in either the title or the body of the code block, then I can preview it just fine, but if I try to submit it gives the "Problem encountered" dialog and I cannot submit.
 
  • Like
Likes Wrichik Basu
  • #5
Something about the format of the content in the request is tripping CF's detection.
 
  • Like
Likes Wrichik Basu
  • #6
CloudFlare simply won't let the string /etc/hosts through in a multipart/form-data request, presumably because this is a known attack payload. This is also the case with many other strings like <script>.

I don't think CF would be so picky about application/json content, perhaps you could persuade ZenForo to rewrite their front end XHR handler?
 
  • Like
  • Informative
Likes Wrichik Basu, Greg Bernhardt and Vanadium 50
  • #7
Take a screenshot, then post that.
 
  • #8
pbuk said:
known attack payload
That's the key. If you type content like that, you shouldn't be surprised when its blocked. ("But your honor, the gun wasn't loaded!")
 
  • #9
pbuk said:
CloudFlare simply won't let the string /etc/hosts through in a multipart/form-data request, presumably because this is a known attack payload. This is also the case with many other strings like <script>.
But how did you write these?
 
  • #10
Wrichik Basu said:
But how did you write these?
Click "Reply" and you'll see...
 
  • Informative
Likes jack action
  • #11
pbuk said:
Click "Reply" and you'll see...
This is what I see:

1662132954757.png
 
  • #12
Wrichik Basu said:
This is what I see:
Ah you also have to click the [ ] icon in the editor bar to leave WYSYWIG mode.
1662133729717.png
 
  • Like
Likes Wrichik Basu

FAQ: Cannot type "/ etc / hosts" (without the spaces)

Why am I unable to type "/etc/hosts" without the spaces?

Typing "/etc/hosts" without the spaces is not possible because this is the file path for the hosts file on a Unix-based system. The forward slashes indicate the hierarchy of directories leading to the file, and the spaces are necessary to separate each directory.

Can I edit the hosts file without typing "/etc/hosts"?

Yes, you can edit the hosts file by using a text editor or command line tools like "nano" or "vim". However, the file path will still need to be specified in some way.

What is the purpose of the hosts file?

The hosts file is a plain text file used to map IP addresses to hostnames. It is commonly used to override the default DNS settings and can be used to block or redirect certain websites.

Why do I need to use the command line to edit the hosts file?

The hosts file is a system file that requires administrative privileges to edit. Using the command line allows for easier access to these privileges and ensures that changes are made correctly.

Are there any risks associated with editing the hosts file?

Yes, there are risks associated with editing the hosts file. Making incorrect changes can result in the inability to access certain websites or even cause system errors. It is important to make backups of the hosts file before making any modifications.

Similar threads

Back
Top