Tuesday, July 3, 2012

How to add Swap Drives on Linux

How to add swap drives after installation

After installing Ubuntu and you would like to install a swap partition, make sure there is an empty partition.

Let's list your partitions:

ls /dev/sda*

Let's say that your the partition your going to make a swap is "/dev/sda3":

sudo mkswap /dev/sda3

Mount the swap partition:

sudo swapon -U xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

This command will give you the UUID of the drive:

sudo blkid /dev/sd3

Open your "/etc/fstab":

sudo nano /etc/fstab

Add the following but make sure to replace the UUID:

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none swap sw 0 0

To save, hit Ctrl + x, then Enter.

In the end, make sure your swap is loading properly

sudo blkid
Make sure the UUID for "swap" matches the one in the "/etc/fstab".

Further testing:

sudo mountvall -v

How to install Adobe Reader on Ubuntu

How to install Adobe Reader

First open the terminal and type this in:

sudo apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"

Update your package list:

sudo apt-get update

Finally install:

sudo apt-get install acroread

How to open .rar files in Ubuntu

How to open .rar files in Ubuntu

Default installation doesn't can not open .rar files

sudo apt-get install unrar

Wednesday, May 30, 2012

How to turn off DNSMASQ in Ubuntu

If you sudo netstat -tupln, you will notice DNSMASQ running.

Edit the file: /etc/NetworkManager/NetworkManager.conf

sudo gedit /etc/NetworkManager/NetworkManager.conf

Simply comment out:

Now restart to make sure it is off.
sudo restart network-manager

Tuesday, May 8, 2012

How to Reverse Engineer Android Malware

Reverse Engineer Android Malware

Tools you may need for decompiling Android malware:

apktool – a tool used for manipulating .apk files
   Download: http://code.google.com/p/android-apktool/
jad – a Java decompiler (Windows only)
   Download: http://www.varaneckas.com/jad
JD-Core + JD-GUI – another Java decompiler, supporting newer Java versions and features
   Download: http://java.decompiler.free.fr
dex2jar – a tool for converting .dex files to .class files
   Download: http://code.google.com/p/dex2jar/downloads/list (dex2jar)
apkinspector - all in one tool
   Download: http://code.google.com/p/apkinspector/

However, this tutorial is fairly easy and simple and I will only be using dex2jar and jd-gui. This tutorial is a standard for all apps. You can use the same tools and methods to help decompile your applications and other applications, especially malware, in order to see and understand what the code is actually doing.

So, say we have our malicious malware such as "file.apk".

A lot of these tools can be used in Windows as well as Linux, however I happen to be using Windows for this tutorial.
For Linux: sh dex2jar.sh file.apk
For Windows: dex2jar.bat file.apk

This will create the file called file_dex2jar.jar. Now we can easily view our app's code with jd-gui.
Simply just click on the jd-gui and open the file_dex2jar.jar.

 Now we can easily read and see the code.

Further Research/Advanced Topics:

  • Code Obfuscation 
  • Decompiling Manifest Files
  • Obtaining the Resources - images, etc.

For Related Articles:


Saturday, May 5, 2012

How to setup Environment Variables in Linux/Windows

Open your .bashrc, located in your /home/"user"/ and add this:

export PATH=${PATH}:~/path/to/your/executeable

Start > Control Panel > System and Security > System > Click on "Advanced system settings" > Click on "Environment Variables"

Under user variables, click on "new" and then give your new variable a name such as "PATH" and for the Path, input the absolute directory of the file you wish to run.

For example: ";C:\Windows;C:\Windows\System32;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\Python;C:\"

I have Nmap and Python executable from my Windows Command Prompt.

For Related Articles:


Friday, April 27, 2012

Android - Text Bomber/Spammer

A Simple Text Spamming App

This is only for proof of concept, please only use for educational purposes only.

Make sure the app contains:

Java Code - SpamActivity.java

XML code - main.xml

Thursday, April 5, 2012

HelloWorld in Assembly

Assembly - HelloWorld
[bits 64]
global _start

section .data
message db "Hello, World!"

section .text
mov rax, 1
mov rdx, 13
mov rsi, message
mov rdi, 1

mov rax, 60
mov rdi, 0
Then run it:
nasm -f elf64 hello.asm
ld hello.o -o hello