Terminal keyboard shortcuts you should know

Some terminal keyboard shortcuts for you as power user.

Cursor position

  • [ctrl] + [a] – Go to beginning of line
  • [ctrl] + [e] – Go to end of line
  • [ctrl] + [xx] – Toggle between beginning and end of line
  • [alt] + [arrow left] – One word left
  • [alt] + [arrow right] –  One word right
  • [arrow left] – One character left
  • [arrow right] – One character right

Command History

  • [arrow up] – Previous command
  • [arrow down] – Next command
  • [ctrl] + [r] – Search in the command history
  • [ctrl] + [g] – Stop search in command history

Edit

  • [cmd] + [v] – Insert from clipboard
  • [ctrl] + [c] – Interrupt input
  • [ctrl] + [l] – Clear screen
  • [ctrl] + [d] – Delete character under the cursor
  • [ctrl] + [h] – Delete character before the cursor
  • [ctrl] + [w] – Delete word under the cursor
  • [crtl] + [u] – Delete the Line before the cursor
  • [esc] + [t] – Swap last two words before the cursor

Terminal

  • [ctrl] + [d] – Exit current terminal
  • [cmd] + [q] – Exit all terminals
  • [cmd] + [t] – New terminal tab
  • [cmd] + [shift] + [+] – Increase font size
  • [cmd] + [shift] + [-] – Decrease font size
  • [cmd] + [0] – Default font size

Create information gathering test application

It is time again for an extensive tutorial. This time, a tiny test application for passive and active information gathering. After the instruction you are welcome to improve the application with more features! Okay let’s start…

What should it do?

The security tester selects a information gathering method first. As second step the testers insert the URL or IP in a testfield and press a button. The result should printed out in a text area. The GUI should look like this:

Sensei Mockup

How it is implemented?

The prefered language is Python 2.7. So it is portable to different OS and for the most of methods are already packages available. The GUI is done with Tkinter. Tkinter provides all objects which are needed as widgets and ranges for this scope out completely. The file and folder structure look like:

File content

Files in root directory:

Files in essential:

Files in gathering:

That was it. The result looks like this:

Sensei

Improve it with your ideas!

UI testing with DalekJS and PhantomJS on CentOS

With DalekJS you can automate your functional GUI tests very easy. This article describe how to prepare the test environment on CentOS.

Setup

First, the necessary packages are installed.

It is also possible to compile PhantomJS itself, but this takes a lot of time.

Prepare test project

Once all is installed without any issues you can start to create the test project.

Create test case

Now it is time for the first Test Case. I have used the example from Dalek website.

Run test

By default DalekJS use PhantomJS as browser. For running the test case simple use dalek command and as argument the test case file (*.js).

Lynx text based web browser

Lynx can be used to check web site for accessibility, performance and SEO analysis.

Install Lynx

Use Lynx

Create a simple CGI server for Python

Sometimes there is a need that python scripts are executed directly from the browser. With CGIHTTPServer it goes very easily.

Create Folders

Create Python File

Add some content like:

Change the permission

Run CGIHTTPServer

Now open the browser and call URL: “http://localhost:8000/cgi-bin/test.py

Install and upgrade pip on Mac OS X

Mac OS X latest Yosemite comes with Python version 2.7, but not with pip (package manager). If you have Command Line Tools installed, the installation of pip is very simple.

Local HAR viewer on Mac OS X

There are several HAR file viewers online but sometimes you need the HAR viewer offline. It is very simple for Mac OS X user to get a local instance running.

Precondition

Preparation

The first step is generating HAR file.

Now download the latest Harviewer.zip and unzip into the user “Sites” folder. Rename the folder and setting up the permissions.

Result

Now open a browser and call URL like: “http://localhost/~<user>/harviewer/“. As last step drag the generated HAR file into the browser. You should see something like this:

HAR viewer result

Full webpage screenshot

For various reasons screenshots for webpages are needed. If automated test scripts fail, documentations must be created or in some other situations. With PhantomJS it is very easy to create these screenshots very fast by command-line. All what is needed a small JavaScript like this.

JavaScript

After save the script you can run it like: