CherryTree, Tool for your project or other notes

CherryTree is great open source tool for your notes. It has great features like:

  • tree structure
  • RTF editing
    • and also can paste text without formattting
  • can store content in one file
  • can encrypt you notes file
  • can export to different formats

I have created an example document for Project X, please see figure below.

cherrytree

The example files are:

I would recommend this instead of KeyNote NF, which I have mentioned earlier. I will mark KeyNote NF as archived…

Posted in Basic Tools, Recommended Free Tools, Tools | Comments Off on CherryTree, Tool for your project or other notes

ansifilter, tool to convert color codes in log file into color html

ansifilter is an open source tool which can convert ssh session logs (with putty) with ansi escape codes into html with colors.

First, putty should be configured with “all session output”, see figure below. Next, the log file should contain some ANSI escape codes. For creating colors with the help of awk script, please see another blog.

putty-config01

The log file

The text below is how the log file looks like. It contains the printout from the mount command.

putty-logfile

Minor issue: background color

I haven’t found a good way to get black background when using the GUI tool. With the command line tool, it is possible to use stylesheet to set the background color.

When using GUI

After saving the output into html, then one can modify the HTML <body> tag to get the background color, please see below:

<body style=”color:white;background-color:black”>

When using CLI

First create a stylesheet.css file with the following content

body {
background-color: #050505;
color: #808080;
}

Then execute the ansifilter command. If the log file is “mount.log” and output is mount.html, then command looks like this:

ansifilter.exe -H -i mount.log -o mount.html -r stylesheet.css

Please note that, the html output is now referring to that stylesheet as it add the following line to the html:

<link rel=”stylesheet” type=”text/css” href=”stylesheet.css”>

HTML output

And the result is here below. Please compare it to the screenshot in the other blog.

root@D2403:/ # 

root@D2403:/ # mount | awk '

> BEGIN {IGNORECASE=1;

> black  =sprintf("\033[1;30;40m&\033[0m");

> red    =sprintf("\033[1;31;40m&\033[0m");

> green  =sprintf("\033[1;32;40m&\033[0m");

> yellow =sprintf("\033[1;33;40m&\033[0m");

> blue   =sprintf("\033[1;34;40m&\033[0m");

> purple =sprintf("\033[1;35;40m&\033[0m");

> cyan   =sprintf("\033[1;36;40m&\033[0m");

> white  =sprintf("\033[1;37;40m&\033[0m");

> };

>  

> {

> gsub($1,blue,$1); 

> gsub($2,yellow,$2); 

> gsub($3,cyan,$3); 

> gsub("rw,",red,$0); 

> gsub("ro,",green,$0); 

> print}'

rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,relatime,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/LTALabel /lta-label ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/ftma /ftma ext4 ro,seclabel,relatime,nobarrier,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
tmpfs /storage/emulated tmpfs rw,seclabel,nosuid,nodev,relatime,mode=050,gid=1028 0 0
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:65 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/emulated/0 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
root@D2403:/ # exit

root@D2403:/data/data/berserker.android.apps.sshdroid/home # exit

Posted in Android, Anvanced Tools, Tests, Tips, Tools | Comments Off on ansifilter, tool to convert color codes in log file into color html

Greenshot, Advanced tool for screenshots

Greenshot is great open source tool for taking full screen or region screenshots.

It can automatically save the screenshot into a file and copy into a clipboard. These settings are shown in the picture below.

Greenshot

PS: I will mark ScreenGrab as “archived”. It is the tool I was using previously.

Posted in Basic Tools, Recommended Free Tools, Tips, Tools | Comments Off on Greenshot, Advanced tool for screenshots

Utilizing color in ssh session (example with Android)

When using ssh to connect to “small” devices like android or raspberry, one might not have an option to install several packages. In those scenarios one can reuse the existing command line tools that are often included.

This tip is showing how to use awk to use color when looking through log files or printouts. No additional installation is needed, since the awk scripts can be executed directly from command line. The colors are created by awk script which is doing it by generating ANSI escape codes. The terminal software then interprets these codes and shows the colors.

In case of android, tool called awk is included in busybox or sshdroid installation.

What is needed:

  • awk in android (included in sshdroid)
  • ssh connection (using putty)

Coloring words, example with command: mount

android-awk-mount

The command, including the awk script, is shown below. Awk is used to highlight words with colors.

mount | awk ‘BEGIN {IGNORECASE=1;
black =sprintf(“\033[1;30;40m&\033[0m”);
red =sprintf(“\033[1;31;40m&\033[0m”);
green =sprintf(“\033[1;32;40m&\033[0m”);
yellow =sprintf(“\033[1;33;40m&\033[0m”);
blue =sprintf(“\033[1;34;40m&\033[0m”);
purple =sprintf(“\033[1;35;40m&\033[0m”);
cyan =sprintf(“\033[1;36;40m&\033[0m”);
white =sprintf(“\033[1;37;40m&\033[0m”);};
{gsub( $1,blue ,$1);
gsub( $2,yellow ,$2);
gsub( $3,cyan ,$3);
gsub(“rw,”,red ,$0);
gsub(“ro,”,green ,$0);
print}’

Coloring lines, example with command: logcat

android-awk-logcat

The command, including awk script is shown below. Awk is used to highlight full lines.

logcat | awk ‘BEGIN {IGNORECASE=1};
function black(string) { print “\033[1;30m” string “\033[0m “; }
function red(string) { print “\033[1;31m” string “\033[0m “; }
function green(string) { print “\033[1;32m” string “\033[0m “; }
function yellow(string) { print “\033[1;33m” string “\033[0m “; }
function blue(string) { print “\033[1;34m” string “\033[0m “; }
function purple(string) { print “\033[1;35m” string “\033[0m “; }
function cyan(string) { print “\033[1;36m” string “\033[0m “; }
function white(string) { print “\033[1;37m” string “\033[0m “;
{if ($0 ~ /location/) red($0);
else if ($0 ~ /LocSvc/) red($0);
else if ($0 ~ /wifi/) yellow($0);
else if ($0 ~ /WLAN/) yellow($0);
else if ($0 ~ /connectivity/) yellow($0);
else if ($0 ~ /google/) blue($0);
else if ($0 ~ /browser/) blue($0);
else if ($0 ~ /root/) cyan($0);
else if ($0 ~ /supersu/) cyan($0);
else if ($0 ~ /busybox/) cyan($0);
else print $0}’

Coloring words, example with command: logcat

android-awk-logcat-words

And the code:

logcat | awk ‘BEGIN {
IGNORECASE=1;
red =sprintf(“\033[1;31;40m&%c\033[0m”, 0x1B);
yellow =sprintf(“\033[1;33;40m&%c\033[0m”, 0x1B);
blue =sprintf(“\033[1;34;40m&%c\033[0m”, 0x1B);};
{gsub(“location”,red);
gsub(“wifi” ,yellow);
gsub(“google” ,blue);
print}’

Coloring words/columns, example with command: top

android-awk-top

And the code:

top -b | head -30 | awk ‘BEGIN
{IGNORECASE=1;
black =sprintf(“\033[1;30;40m&\033[0m”);
red =sprintf(“\033[1;31;40m&\033[0m”);
green =sprintf(“\033[1;32;40m&\033[0m”);
yellow =sprintf(“\033[1;33;40m&\033[0m”);
blue =sprintf(“\033[1;34;40m&\033[0m”);
purple =sprintf(“\033[1;35;40m&\033[0m”);
cyan =sprintf(“\033[1;36;40m&\033[0m”);
white =sprintf(“\033[1;37;40m&\033[0m”);};
{gsub(” radio “,yellow,$0);
gsub(” system “,blue,$0);
gsub(” root “,red,$0);print}’

Coloring words/columns, example with command: ps

android-awk-ps

And the code:

ps -w | awk ‘BEGIN
{IGNORECASE=1;
black =sprintf(“\033[1;30;40m&\033[0m”);
red =sprintf(“\033[1;31;40m&\033[0m”);
green =sprintf(“\033[1;32;40m&\033[0m”);
yellow =sprintf(“\033[1;33;40m&\033[0m”);
blue =sprintf(“\033[1;34;40m&\033[0m”);
purple =sprintf(“\033[1;35;40m&\033[0m”);
cyan =sprintf(“\033[1;36;40m&\033[0m”);
white =sprintf(“\033[1;37;40m&\033[0m”);};
{gsub(” radio “,yellow,$0);
gsub(” system “,blue,$0);
gsub(” root “,red,$0);print}’

Some explanations

  • in awk, $0 means full line, $1 is the first field in the line, $2 is the second field etc.
  • in awk, gsub is replacing original text with colored text
  • \033 is the start of the ANSI code

Generating colors with bash

There are other ways to create colors, for example using bash. The last script on this page would generate color table like this below:

colortablewithbash

 

Viewing session log afterwards in color

It is possible to visualize these colors afterwards, if the session is saved into a log file. This is done by converting those ansi escape codes into html colors. Please see another blog for details.

Posted in Android, Anvanced Tools, Raspberry Pi, Tips, Tools, Troubleshooting | Comments Off on Utilizing color in ssh session (example with Android)

Android 6 and new privacy related settings

Android version 6, Marshmellow, has adopted a new run-time permission system that is available to the users. Permissions are divided into permission groups and users can modify permissions per application. It is possible to see how many applications are allowed in each group, and what permissions are applicable for each application. Please go to “Settings –> Apps” to find out.

Screenshots

“Permission groups” “Example: Firefox permissions” “3pp App showing more details”

Android6-permission-groups Android6-AppPermission-Firefox Android6-3pp-PermissionExplorer-REBOOT-permission

Links for permission settings:

The following table is from developer pages “Permissions“:

 

Permission Group Permissions
CALENDAR READ_CALENDAR
WRITE_CALENDAR
CAMERA CAMERA
CONTACTS READ_CONTACTS
WRITE_CONTACTS
GET_ACCOUNTS
LOCATION ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
MICROPHONE RECORD_AUDIO
PHONE READ_PHONE_STATE
CALL_PHONE
READ_CALL_LOG
WRITE_CALL_LOG
ADD_VOICEMAIL
USE_SIP
PROCESS_OUTGOING_CALLS
SENSORS BODY_SENSORS
SMS SEND_SMS
RECEIVE_SMS
READ_SMS
RECEIVE_WAP_PUSH
RECEIVE_MMS
STORAGE READ_EXTERNAL_STORAGE
WRITE_EXTERNAL_STORAGE

More details from “Application security: Permission model“:

permissions check

  • These resources are only accessible through the operating system.
  • The user can not grant or deny individual permissions — the user must grant or deny all of the requested permissions as a block.
  • applications that are included in the core operating system or bundled by an OEM do not request permissions from the user

More details from developer docs:

Security: Permissions

Normal permissions cover areas where your app needs to access data or resources outside the app’s sandbox, but where there’s very little risk to the user’s privacy or the operation of other apps.

Dangerous permissions cover areas where the app wants data or resources that involve the user’s private information, or could potentially affect the user’s stored data or the operation of other apps

For a list of normal permissions, see here. For a full list of permissions, please see Manifest.permission.

Permission element, PermissionInfo, protectionLevel

When looking the developers docs, the real story is more complex. For example, there is a full list of protection levels defined as

  • normal
  • dangerous
  • signature
  • signatureOrSystem
  • privileged
  • system
  • development
  • appop
  • pre23
  • installer
  • verifier
  • preinstalled

Other related

  • Assist application has many permissions, but can be turned off. (See Apps–>Default Apps–>”Assist & voice input”)
  • “Ok Google” voice recognition can be turned off. (Deny access to microphone).
  • Permission Explorer is quite handy to browse through permissions.

Summary

It is great that there are more controls for the user. This is significant improvement for many users. In addition, there are several related configurations spread around the settings tool, and one would need to go through all possible settings. For example, one have to select “Show system” option inside “Microphone permissions” under “App Permissions” to see also the system applications, and not only the ones that you have installed yourself…

If privacy is your concern, then this improvement does not guarantee that you would have full control.

Additional “on device” alternative for the privacy

There are some additional steps that one can do.

  • Use only local calendar. (Can be created by MyPhoneExplorer)
  • Use only local account for Contacts. (Can be created by MyLocalAccount)
  • Use local firewall to block unwanted traffic. (Can be done with NoRoot Firewall, creates a local VPN to filter traffic)
  • Turn off GPS, and/or data traffic when not needed

Please note that email clients/solution have not been included here. Those should be evaluated case by case.

Posted in Android, Privacy, Protection, Recommended Android Applications, Security Management, Security Training, Awareness and Reports, Tips | Comments Off on Android 6 and new privacy related settings

Insider Threat Report, 2015 by Vormetric

Vormetric has published a set of documents as part of the Vormetric 2015 Insider Threat Report. The research has been conducted by Harris Poll and analyzed by Ovum. Some short extracts are shown below. Worth to have a look.

The most dangerous insiders have privileged access

For far too long systems administrators and business users with privileged access to the most sensitive corporate data have had open access, with few controls placed on their rights of entry. Even today only half of all business organizations have deployed privileged access/identity management (PAM or PIM) technology. But what has changed, and is clearly reflected in the Insider Threat Report survey results, is that senior management concerns over privileged user access have reached the top of their security agendas.

At the same time, insider access controls for other high-risk groups should not be ignored. The survey results suggest that other IT staff, many of whom have all the skills required to instigate an insider attack, are to a large extent being overlooked.

Vormetric-InsiderThreat2015

Vormetric-InsiderThreat2015B

There also is other editions, like European Edition and Cloud and Big Data Edition. The figure below shows the main concerns for data within cloud environments.

Vormetric-InsiderThreat2015C-Cloud

Posted in Cloud Security, Risk Management, Security Management, Security Threats, Security Training, Awareness and Reports | Comments Off on Insider Threat Report, 2015 by Vormetric

Simple LED detector for RFID or NFC of 13MHz, without any battery

Triggered by experience with “Raspberry and RFID reader/writer, first test “, I tested a simple LED RF detector idea that can be found in “RFID detector” and “RFID Reader Detector and Tilt-Sensitive RFID Tag “.

For 13Mhz RFID/NFC, the LED RF detector contains 3 components

  • 2uH inductance
  • 68pF capasitance
  • low power LED

The components are connected in parallel. The LC circuit has a resonance peak around 13 MHz and can drain enough power from the RFID/NFC reader to light the LED. For simplicity, there is no resistor in the circuit that would limit the maximum current through the LED. The currents are so small that the resistor is not needed. The figure below is made with the Fritzing tool .

RF-detector-circuit2

The inductive coil of 2uH can be made by 7 loops of 25mm diameter. A functioning example is shown below. Capasitor is under the tape. The LED turns on around 15-20 mm above the RFID reader.

RF-detector-LED3

The figure below shows a slight modification, where 2nd LED is added to the circuit. The 2nd LED is also parallel connected but with opposite direction than the 1st LED.

RF-detector-LED1-smallest

Online tools for calculating inductance of self made coils and resonant frequences

Portable tool for RLC circuit resonance frequency and bandwidth

One can use the portable MiscEl tool to see the impact if the L or C values are changed. The screenshots below are for the used values L=2uH and C=68pF.

MiscEl2 MiscEl1

Posted in DIY, For Fun or Interest, Gadgets, Hobbies and Other Interests, Internet of Things and M2M, Raspberry Pi, Recommended Free Tools, Tests | Comments Off on Simple LED detector for RFID or NFC of 13MHz, without any battery