Newsletter # 25 - Using the script command to record a terminal session May 27 2020

Hello, and welcome to issue #25!

How is your week going? I hope you are doing ok.

A lot of exciting news this week. First, there is a new jailbreak for iOS. Whatever your stance might be with jailbreaking. I'm always impressed by the depth of knowledge and ingenuity of the jailbreaking community. Many people view it as something wrong and illegal. But it has some real security benefits, it allows researchers to deep dive into iOS and help find vulnerabilities that otherwise would be known only to bad actors. As the famous security researcher Patrick Wardle shown on his research used in a NYTimes article. He used a jailbroken phone to continue the analysis he was doing on an app suspected of spying his users. Very interesting stuff, if you are into Apple security, you should check his writings.

Another exciting piece of news comes from NASA and SpaceX. We can watch today the first SpaceX astronaut launch. You can check all the details here:

The launch is scheduled for today, May 27, at 4:33 pm EDT. And the live coverage starts at 12:00 pm EDT. It is not the first man on the moon, but it beats any other news for today.

If you are interested in space and being an astronaut, I would recommend the following book:

Spaceman: An Astronaut's Unlikely Journey to Unlock the Secrets of the Universe

I heard the audiobook on audible, and it was so much fun. If you listen/read it, and let me know if you liked it.

The world is an exciting place, and technology is enabling to do things we never thought could be possible. The technology we had in 1969 (for Apollo 11) allowed us to put a man on the moon, that's crazy.

Speaking of old technology this week's post was about one command-line tool that was created in 1979 (10 years after Apollo 11). But after 41 years is still kicking and as useful as before. That is the useful script(1) command that we can use to record our terminal sessions. You can use to create demos or to capture the screen when running a command. I bet you can find many uses for it. If you are interested here is the link:

I love that there are tools that, after decades, are still working and as useful as when they were created.

Ok, that's it for this week. I hope you enjoy the rest of the week and get to watch the space launch.

Until next time,

Tip of the week

Speaking about security, one of the most common cleanups that intruders make on our systems to hide their tracks is deleting or emptying the .bash_history file for a compromised user.

It would be nice if we can change how a file behaves and prevent it from being deleted or cleared. Enter chflags(8), this command allows us to set different attributes (flags) that alter the behaviour of how the system handles the files. For example, we can tell the file only to allow appends:

$ chflags sappend /home/derik/.bash_history

Or to prevent the file to be modified at all:

$ chflags schg /etc/passwd

You can check the flags using -o flag for the ls(1) command:

$ ls -lo /etc/passwd
-rw-r--r-- 1 root schg 6.8K Aug 24 2019 /etc/passwd

We can then remove the flags by appending a no to the flag:

$ chflags noschg /etc/passwd

Check the man page. There are a lot of useful flags.

** If you want to check what else I'm currently doing, be sure to follow me on twitter @rderik or subscribe to the newsletter. If you want to send me a direct message, you can send it to