Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, July 23, 2012

How to remove EXIF data from Images in Linux

Ubuntu Linux

Install jhead:
sudo apt-get install jhead

To see all the extra data that is stored in the JPG, run this:
jhead -v FILE.jpg

To remove the extra data such as "geo-tagging(location data)", your name and the type of phone or camera that look the picture, run this command on the image:
jhead -purejpg FILE.jpg


Mac OS X

Install exiftool:
http://www.sno.phy.queensu.ca/~phil/exiftool/install.html

To see all the extra data that is stored in the JPG, run this:
exiftool -v FILE.jpg

To remove the extra data such as "geo-tagging(location data)", your name and the type of phone or camera that look the picture, run this command on the image:
exiftool -all= FILE.jpg




Saturday, July 7, 2012

How to Extract a .7z file in Linux

How to extract a .7z files

To install the packages:
sudo apt-get install p7zip


In Linux, when you would like to extract a ".7z" file, you need to open your terminal and type this in:
7za e FILE.7z

Thursday, July 5, 2012

How to use crontabs in Linux

How to create a crontab

Open your terminal and run:

crontab -e
This will be for your user. 

Usually this should open up your crontab file in nano. Today, we will run our crontab to execute hourly:
0 * * * * /bin/sh /PATH/TO/SCRIPT
Now, this runs hourly shell scripts(/bin/sh).

 If you would like to run other scripts, obviously you simply change the "/bin/sh" to whatever you would like(python, perl, bash, etc...).

minute 0-59
hour 0-23
day 1-31
month 1-12
day-of-week 0-7 (0/7 Sunday, 1 = Monday, 2 = Tuesday, etc...)
command-line the command to execute

Tuesday, July 3, 2012

How to Extract a Tar Ball on Linux

How to extract a Tar Ball in Linux

In Linux, when you would like to extract a "tar.gz" file, you need to open your terminal and type this in:

tar -zxvf FILE.tar.gz

tar xvjf FILE.tar.bz2

How to install the Android SDK

How to install the Android SDK

First, install Eclipse here.

After installing Eclipse, install the Android ADT plugin for Eclipse:
 - Click on Help > Then click on
 - Install New Software Copy and paste this and click "Add":
https://dl-ssl.google.com/android/eclipse/
 - Click "OK"

Eclipse will ask you to restart. After you restart, the Android ADT plugin will ask you to either download and install the Android SDK for you or you can do it yourself.

If you are using an existing SDK or downloading it yourself:

Download the SDK:

http://developer.android.com/sdk/index.html

The file should look like:

android-sdk_r20-linux.tgz

Extract the file to your /home/USER directory by either double clicking on the file or command line:

tar -zxvf android-sdk_r20-linux.tgz
Next you will go into Eclipse and use the Android ADT plugin to use with the /home/USER/android-sdk that you have extracted.

Installing Android Versions

 - Go to Window > then click on Android SDK Manager

 From here, you can select the Android Packages that you would like.

How to remove bloatware that comes with Ubuntu

How to safely strip(uninstall) Ubuntu Bloatware

Package List (Last Updated 10/4/2012):

sudo apt-get remove --purge --ignore-missing gbrainy aisleriot gbrainy gnome-games-* gnome-sudoku gnomine libgme0 mahjongg bogofilter* empathy* thunderbird* remmina gwibber* tomboy avahi-daemon transmission-* whoopsie samba* modemmanager ubuntuone* rhythmbox* activity-log-manager-common python-zeitgeist zeitgeist-core deja-dup pidgin* apport*
* Note: this is for standard Unity

Remove Unity Completely:
http://blog.burrowsapps.com/2012/09/ubuntu-completely-remove-unity.html

Make sure to have a new Desktop(default theme):
http://blog.burrowsapps.com/2012/09/ubuntu-install-gnome-3.html

How to install Google Chrome on Ubuntu

How to install Google Chrome

Fast Way:
https://www.google.com/intl/en/chrome/browser/

Download the ".deb" file and install through the software store.

Command Line:
First, you need to get the repository:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

Next, you need to edit your source list:

sudo nano /etc/apt/sources.list

Add this:

deb http://dl.google.com/linux/chrome/deb/ stable main

Crtl + x, then Enter to save

Followed by updating your package list:

sudo apt-get update

Finally install Google Chrome:

sudo apt-get google-chrome-stable

How to install Dropbox on Ubuntu

How to install Dropbox - the fastest way

Go to their install page:

https://www.dropbox.com/install?os=lnx

Download the ".deb" file and it will install through the store.

How to fix Eclipse library errors on Ubuntu

Here is a list of Eclipse Errors:

Eclipse - Indigo
On start, it will load and then soon crash stating that the

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gtk-3740 in java.library.path
no swt-gtk in java.library.path
Can't load library: /.swt/lib/linux/x86_64/libswt-gtk-3740.so
Can't load library: /.swt/lib/linux/x86_64/libswt-gtk.so

Ubuntu 12.04 32 bit
sudo ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

Ubuntu 12.04 64 bit
sudo ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

http://stackoverflow.com/questions/10165693/ubuntu-eclipse-cannot-load-swt-libraries-not-opening

How to install Eclipse on Ubuntu

How to install Eclipse

Open your terminal:

sudo apt-get install eclipse

This is will install the stable version from the repositories.

How to switch your Java version on Ubuntu

How to easily change your Java version

This is how you can get the versions you are using now:

java -version
javac -version
javaws -version

Easily change which Java installation you would like to use:

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

If you have installed this repository:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update

You can install a graphical version to easily change your Java version:

sudo apt-get install update-java
sudo update-java

How to install Java 7 on Ubuntu

How to install Java 7 - fastest way
 
Add this repository:

sudo add-apt-repository ppa:webupd8team/java

Update your package list:

sudo apt-get update

Add this, in case you don't have it:

sudo mkdir -p /usr/lib/mozilla/plugins

Finally install Java 7:

sudo apt-get install oracle-jdk7-installer

http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7

How to install Gnome on Ubuntu

How to install Gnome on Ubuntu

Open your terminal:

sudo apt-get install gnome-panel

Now when you log out, you can log back in with Gnome or Gnome Classic.

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

Disable DNSMASQ
 
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:
#dns=dnsmasq

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:

http://blog.burrowsapps.com/2012/02/hacking-facebook-for-android.html

Saturday, May 5, 2012

How to setup Environment Variables in Linux/Windows

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

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


Windows:
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:

http://blog.burrowsapps.com/2011/10/android-adb-bash.html

Thursday, April 5, 2012

HelloWorld in Assembly

Assembly - HelloWorld
[bits 64]
global _start

section .data
message db "Hello, World!"

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

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