Thursday, June 14, 2018

Auto-answering friend/buddy requests

I use a combination of Bitlbee and ZNC to maintain a persistent presence on Jabber and IRC, even when I'm not actually online. Bitlbee will convert a number of non-IRC chat services (Facebook, Twitter, Jabber, Gtalk) into IRC channels and ZNC provides the ability to cache any/all incoming messages. My setup:

   chat client -> ZNC -> Bitlbee -> multiple non-IRC servers
                     \-> multiple IRC servers

The problem: One of the problems with public chat servers is that your receive a lot of buddy/friend requests from people you don't know. Bitlbee requires that you type the word "no" in response to each request (there is no group-answer function).

The solution: The following script leverages another ZNC feature, where multiple concurrent connections are allowed. This means that you can run the following script while being connected with your favorite IRC client. It will watch for the phrase "You can use the yes/no commands to accept/reject this request." and send "no" in response.

Notes/assumptions:

  • Assumes that you're already logged onto Bitlbee, from your IRC client, via ZNC,
  • Run this script once you're on a Bitlbee channel which has a number of friend/buddy requests.
  • You must type the first "no".
  • Recommendation: only turn on one Bitlbee channel at a time.

The script:

#!/usr/bin/perl

use IO::Socket;

# set up the connection
$con = IO::Socket::INET->new(PeerAddr=>'127.0.0.1',
        PeerPort=>'6667',
        Proto=>'tcp') || print "Error! $!\n";
print $con "User tim\r\n";

# allow time for any server side stuff to happen
sleep 3;

# connect to the bitlbee channel on ZNC
print $con "PASS tim/bitlbee:PASSWORD\r\n";

# following shouldn't be needed
#print $con "NICK tim\r\n";

# join the bitlbee command channel
print $con "JOIN \&bitlbee\r\n";

# loop and process messages from the server
while ($answer = <$con>) {

        if($answer =~ /^PING(.*)$/i) {
                print $con "PONG $1\r\n";
        }

        # following 2 lines should be on 1
        if($answer =~ /\:root\!root\@cubietruck PRIVMSG \&bitlbee :You can \
use the \^Byes\^B\/\^Bno\^B commands to accept\/reject this request/){
                print $con "PRIVMSG &bitlbee :no\r\n";
        }
}

Sunday, June 3, 2018

What was I reading in May 2018?

There was a slight delay in posting the below. Between spending last weekend at the ER and spending this weekend moving the office, there was very little time to post. In the interim, we've ordered some cheap toys from eBay. Will talk about them later.

2018-05-06

- Cloudflare DNS service Blocked By AT&T - Why there's a blocklist at all is cause for concern.
- Fail Of The Week: Never Assume All Crystals Are Born Equal

2018-05-11

- Authoritative GNU Radio training videos
- Google Duplex: An AI System for Accomplishing Real-World Tasks Over the Phone
- Researchers hide information in plain text - It's not what you immediately think. Instead, it's minor variations in the font's pixels.
- Pipe Logic - Code equivalents of circuits and components.
- Multiple OS Vendors Release Security Patches After Misinterpreting Intel Docs
- Terry Gilliam Reveals the Secrets of Monty Python Animations: A 1974 How-To Guide
- Low Level Bit Hacks You Absolutely Must Know
- Linux sandboxing improvements in Firefox 60

2018-05-14

- The Big Lie ISPs Are Spreading in State Legislatures Is That They Don't Make Enough Money
- The State of Cryptocurrency Mining
- Top 20 Essential ESXCLI Commands You Need to Know

2018-05-16

- Metasploitable3 CTF

2018-05-17

- The sad state of sysadmin in the age of containers
- Finland offers free online Artificial Intelligence course to anyone, anywhere
- To Build Truly Intelligent Machines Teach Them Cause and Effect
- How to Run a Blockchain on a Deserted Island with Pen and Paper
- Why Great Employees Quit -- Instead Of Admitting They're Unhappy
- The Cyber Security Body Of Knowledge (CYBOK)
- Eigenvectors and Eigenvalues explained visually
- Beginner's Guide to IDAPython

2018-05-20

- An Interesting Pattern in the Prime Numbers: Parallax Compression
- Abusing Proxies for DSLs - Stuff and Things
- The Markov Property, Chain, Reward Process and Decision Process

2018-05-23

- Quantum Physics May Be Even Spookier Than You Think
- General Thinking Tools: 9 Mental Models to Solve Difficult Problems

2018-05-24

- Command-line Tools can be 235x Faster than your Hadoop Cluster

2018-05-26

- Making Driverless Cars Change Lanes More Like Human Drivers Do

2018-05-28

- Why You Can't Just Block EU Visitors, EU Customers, or Any EU Traffic Under GDPR
- Letting Neural Networks Be Weird: When Algorithms Surprise Us

2018-05-29

- USB Packet Snooping

Above was generated by a homegrown bolt-on script for Wallabag, which is a free utility for capturing web content so that it can be read later.