Bitcoin Forum
June 21, 2024, 07:09:36 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: Ban Bitcoin XT connections to my node?  (Read 2709 times)
masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 03:51:23 PM
Last edit: September 02, 2015, 05:57:42 PM by masterluc
 #1

Is there any effective way to do this?

UPDATE. Found solution.

All paths are according to CeontOS 7. If you have different distrib, change paths.

This goes to autostart:

Code:
echo "/usr/bin/ipset create bitcoinxt iphash timeout 0" >> /etc/rc.local

This goes to /etc/cron.hourly/bitcoinxt
Code:
#!/bin/bash
/bin/grep BitcoinXT /var/log/kern.log | /usr/bin/perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | /bin/sort | /usr/bin/uniq -u | /usr/bin/xargs -L 1 ipset -exist add bitcoinxt

Also
Code:
# chmod 755 /etc/cron.hourly/bitcoinxt

This goes to iptables
Code:
iptables -A INPUT -m set --set bitcoinxt src -j DROP
iptables -A INPUT -p tcp -m tcp --dport 8333 -m string --string "Bitcoin XT" --algo bm --to 65535 -j LOG --log-prefix "BitcoinXT" --log-level 1
iptables -A OUTPUT -m set --match-set bitcoinxt dst -j DROP

Dont forget to
Code:
/etc/init.d/iptables save

Holliday
Legendary
*
Offline Offline

Activity: 1120
Merit: 1010



View Profile
September 02, 2015, 04:49:08 PM
 #2

Depends on the OS. It's very easy if you use Windows.

If you aren't the sole controller of your private keys, you don't have any bitcoins.
masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 04:59:35 PM
 #3

Fuck the windows.

Okay, I put this:

Code:
iptables -A INPUT -p tcp -m tcp --dport 8333 -m string --string "Bitcoin XT" --algo bm --to 65535 -j LOG --log-prefix "BitcoinXT" --log-level 1 

Now need a way to extract logged IP and put it to ipset

Got log entry, found asshole 188.18.202.245

Code:
BitcoinXTIN=eth0 OUT= MAC=XXX SRC=188.18.202.245 DST=XXMYIPXX LEN=172 TOS=0x00 PREC=0x00 TTL=56 ID=64279 DF PROTO=TCP SPT=35311 DPT=8333 WINDOW=2840 RES=0x00 ACK PSH URGP=0 

Carlton Banks
Legendary
*
Offline Offline

Activity: 3430
Merit: 3074



View Profile
September 02, 2015, 05:03:03 PM
 #4

Fuck the windows.

Okay, I put this:

Code:
iptables -A INPUT -p tcp -m tcp --dport 8333 -m string --string "Bitcoin XT" --algo bm --to 65535 -j LOG --log-prefix "BitcoinXT" --log-level 1 

Now need a way to extract logged IP and put it to ipset

Got log entry, found asshole 188.18.202.245

Code:
BitcoinXTIN=eth0 OUT= MAC=XXX SRC=188.18.202.245 DST=XXMYIPXX LEN=172 TOS=0x00 PREC=0x00 TTL=56 ID=64279 DF PROTO=TCP SPT=35311 DPT=8333 WINDOW=2840 RES=0x00 ACK PSH URGP=0 


petition to sticky this thread lol.

Vires in numeris
masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 05:12:19 PM
 #5

Got a list!
Code:
# grep BitcoinXT /var/log/kern.log | perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | sort | uniq -u
188.18.202.245
195.78.126.113
86.102.161.110
92.49.177.97

knight22
Legendary
*
Offline Offline

Activity: 1372
Merit: 1000


--------------->¿?


View Profile
September 02, 2015, 05:14:47 PM
 #6

I hope you people feel "safe" now.  Roll Eyes

meono
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
September 02, 2015, 05:18:26 PM
 #7

Oh no blacklisting is so bad.... Roll Eyes


Bunch of hypocrites.

IIOII
Legendary
*
Offline Offline

Activity: 1153
Merit: 1012



View Profile
September 02, 2015, 05:20:27 PM
 #8

petition to sticky this thread lol.

Supporting sticky thread. Those parasitic Altcoin nodes are trying to suck bandwidth resources out of the Bitcoin network.
masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 05:23:38 PM
 #9

Now create ipset

Code:
# ipset create bitcoinxt iphash timeout 0

knight22
Legendary
*
Offline Offline

Activity: 1372
Merit: 1000


--------------->¿?


View Profile
September 02, 2015, 05:24:44 PM
 #10

Oh no blacklisting is so bad.... Roll Eyes


Bunch of hypocrites.



Ironic isn't it?  Grin

masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 05:25:19 PM
 #11

Now drop blacklisted IP using firewall

Code:
iptables -A INPUT -m set --set bitcoinxt src -j DROP

masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 05:32:14 PM
 #12

Fill in ban list

Code:
[root@localhost ~]# grep BitcoinXT /var/log/kern.log | perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | sort | uniq -u | xargs -L 1 ipset add bitcoinxt 
[root@localhost ~]# ipset list
Name: bitcoinxt
Type: hash:ip
Header: family inet hashsize 1024 maxelem 65536 timeout 0
Size in memory: 8588
References: 1
Members:
95.52.18.154 timeout 0
31.162.118.16 timeout 0
188.18.202.245 timeout 0
92.37.204.174 timeout 0
92.37.173.6 timeout 0
95.37.186.63 timeout 0
86.102.161.110 timeout 0
178.44.216.148 timeout 0
195.78.126.113 timeout 0
92.49.177.97 timeout 0

This one should be done periodically

Code:
grep BitcoinXT /var/log/kern.log | perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | sort | uniq -u | xargs -L 1 ipset add bitcoinxt

meono
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
September 02, 2015, 05:33:09 PM
 #13

Oh no blacklisting is so bad.... Roll Eyes


Bunch of hypocrites.



Ironic isn't it?  Grin

BitcoinXT reminds me of the early days of bitcoin ....

You know when you get blacklisted and blocked by financial institutions.

It all starts like this. First they ignore you, then they fight you...

BTW OP what you're doing is nothing compared to the piece of shit who is DDoSing XTnodes.
jonald_fyookball
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004


Core dev leaves me neg feedback #abuse #political


View Profile
September 02, 2015, 05:36:28 PM
 #14

bip 101 strikes fear into the hearts of paranoid bitcoiners.  Cheesy

meono
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
September 02, 2015, 05:38:13 PM
 #15

Fill in ban list

Code:
[root@localhost ~]# grep BitcoinXT /var/log/kern.log | perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | sort | uniq -u | xargs -L 1 ipset add bitcoinxt 
[root@localhost ~]# ipset list
Name: bitcoinxt
Type: hash:ip
Header: family inet hashsize 1024 maxelem 65536 timeout 0
Size in memory: 8588
References: 1
Members:
95.52.18.154 timeout 0
31.162.118.16 timeout 0
188.18.202.245 timeout 0
92.37.204.174 timeout 0
92.37.173.6 timeout 0
95.37.186.63 timeout 0
86.102.161.110 timeout 0
178.44.216.148 timeout 0
195.78.126.113 timeout 0
92.49.177.97 timeout 0

This one should be done periodically

Code:
grep BitcoinXT /var/log/kern.log | perl -e 'while (<>) { if (/SRC=(\d+\.\d+\.\d+\.\d+)/) {print "$1\n";} }' | sort | uniq -u | xargs -L 1 ipset add bitcoinxt

You know you should write " hundreds thousands lines of code" (hi ! Turtlehuricane Wink) as a new blacklisting feature for the next version of bitcoin core.

Gotta love to read how the hypocrites pos in here defend their god given bitcoin rule.
LiteCoinGuy
Legendary
*
Offline Offline

Activity: 1148
Merit: 1011


In Satoshi I Trust


View Profile WWW
September 02, 2015, 05:39:24 PM
 #16

to ban it is very silly.

i recommend this podcast with gavin:

https://epicenterbitcoin.com/podcast/094/

poeEDgar
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250



View Profile
September 02, 2015, 05:40:52 PM
 #17

Oh no blacklisting is so bad.... Roll Eyes

Bunch of hypocrites.

Huh? If you were actually reading the TOR IP list thread, one of the recurring arguments is that it's fine for nodes to individually ban IPs that are attacking them (obviously), but that it's unnecessary to introduce a centralized, trusted list of such IPs.

There is nothing wrong with people in this thread individually banning IPs that they don't want connecting to them. There is nothing centralized or trust-adding about that.

Quote from: Gavin Andresen
I woulda thunk you were old enough to be confident that technology DOES improve. In fits and starts, but over the long term it definitely gets better.
knight22
Legendary
*
Offline Offline

Activity: 1372
Merit: 1000


--------------->¿?


View Profile
September 02, 2015, 05:43:00 PM
 #18

Oh no blacklisting is so bad.... Roll Eyes

Bunch of hypocrites.

Huh? If you were actually reading the TOR IP list thread, one of the recurring arguments is that it's fine for nodes to individually ban IPs that are attacking them (obviously), but that it's unnecessary to introduce a centralized, trusted list of such IPs.

There is nothing wrong with people in this thread individually banning IPs that they don't want connecting to them. There is nothing centralized or trust-adding about that.

True that. XT just like Core is supposed to stand on its own regardless of bad actors.

masterluc (OP)
Legendary
*
Offline Offline

Activity: 938
Merit: 1013



View Profile
September 02, 2015, 05:44:04 PM
 #19

Ah, of course outgoing connections
Code:
iptables -A OUTPUT -m set --match-set bitcoinxt dst -j DROP

The result:
Code:
[root@localhost ~]# ping 95.52.18.154
PING 95.52.18.154 (95.52.18.154) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 95.52.18.154 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4524ms

[root@localhost ~]# ping 178.44.216.148
PING 178.44.216.148 (178.44.216.148) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C

Sorry guys, I have only 64 connections and don't want to waste them for XT

Holliday
Legendary
*
Offline Offline

Activity: 1120
Merit: 1010



View Profile
September 02, 2015, 05:47:01 PM
 #20

Oh no blacklisting is so bad.... Roll Eyes

Bad: Client tells individual which information will be shared with whom.

Good: Individual tells client which information will be shared with whom.

Let's not be intentionally obtuse and conflate the two.

If you aren't the sole controller of your private keys, you don't have any bitcoins.
Pages: [1] 2 3 »  All
  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!