Home Blog Page 987

Linus Torvalds Is “Really Happy” with Linux Kernel 4.3 Release Candidate 6

It’s Sunday evening for many of us Linux users, so the release of a new RC (Release Candidate) build of the upcoming Linux 4.3 kernel is “in plan” for some overnight testing.

Just a few minutes ago, Linus Torvalds announced that the sixth Release Candidate of Linux kernel 4.3 is available for download and testing from the usual places, and it appears that things are calming down very well for this release, which makes Mr. Torvalds really happy. “Things continue to be calm, and in fact have gotten progressively calmer. All of which makes me really happy…” says Linus Torvalds.

Fun with e2fsck and debugfs

Hello there, 
We are going to corrupt the system and then repair, restore sanity. Things we are going to do:

 

  • fun1 → Corrupt the superblock.
  • fun2 → Multiply owned block.
  • fun3 → Corrupted inode.
  • fun4 → Orphaned inode.

Lets begin with perfectly working file system, which has say 10 files. 
mkfs.ext3 /dev/xvdb 

 

 Superblock backups stored on blocks:                                            
        32768, 98304, 163840, 229376, 294912, 819200, 884736   
 

Go ahead and mount it then create 10 files. 
mount /dev/xvdb /mnt 

for i in {1..10}; do echo "this is file$i" > /mnt/file$i.txt ; done 
Verify everything looks fine on mount point. Let the fun begin!

Fun1: Attack Super block

Our first task is to corrupt the super block. Run following command which will zero-out super block! 
dd if=/dev/zero of=/dev/xvdb count=1 bs=1024 seek=1 
above command,writes 0’s on superblock location at offset 1024! Now lets try to mount it : 
umount /mnt && mount /dev/xvdb /mnt 

 mount: you must specify the filesystem type   
 

failed right? that’s what we wanted 🙂 Now how to fix this ? For cases like this ext3 has backup superblock (have look at above mkfs.ext3 output more closely!) All you need to do is tell mount command to use that copy of superblock. 
mount command expects block address in 1KB. so we need to convert our address like 98304 * 4 = 393216 we will try again with alternate superblock option “-o sb=” now: 
mount -o sb=393216 /dev/xvdb /mnt 
Worked! Just go ahead and explore everything is fine on mountpoint! 

Fun 2: Multiply owned blocks – No, Its MY block!

a Lets check out our existing file contents. 
cat /mnt/file1.txt /mnt/file2.txt 

this is file1                                                                   
this is file2

We are going to corrupt file system in such way that file2.txt will also point to file1.txt content!!!! 
To modify file system structure, we will a command called debugfs – an ext2/ext3/ext4 file system debugger 

First fetch the data block address of file1.txt (i.e where ‘this is file1’ is stored). 
debugfs -s 98304 -b 4096 /dev/xvdb -w 
debugfs: stat file1.txt 

 Inode: 12   Type: regular    Mode:  0644   Flags: 0x0                           
Generation: 1325309953    Version: 0x00000000                                   
User:     0   Group:     0   Size: 14                                           
File ACL: 0    Directory ACL: 0                                                 
Links: 1   Blockcount: 8                                                        
Fragment:  Address: 0    Number: 0    Size: 0                                   
ctime: 0x561ff500 -- Thu Oct 15 18:48:32 2015                                   
atime: 0x561ff7f1 -- Thu Oct 15 19:01:05 2015                                   
mtime: 0x561ff500 -- Thu Oct 15 18:48:32 2015  
BLOCKS:                                                                         
(0):2048                                                                        
TOTAL: 1 
 

Okay, debugfs stat output tells us the file1.txt data block address is 2048 

Now lets point file2.txt to this block with another debugfs command named mi which is powerful command. It gives up ability to modify inode contents! run 

debugfs: mi file2.txt 
and keep pressing the enter key

 
                       Mode    [0100644]                                     
                       User ID    [0]                                           
                      Group ID    [0]                                           
                          Size    [14]                                          
                 Creation time    [1444934912]                                  
             Modification time    [1444934912]                                  
                   Access time    [1444935703]                                  
                 Deletion time    [0]                                           
                    Link count    [1]                                           
              Block count high    [0]  
                

until you reach Direct Block #0 
Here type file1.txt block address here (2048)

             Direct Block #0    [2049] 2048                                   

Now just press enter until debugfs 

debugfs: quit 
and quit. To summarize, we figure-out the block address (2048) of file1.txt with debugfs-stat command, then replaced file2.txt block address 2049 with 2048. 
By following unmounting and remounting – we ensure our above changes written to disk.
umount /mnt 

mount -o sb=393216 /dev/xvdb /mnt -t ext3 
Now go head print file1.txt file2.txt 
cat /mnt/file1.txt /mnt/file2.txt 

this is file1                                                                   
this is file1

I hope you can spot the difference between our previous file1.txt and file2.txt output ans this one, right? Now lets run fsck to repair this. Since we can’t run file system checker (fsck) on mounted partitions 
umount /mnt 
e2fsck /dev/xvdb 

 e2fsck 1.41.12 (17-May-2010)                                                    
e2fsck: Superblock invalid, trying backup blocks...                             
/dev/xvdb was not cleanly unmounted, check forced.                              
Pass 1: Checking inodes, blocks, and sizes                                      
                                                                                
Running additional passes to resolve blocks claimed by more than one inode...   
Pass 1B: Rescanning for multiply-claimed blocks                                 
Multiply-claimed block(s) in inode 12: 2048                                     
Multiply-claimed block(s) in inode 13: 2048                                     
Pass 1C: Scanning directories for inodes with multiply-claimed blocks           
Pass 1D: Reconciling multiply-claimed blocks                                    
(There are 2 inodes containing multiply-claimed blocks.)                        
                                                                                
File /file1.txt (inode #12, mod time Thu Oct 15 18:48:32 2015)                  
  has 1 multiply-claimed block(s), shared with 1 file(s):                       
        /file2.txt (inode #13, mod time Thu Oct 15 18:48:32 2015)               
Clone multiply-claimed blocks? yes 
 

Hey! see it figures our file1.txt and file2.txt has shared block 2038 which is wrong. It prompts how to deal with this case, we indeed cloned it.
Now it go on to update other book keeping entries: Just say yes to them. 

 
lock bitmap differences:  -2049                                                
Fix? yes                                                                     
Free blocks count wrong for group #0 (31863, counted=31853).                    
Fix? yes                                                                     
Free blocks count wrong (1512305, counted=1512295).                             
Fix? yes                                                                     
Free inodes count wrong for group #0 (8181, counted=8171).                      
Fix? yes                                                                     
Free inodes count wrong (393205, counted=393195).                               
Fix? yes           
 

Fun 3: Corrupt permission/type – can you fix it?

Lets use debugfs again, open the drive with debugfs -this time we are going corrupt file ‘mode’ with modify inode option. 
debugfs: mi file3.txt 

Mode    [0100644] 0
//keep pressing enter key

and then quit debugfs. 
debugfs: quit 
unmount and mount again if needed, and do: 
ls -l /mnt/file3.txt 

 ?---------. 1 root root 14 Oct 15 18:48 /mnt/file3.txt  
 

hihi 🙂 can you see that, we corrupted file permission!!! 
I want you to fix this ‘mode’ with debugfs mi. If you are wondering what values to put, just look above..no,not the sky :p just scroll above for original mode values

Fun 4: Sad, Orphaned inodes

You might have seen this error message sometimes, lets recreate it. we will create 2 files on a new directory ‘dir1’ 
mkdir /mnt/dir1 

 echo "this is file-a" > /mnt/dir1/a
echo "this is file-b" > /mnt/dir1/b
 

with the help of debugfs,we will corrupt dir1 entries! 
debugfs clri dir1 

what this will do is unlink the chain between directory and its file. Now go back and list ls -l /mnt/dir1 won’t show this file. You get error like

ls: cannot access /mnt/dir1: Input/output error

Remember file ‘a’ and ‘b’ are not deleted. Its laying on our file system without any directory pointing to it. 
If we run e2fcck now, it will find these orphaned inodes and put it under lost+found . So ahead and run it, you get message like 

 Pass 4: Checking reference counts                                               
Inode 2 ref count is 4, should be 3.  Fix? yes                               
 Unattached inode 32770          
Connect to /lost+found? yes                                                  
Inode 32770 ref count is 2, should be 1.  Fix? yes                           
Unattached inode 32771                                                          
Connect to /lost+found? yes  
Inode 32771 ref count is 2, should be 1.  Fix? yes  

e2fsck has done its job, lets go ahead and explore the end result. 
ls -l /mnt/lost+found/ 

 total 8                                                                         
-rw-r--r-- 1 root root 15 Oct 15 20:28 #32770                                   
-rw-r--r-- 1 root root 15 Oct 15 20:28 #32771         

Verify the content of files: 
cat #32770 

 this is file-a

cat #32771 

 this is file-b

Can you guess the how these filename are created? 

Think..think..

hmm..No? Have a close look at our e2fsck output. Yes, these the inode numbers of ‘a’ and ‘b’. 

That’s it, I hope you learned new corruption tricks, please feel free try these corruption on your production system^ 

^  Disclaimer : I’m not responsible, if you get fired!  

 

The First Malicious App Enters The Ubuntu Touch Store & Quickly Removed


First malicious app entered the ubuntu touch app store

If you’re using Ubuntu Touch then this is for you. Recently the first malicious app has entered into the Ubuntu touch store by bypassing the security measurements. The app does some malicious activities and changes the default flash screen without any permission. Fortunately, the app called “test” has been quickly removed from the store after being noticed.

Read At LinuxAndUbuntu

BackBox 4.4 Released With Updated Packages And New Tools, Upgrade To BackBox 4.4


BackBox 4.4 released

Backbox Linux is a free, open-source Linux distribution based on Ubuntu. Backbox is one of the most popular Linux distros designed to perform security assessments and penetrations tests. The team recently released the new version 4.4. The version includes all the latest packages that have been recently released and some of the new features that improve BackBox strength.

Read At LinuxAndUbuntu

Droid Turbo 2 Will Feature “Shatterproof” Display and Moto Maker Customization

Motorola and Verizon have already announced that we’ll be seeing the next Droid smartphones on October 27th. But with that unveiling still over a week away, Droid Life has published leaked print ads for the phones that spell out some of their features.

The boldest and most interesting claim is that the Droid Turbo 2 will include a “shatterproof” screen. We still have no idea how Motorola has managed to accomplish this, or exactly which materials have made the latest Droid’s display so durable. Both companies must be pretty confident of the phone’s toughness if they’re willing to make “shatterproof” an actual selling point. 

Read more at The Verge

IBM, Carnegie Mellon Team on Cognitive App for the Blind

IBM teams with Carnegie Mellon’s Robotics Institute to deliver a platform for building cognitive assistance apps for the blind. Scientists from IBM Research and Carnegie Mellon University (CMU) recently announced a new open platform to support the creation of smartphone apps that can enable the blind to better navigate their surroundings.IBM partnered with CMU’s famed Robotics Institute to create a pilot app called NavCog that draws on existing sensors and cognitive technologies to inform blind people on the CMU campus about their surroundings by “whispering” into their ears through ear buds or by creating vibrations on smartphones.

Read more at eWeek

Switching to Dashboard Spice Console on RDO Liberty (RC3) AIO installation on CentOS 7.1

Current post briefly describes conversion to dashboard Spice console along with enabling spice console features as sound and cut&&paste via slightly updated patches of Y.Kawada ( and converted from pdf to raw format). To get this features working using  any spice-gtk tools ( spicy, virt-manager ) requires ports 5900,…,590(X) to be opened via ipv4 iptables firewall on node running openstack-nova-compute.

Complete post is available here

 

Youtube-DL A Command-Line & GUI Youtube, Facebook, Dailymotion Videos Downloading Tool For Linux


youtube-dl command-line & gui video downloader for linux

Youtube-DL is a command line tool, developed in Python to download videos from various popular websites including Youtube, Dailymotion, facebook, photobucket and many others. A list of supported video sites is available here. Youtube-dl downloads videos right from the terminal with simply understandble commands. If you like to work with terminal then I am sure you’ll like youtube-dl.

Read At LinuxAndUbuntu

This Week in Linux News: Jim Zemlin on Preventative Internet Security & More

This week in Linux headlines, Linux Foundation Executive Director Jim Zemlin tackles the topic of preventative Internet security for The New York Times, and more! Here’s your weekly Linux news briefing:

1) Jim Zemlin comments on preventative measures for Internet security.

Hacking for Security, and Getting Paid for It– The New York Times

2) Google gets rid of notification center bundled with Chrome due to low usage. 

Google dumps Chrome’s notification center on Windows, Linux, and Mac– PCWorld

3) Disney Reaserchers use Linux in latest light bulb breakthrough.

Linux LightBulb Pioneers LED Light Communication for IoT– ElectronicsWeekly

Our post on the topic from last month: Disney Lights Up IoT With Linux Light Bulb

4) The ONOS Project joins the Linux Foundation as a collaborative project.

ONOS SDN Project Joins Linux Foundation– eWeek

Tips and Tricks for Using the Two Best E-Readers for Linux

ereader AIt is 2015 and your home library that once resided on bookshelves and milk crates now exists on either a handheld reader, your laptop, or your desktop. That, of course, is not to say the end of physical books is nigh. But when you want the most convenient way to either read or keep your library with you, e-books are the way to go. This is especially true for larger, heavier textbooks.

The good news for Linux users is that there are plenty of outstanding apps to make reading e-books quite easy. And, because these tools happen to be offered on the Linux platform, they offer some really cool features to make your e-book life even better.

Let’s take a look at two of the best e-book readers available for Linux, as well as a trick or two for each.

Calibre

Calibre is the mack daddy of e-book tools on Linux. Not only does it offer an outstanding e-reader, it also helps you to convert your .html files into e-book format (it’ll convert .odt and other files…just not as well). The Calibre reader does a great job of displaying your e-books (from a vast array of formats). Calibre also offers a number of really handy features, such as:

  • Bookmarks

  • Reference mode (when in this mode, if you hover your cursor over a paragraph, it will show you the reference number in the form of Chapter.ParagraphNumber)

  • Table of Contents (view the book TOC as a sidebar)

  • Full-screen mode

  • Themes

  • And so much more

There is, however, one feature that places Calibre heads above all other competition: the Calibre server. With this, you can run a server and access your books from any device. Let’s set this up and access the Calibre server from another machine. I will assume you’ve already installed Calibre (it can be found in your distribution’s standard repositories). The steps are simple:

  1. Open Calibre and click on the Preferences button

  2. Click Sharing over the net (under the Sharing section)

  3. Configure the necessary port (if applicable)

  4. Give the server a username (passwords can cause some devices to not work with the server)

  5. Click Start Server

  6. Click Test Server

When you click Test Server, your default web browser should pop up to display the web-based Calibre Library interface (Figure 1 above).

With the server running, locate the IP address of the machine hosting your Calibre server. You can now access that server in the form of http://192.168.1.70:8080. From that page, you can open a book by locating what you want to read and then clicking the associated Get button (Figure 2).

jack-ereader BOnce you click Get, the e-book file will download and you can then open it in your local copy of Calibre (or whatever e-reader you choose).

The one caveat to this is, by starting the server in this way, it will stop the second you close the app. If you want to leave the server running (without the GUI open), you can run it with the following command:

calibre-server --daemonize

This command will allow you to run the server without having to open Calibre. You can then set it to run as a startup service. How you do this will depend on what startup service your distribution uses (systemd or init).

There are even Android apps that let you access your Calibre library from anywhere (if you happen to save your Calibre Library in a cloud location). One particular app, Calibre Cloud, does a great job of accessing your Calibre Library from the likes of Google Drive, Dropbox, etc. Both a free version and a Pro version ($1.99 USD) are available. The Pro version also contains a built-in reader. If you opt for the free version, you’ll need to also install an e-book reader to use for viewing.

Lucidor

Lucidor doesn’t offer all the power and features that comes along with Calibre, but it is one of the best straight-up e-readers you’ll find for Linux. This tool is strictly a reader. Even without all that power under the hood, Lucidor delivers an outstanding e-reader experience. One of the coolest features of Lucidor is its tabbed interface, which allows you to open not only multiple books, but also multiple books from multiple sources.

You won’t find Lucidor in your standard repository. In fact, you’ll have to download the file for installation on your distribution. Let’s install Lucidor on Ubuntu. Here’s how:

  1. Download the .deb file

  2. Open a terminal window

  3. Issue the command sudo dpkg -i lucidor_XXX_all.deb (where XXX is the release number)

  4. Hit Enter

  5. Type your sudo password

  6. Hit Enter

  7. Allow the installation to complete

You should now see the Lucidor launcher in your Dash (or menu, depending upon your desktop). Run the app and you will be greeted by the minimal welcome screen (Figure 3).

jack-ereader CThe interface is quite simple to use. You click on the Links drop-down and select what you want to open. Let’s open up the Personal bookcase in a tab and then add a book. Click Links > Bookcase and the new tab will open, defaulting to the Personal Bookcase. Now click File > Open File. Locate the .epub file you want to add and then click Open. When the file opens in the Lucidor tab, you will prompted whether you want to add the file to the current Bookcase (Figure 4). Click Add and the book will now be available in your personal bookcase.

jack-ereader DAt this point, you can click the Tab button, click Open Bookcase, and start the process over to open a new book.

You can also add annotations to books for easy note-taking. Here’s how:jack-ereader F

  1. Open the book in question

  2. Locate a section of the book you want to annotate

  3. Click the Contents drop-down

  4. Select Annotations

  5. Highlight the portion of the text you want to annotate

  6. Click Create Note

  7. Enter your note for the annotation (Figure 5)

  8. Select Highlight (if you want the selected text to be highlighted)

  9. Select Mark Annotations to place a mark on the text where the annotation starts

  10. When you’re finished, click Add

There are several other features you can enjoy with either Calibre or Lucidor. Most importantly, however, is that you can simply read your books. Other e-readers are available for the Linux platform, but once you’ve used either of these, you won’t settle for anything less.