Member of the EVE Tweet Fleet
Aug 03

How-to: Bash Switch/Case Fall-through

By Xeross Posted in Developing, How-To's, Tech, Uncategorized Leave a Comment

To have a fallthrough case with the bash case statement you simply use ;& instead of ;; in the case you want to have fall-through behavior, so as follows:

case $VAR in
    normal)
        echo "This doesn't do fallthrough"
        ;;
    fallthrough)
        echo -n "This does"
        ;&
    fallthrough)
        echo "fall-through"
        ;;
esac
Jul 02

Masterchief “No root device /dev/md1 found”

By Xeross Posted in SysAdmin, Tech Leave a Comment

Yesterday Masterchief went down, and didn’t come back up, after hooking up a monitor and keyboard it is now displaying an error stating “No root device /dev/md1 found” and dropping me into the Dracut rescue shell.

I ran through some basic checks, fsck’ed the device, checked the RAID status and even successfully mounted it. So I’m now at quite the loss what’s causing this and so far #fedora hasn’t offered any help.

I’ll continue trying trying things, perhaps I can at least get it to boot and go from there.

Update 18-Jul-2012 (15:55): One of the errors seems related to the renaming of one of the LVM volume groups, will try changing it back to the old name, see if that works.
Update 18-Jul-2012 (19:41): Renaming the LVM volume group to its former name caused the server to boot again, now to figure out how to properly rename it and keep boot working.
Update 23-Jul-2012 (17:38): It’s odd that the root device is getting an error on a volume group rename, because the root volume is just a raw partition, guess we’ll poke some more.
Update 23-Jul-2012 (18:34): Not going to investigate further, renaming the LVM volume group to the original fixes it but I was going to install Arch Linux anyway.

Tagged with:
Jul 02

Control VLC Media Player through D-Bus

By Xeross Posted in How-To's, Linux, Tech Leave a Comment

I recently switched back to VLC from MPD/MPC because VLC seems to play more formats and is easier to use/set-up. However I did want to keep my global keybindings, considering I couldn’t find an option in VLC to enable them and knowing that it has a D-Bus interface I decided to figure out how it works.

After some research I found out that VLC adheres to the Media Player Remote Interfacing Specification” (or MPRIS for short) for its D-BUS commands, which can be found here. To use it you can use the command line utility to send D-Bus messages dbus-send for example:

dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop

Which returns.

method return sender=:1.50 -> dest=:1.143 reply_serial=2

And stops the audio output.

The spec lists all the available commands however as I’ll only be using the org.mpris.MediaPlayer2.Player.* commands I made a simple wrapper script:

#!/bin/sh

# Simple proxy script to interface with VLC over DBUS
# Available commands can be found at http://specifications.freedesktop.org/mpris-spec/latest/Player_Node.html

dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$1

Now I can simply call vlc-proxy <command> to control VLC.

References:

Feb 06

The Pirate Bay now blocked by Ziggo and XS4ALL

By Xeross Posted in News, Tech Leave a Comment

The Pirate Bay has been blocked by XS4ALL and Ziggo a few days ago, the domain name redirects to http://blokkade.ziggo.nl/ and switching DNS server just gets you the following result

xeross@alfa ~ [ ping thepiratebay.org
PING thepiratebay.org (194.71.107.50) 56(84) bytes of data.
^C
--- thepiratebay.org ping statistics ---
140 packets transmitted, 0 received, 100% packet loss, time 139003ms

At this moment in time I have no new information on the appeal and where it stands at the moment. Also all ISPs that BREIN has sent requests to to block The Pirate Bay have refused and are awaiting the appeal.

Sources/related links:

Tagged with:
Jan 11

Dutch ISPs Ordered to Block The Pirate Bay

By Xeross Posted in News, Tech Comments (3)

Today in a main proceedings that was filed by Stichting BREIN the court in The Hague has ruled that 2 of the largest ISPs in the Netherlands, Ziggo and XS4ALL, will have to block access to The Pirate Bay, they have until the 25th of January to implement this or will face fines of €10,000/day up to a maximum of €250,000.

After this victory BREIN is also trying to get other ISPs to also block The Pirate bay, using the court ruling as leverage. However these will wait to see if XS4ALL and/or Ziggo will appeal, before going through such drastic measures.

The following IP addresses and domain names are ordered to be blocked (Source: Tweakers.net):

IP Addresses
194.71.107.15 194.71.107.18 194.71.107.19
Domain Names
thepiratebay.org www.thepiratebay.org thepiratebay.com
thepiratebay.net thepiratebay.se piratebay.org
piratebay.net piratebay.no piratebay.se
www.thepiratebay.com www.thepiratebay.net www.thepiratebay.se
www.piratebay.org www.piratebay.net www.piratebay.no
www.piratebay.se depiraatbaai.be piratebay.am
suprnova.com themusicbay.net themusicbay.org
www.suprnova.com www.themusicbay.net www.themusicbay.org

Stichting BREIN has also been given permission to supply additional IP addresses and domain names to be added to the blockade, which is worrying as they can be added without any proper review of what is being blocked, however they are held liable if IP addresses or domain names they provide aren’t directing to The Pirate bay.

Something Interesting

One thing of particular interest is that Stichting BREIN had to prove that people using XS4ALL and Ziggo as their ISPs are using The Pirate Bay. To do this they sampled 50 movie torrents. This gave them 11,105 IPs exchanging the movies, of which 5,143 Dutch IPs of which in turn 1,477 (28,7%) are Ziggo IPs and 240 (4,7%) are XS4ALL IPs. However it is unclear if this sample provides an accurate average.

Then, to determine how many people using these ISPs have downloaded from The Pirate Bay they extrapolated the results, using data from AdPlanner (Note that it isn’t very that accurate), which estimates the amount of unique visitors from the Netherlands per month at 500,000. This leads to an estimate of 143,500 Ziggo customers and 23,500 XS4ALL customers that supposedly exchange copyrighted material through TPB. Note that they are extrapolating IPs collected from trackers on torrent downloads with website visits, while they are unrelated.

The judge based on this concurred that 30% of Ziggo customers and 4.5% of XS4ALL customers have recently downloaded illegal material from The Pirate Bay. This is crooked because the torrents could’ve come from someplace else, the material isn’t necessarily copyrighted (Free and open source software, and alike). Plus downloading movies and music both aren’t illegal in the Netherlands, which is completely ignored, partially because BREIN asserted that, even though you can disable uploading, no one actually does this.

Updates

January the 11th 2012: XS4ALL has officially announced to appeal the court ruling, their CEO stating the court ruling is “Censorship” and that this is “A dark day in internet history”
January the 12th 2012: Ziggo has also officially announced to appeal the ruling.

Further Reading:

Tagged with:
Dec 31

Electronic Arts, Nintendo and Sony Still Support SOPA

By Xeross Posted in News, Tech Leave a Comment

Various “news” sites have reported that EA, Nintendo and Sony have dropped their SOPA support, though they’ve never published a press release about it and they weren’t even on the official list of SOPA supporters, Techdirt explains what caused this error.

So they don’t support SOPA? No, they do support it, as they’re all members of the ESA (Entertainment Software Association) which supports SOPA as can be seen in the official list of supporters (Mirror).

If you want to check whether a tech company is supporting SOPA don’t forget to look at the list of members of the ESA and the BSA (Business Software Alliance) who also support SOPA.

Tagged with:
Dec 29

Hash Algorithm Collision Denial-of-Service Vulnerability, Large Number of Websites Vulnerable

By Xeross Posted in News, Security/Hacking, Tech Leave a Comment

A security advisory was released yesterday detailing a denial-of-service vulnerability that most of the web could be affected by.

The vulnerability lies in the hashing algorithms used by a variety of programming languages (including Python, Ruby, PHP and Java). When collisions happens these algorithms will take up large amounts of CPU cycles to deal with them (From what I understand).

To give you an idea of the extent of this problem I’ll quote the PDF linked in the advisory, take for example PHP:

On an i7 core, the 60 seconds take a string of multi-collisions of about 500k. 30 seconds of CPU time can be generated using a string of about 300k. This means that an attacker needs about 70-100kbit/s to keep one i7 core constantly busy. An attacker with a Gigabit connection can keep about 10.000 i7 cores busy.

Or Ruby:

A typical POST size limit in Ruby frameworks is 2 MB, which takes about 6 hours of i7 CPU time to parse. Thus, an attacker with a single 850 bits/s line can keep one i7 core busy. The other way around, an attacker  with a Gigabit connection can keep about 1.000.000 (one million!) i7 cores busy.

This allows someone to take down almost any webserver with (very) limited resources. Possible workarounds are: limiting CPU time, limiting the POST size, or limiting the maximum amount of POST variables.

I’m currently waiting for the first PoCs and exploits to be published and will post an update when I get my hands on one (Which will also confirm if I understand the exploit correctly).

Update: I can see how this will ruin your day

Update 2: Go here for an easy to understand explanation.

Tagged with:
Dec 25

50,000+ Domains Transferred Away From GoDaddy Due To SOPA support

By Xeross Posted in News, Tech Leave a Comment

GoDaddy has seen a massive amount of domains being transferred away from them as customers are moving elsewhere because of their support for SOPA. Among the companies transferring are Wikipedia and the Cheezburger Network (Who own over 1000 domains). It all took off when a GoDaddy boycott was started on Reddit. Various other domain registrars are even offering discount codes for anyone transferring to them.

Just today (The 25th of December) the counter is standing on 28,656 domains transferred out as seen on DailyChanges, and the amount just keeps climbing, day after day more and more domains are being transferred away.

GoDaddy has now retracted their public support for SOPA but the damage has been done, not to forget that they helped write SOPA, not just support it. I have no idea how long this will keep going and how many people will move away but it’s gonna hurt (It’s already hurting actually). GoDaddy is even begging for people to stay.

I’m sure more companies will face the wrath of the public because of their SOPA support, and various companies are already retracting their support for it, some companies never even explicitly supported SOPA “they agreed with Floyd Abrams’ analysis of SOPA. That’s it. They didn’t say their firms supported SOPA”.

Tagged with:
Dec 24

Stratfor Rooted

By Xeross Posted in Anon/Etc., Security/Hacking, Tech Leave a Comment

Merry #LulzXmas to everyone http://imagebin.org/190224 Stratfor rooted. All your base are belong to us. <3 #Anonymous

This tweet just went out from the @AnonymousIRC Twitter account (First occurance of the tweet I could find), a mirror of the defacement can be found on Zone-H. The Stratfor website is down as I write this.

Stratfor is a large private intelligence corporation having fortune 500 companies and international intelligence agencies as their clients (source). A full list of clients can be found here.

Edit: there’s also this:

Over 90,000 Credit cards from LEA, journalists, intelligence community and whitehats leaked and used for over a million dollars in donations

- By @AnonymouSabu

So one million dollars from compromised credit cards, from what I can understand of later tweets they only used corp execs credit cards, who wont feel it that hard in their pockets, but not sure if I’m very fond of this action.

The Video Posted

Tagged with:
Dec 22

WTF is SOPA? (SOPA Explained)

By Xeross Posted in Tech Leave a Comment

TotalBiscuit explaining SOPA in an easy to understand way, big thanks to him for making this.

Tagged with: