Posts

Showing posts from May, 2016

Using OpenSSL

Image
Let's create a privatekey:


$> openssl genrsa 128 > my.key
Note: This is only a 128 bit key. Use this only for demo/educational purposes!

You can get some information about the private key with the rsa command:


$> openssl rsa -inform PEM -text -noout < my.key
However, the private key is our secret and we need the public key to encrypt a message. Extract the public key with the -pubout switch:


$> openssl rsa -pubout -in my.key > my.pub
You can get some information about the public key with the rsa command:


$> openssl rsa -inform PEM -text -noout -pubin < my.pub
Let's encrypt a message using our public key. OpenSSL's rsautl helps with that:


$> echo -n "Hi" | openssl rsautl -encrypt -inkey my.key > messageor


$> cat message | hexdump 
0000000 e1a8 947f e1b2 e514 c8d4 b3e4 0c46 36c9
0000010
Note: This only works for messages which are smaller than the modulus. Usually the message is encrypted with a symmetric key which is in turn encrypted with RSA.

GPG cheatsheet

Getting StartedCreating your secret key will start with:gpg --gen-keyYou should probably use the default settings, except it doesn't hurt to make the key size as large as allowed (4096 bits currently.) The larger the key size, the longer it will take to initially generate your key (and encryption/decryption will be slightly slower. That is a Good Thing, as anyone attempting to break your encryption will also need to spend more time too.)
to export a public key into file public.key:gpg --export -a "User Name" > public.keylist your key : 

gpg --list-keys your@email.addressto export a public key into file public.key : gpg --export -a "User Name" > public.keyto export a private key :gpg --export-secret-key -a "User Name" > private.keyTo encrypt data, use : gpg -e -u "Sender User Name" -r "Receiver User Name" somefileorgpg -s -a -r "User Name" -e somefile # the output file ""somefile.asc""orgpg --en…

Simple use of Base64 Command

Image
This tool is Simple to use, just type : 
echo "Hi All" | base64 
to decode the message just type : 
echo "SGkgQWxsCg==" | base64 -d

strace for "dig" command

I'm not sure if it the same situation, but is not a usage of 'strace' easier? You can see syscalls and you can search for sendmsg and recvmsg to see what data are sent through socket.
For example: strace -e trace=sendmsg,recvmsg -f -s 1024 dig +short www.google.com This will show you a full DNS request and answer. Reverse engineering was never easy before :)

Byobu : Japanese term for decorative

Image
Byobu is a Japanese term for decorative, multi-panel screens that serve as folding room dividers. As an open source software project, Byobu is an elegant enhancement of the otherwise functional, plain, practical GNU Screen. Byobu includes an enhanced profile, configuration utilities, and system status notifications for the GNU screen window manager as well as the Tmux terminal multiplexer. Byobu is developed and released as free software under the GPLv3.
Install in Fedora 22 32bit :dnf install byobu
the final result :
Key Bindings Byobu is a configuration layer on top of GNU Screen. As such, all of GNU Screen's keybindings work in Byobu exactly as in Screen. Moreover, Byobu provides a comprehensive, advanced set of commands bound to the F-keys on most keyboards.

F2 Create a new window
F3 Move to the previous window
F4 Move to the next window
F5 Refresh all status notifications
F6 Detach from the session and logout
Shift-F6 Detach from the session, but do not logout
F7 Enter …

Use the Chromebook Recovery Utility

Image
If you need to recover your Chromebook, you can use the Chromebook Recovery Utility to create recovery media and get your Chromebook working like new again. What you need to create recovery media Before using the utility, make sure that you have: A flash drive or other storage media that can hold at least 4GB and that you don't mind clearing.An extra Chromebook, Windows, or Mac computer with administrative rights and Chrome browser installed. Create recovery media If your Chromebook isn't working properly, you can use an extra Chromebook or another Windows or Mac computer to create recovery media. Otherwise, you can follow these steps on your Chromebook if you want to create recovery media to use later. If you're using a Linux computer, follow the instructions listed after Step 6. Step 1: Install the Chromebook Recovery Utility app Install the Chromebook Recovery Utility app on your Chromebook or on your Windows or Mac computer.Open the app. Step 2: Identify your Chromebook Ty…

Free Public DNS Servers

Google Public DNS IPv4 Addresses: 8.8.8.8
8.8.4.4 Google Public DNS IPv6 Addresses:
2001:4860:4860::8888
2001:4860:4860::8844 Level 3 Public DNS Server Addresses:
209.244.0.3
209.244.0.4
4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4 OpenDNS IP Addresses:
208.67.222.222
208.67.220.220 Norton DNS IP Addresses:
Option A:
199.85.126.10
199.85.127.10 Option B:
199.85.126.20
199.85.127.20 Option C:
199.85.126.30
199.85.127.30