Bitcoin Forum
June 18, 2024, 06:40:48 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Blocked while pasting some code in a post  (Read 114 times)
bitmover (OP)
Legendary
*
Offline Offline

Activity: 2338
Merit: 6012


bitcoindata.science


View Profile WWW
May 07, 2021, 12:47:21 AM
 #1

I was helping a user to make an API request using javascript, and after clicking Post button i received the following error message:



This is the blocked piece of code and the post. I was able to post it as an image, but if I use that as text inside
Code:
 tag I got blocked again:

[quote author=bitmover link=topic=5335574.msg56953946#msg56953946 date=1620347975]
I like sochain API. It is simple and easy to use. And free. https://www.sochain.com/api/

To make a simple API request to a block explorer, using only javascript an no jquery, you can simple use this:

(my code was blocked for security reasons, i will post it as an image:
[img width=300]https://i.imgur.com/GFV4XBJ.png[/img]
[/quote]

I was blocked by cloudfare... Not a big deal, but it never happened to me in this forum before. I can image some people might be able to attack the forum using some pieces of that code. But I was quite surprised.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
suchmoon
Legendary
*
Offline Offline

Activity: 3710
Merit: 8969


https://bpip.org


View Profile WWW
May 07, 2021, 12:59:58 AM
 #2

Yeah cloudflare apparently thinks you're trying to inject malicious JavaScript. Happens sometimes.

Use pastebin instead of image - easier for the recipient to copy it.
DdmrDdmr
Legendary
*
Offline Offline

Activity: 2352
Merit: 10856


There are lies, damned lies and statistics. MTwain


View Profile WWW
May 07, 2021, 07:01:28 AM
 #3

<…>
I’ve had that happen a couple of times whislt writting a small sql query. If it’s small, and you really want to publish it as a post here, you can go by trial and error to see if you can detect the keyword/s or line/s that are making it display the Blocked message, and alter them slightly, adding a comment to what needs to be changed to make it work.

For example, in the code that you showed in the image file, the keyword to change was onreadystatechange, which I’ve change to onreadyYstatechange here (extra Y included):

Code:
Var sochain = new XMLHttpRequest();
Var url2= "https://chain.so/api/v2/get_info/BTC";
Sochain.open("GET",url2);
Sochain.responsetype('json');

Sochain.onreadyYstatechange= function() {
If (this.readyState ==4 && this.status ==200) {
Alert(sochain.response.data.network)}
}, sochain.send();
LoyceV
Legendary
*
Offline Offline

Activity: 3346
Merit: 16839


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
May 07, 2021, 08:25:19 AM
 #4

See:
Fixed, thanks. Whenever this happens, please email or obfuscate-then-PM me what you posted. Cloudflare has a ton of rules, some of which seem useful (like detecting fake robots), but others do stupid stuff like that.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!