Tech Star

  • Home
  • App Development
    • Topics
    • Getting Started with Android
      • Installing the Android SDK
      • Creating the first Android application
      • Create a Simple Menu
      • Creating an Emulator
    • Android with Maven
      • Creating Android Project with Maven Archetypes
    • Gradle
      • Migrating Java project from Maven to Gradle
    • Location based applications
      • Getting Started with Maps
      • Google Maps Application with Google Maps Android API v2
      • Google Maps Android API v2 Key (New)
      • Get the Map API key (Deprecated)
      • Current Position
      • Process of putting a marker
      • Simply view Google maps data
      • Testing the Current Position on Emulator
    • Barcode Reader application
      • QR/Bar-code Scanner using “Zxing Fragment Library”
      • Barcode/QRcode Scanner using ‘android-zxinglib’ library project
    • GCM
      • Google Cloud Messaging for Android (GCM)
      • Process of sending a Push Notification using GCM in a nutshell
    • Internal Database
      • Creating SQLite internal databases
      • SQLite Database Browser
      • Export Android internal databases
    • Android Testing
    • Genymotion VM
      • Genymotion Virtual Device
      • Fix error: adb server is out of date. killing…
    • Discuss Issues
      • Android Studio
        • “Module not Specified” in Android Studio
      • Memory full Issues
        • Extend internal storage of android device with Link2SD (free) and Link2SD Plus
        • Partitioning external SD Card using “MiniTool Partition Wizard Free”
        • Work out to fix “Memory full” error on android device
      • Maven or Gradle Issues
        • Fix Issue: Failed to install artifact : (Access is denied) while installing 3rd party jars with maven
        • Gradle Build Issue: an unrecognized jvm option is used
      • Issues on Ubuntu
        • Fix Issue: Android SDK Manager is not executable on Ubuntu 14.0 ?
        • Fix Issue: while calling repo init; fatal: unable to auto-detect email address…
      • Ecipse Issues
        • Fix Issue: Problem updating the ADT plugin
      • VM Issues
        • Fix error: adb server is out of date. killing…
  • Operating System
    • System Execution Environment
      • System Execution Sequence – BIOS/UEFI and Bootloader
    • Flashing Firmware
      • Flashing Unofficial AOKP Nougat (Android 7.1.2) and Xposed on Galaxy S4 GT-19500
      • Installing Xposed on Galaxy S4 GT-19500 Android 6.0.1 CM13
      • Flashing Custom Firmware Android 6.0.1 CM13 on Galaxy S4 GT-19500
      • Flashing Official Lollipop 5.0.1 on Galaxy S4 (GT-19500) using Odi3 v3.13.1
    • Build Android OS
      • 1. Getting CyanogenMod source code
      • 2. Get-prebuilts requires while building
      • 3. Getting device-specific code
      • 4. Enable ADB on Linux to link your device and LinuxVM
      • 5. How to connect your mobile device to LinuxVM
      • 6. Extracting proprietary files from the device
      • 7. Extracting proprietary files from an already built CyanogenMod ROM
      • 8. Start Building OS…
    • Android Kernel
      • Android Kernel Overview
      • How to Build Android Kernel from source (Part 1)
      • How to Build Android Kernel from source (Part 2)
    • Android Rooting
      • Detecting Rooted Android Devices
      • Get Root Access- Root my phone with Root Genius
    • Android Security Model
      • Android security model (4.2 and earlier)
      • Android security model (4.3 and later)
    • Build Issues
      • Android AOSP download error – fatal: error no host given
      • Make error “could not find jdk tools.jar”
      • AOSP Build Issues: Invalid Java Version
    • Octoplus Box
      • Octoplus Box for unlock, flash, and repair mobile phones
      • “Read Unlock Codes” with Octoplus
  • Security
    • Tracers
      • Peekaboo Tracer
    • Certificate Pinning
      • Move Android User Installed Certificates to System CA Store
    • Xposed (Dynamic Testing)
      • Xposed: Hook Java Anonimous Inner Classes
      • Tips for writing Xposed Module to Hook Android App’s Methods
      • Xposed: Hook and Read okhttp3.Response Body Without Failures
      • Fix Bootloop Caused By Xposed Module
      • Running Xposed Module: “Default Activity not Specified” error
    • Fuzzing
      • AFL/Kelinci: Fuzzing a java program
    • Ethical Hacking
      • Scanning & Enumeration: Step 1. Scanning Hosts
      • Create a Simple Port Scanner on Kali Linux
      • Tools for Passive Reconnaissance on Kali
      • Traffic Mirroring with OpenWrt
        • 1.Enable OpenWRT on TP-link TL-WR841N router
        • 2.Reinstall the firmware on the OpenWRT enabled TP-link TL-WR841N.
        • 3.Unbrick a TP-link TL-WR841N router
        • 4. Install chaos_calmer on OpenWRT device TP-Link WR841n router
        • 5.Solving internet connection problem on openWRT device for package installations
        • 6. Traffic mirroring using OpenWRT router
    • Web Scrapping
      • Scraping JavaScript Web Sites which requires Authentication
    • Kali Linux
      • Create Kali Linux Live USB stick with Etcher on Windows
      • Install Kali Linux using USB drive
      • Use MongoDB Cloud with Python on Kali 2020
      • Use MongoDB on Kali Linux with PyCharm
      • Install MongoDB on Kali 2020
      • Setup Chrome Driver for Selenium on Kali Linux
      • Create an Open Hotspot on Kali Linux
      • Install JD_GUI on Kali
      • Solving apt-get update error on kali linux
      • Fiddler on Kali Linux
      • Use MySQL Database with Pycharm Community Edition on Kali Linux
      • Wi-Fi Connection Settings For Kali Linux
      • Python GUI with PySide2 and QtCreator
    • Reverse Engineering
      • 1. Getting familiar with “Radare2”
      • 2. Disassembling and Rebuilding with ‘Apktool’
      • 3. ‘Dex2jar’ with ‘JD-GUI’ decompiler
      • 4. Python script to automate decompiling Android apk files
      • 5. Python script to automate “search-text” in decompiled files
      • 6. Decompiling APK with jadx
    • mitmproxy
      • Use mitmproxy to Capture Traffic on the Same Machine
    • Fiddler
      • Running PyCharm Traffic through Fiddler
      • Fix ERR_CONNECTION_TIMED_OUT error on Android with Fiddler Proxy
    • SSL
      • SSL: 01 Creating a self-signed SSL certificate
      • SSL: 02 Installing a self-signed SSL certificate
      • SSL: 03 Force HTTPS using .htaccess
    • Articles
      • Article on Mobile Secuirty
  • Internet of Things (IoT)
    • Why Smart Homes Require Integration Analysis?
    • Did you know that your Philips Hue bulb can be hijacked by a malicious hub in the neighborhood?
  • About Kulani Mahadewa
    • About Kulani Mahadewa

Install MongoDB on Kali 2020

Posted by Kulani Mahadewa on March 10, 2020
Posted in: Kali Linux. Tagged: .bashrc, basrc, binaries, error, export, install monodb, isngtall, Kali, Kali 2020, Kali Linux, Kali Linux 2020, Linux, mongo, mongod, mongod package not found, mongoDB, pacakge not found mongod, package not found mongo, pakcage not found, path, Unable to locate package mongo, Unable to locate package mongodb-org, Unable to locate package mongodb-org/mongo. 3 Comments

Hi, I have tried to install mongod from the apt-get install on my Kali Linux machine. However, it couldn’t find a package with that name. Hence, I decided to install mongod binaries specified at in their documentation as follows.

  • Donwload mongod package and extract the content

mogodown

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.17.tgz
  • Add the location of mongod in the PATH variable

Goto home directory -> Ctrl+H -> Find the .bashrc file -> open and paste following-> Save

export PATH=<path-to-mongodb-directory>/bin:$PATH
  • Create data/db directory. (Since I use the root user not needed to set permissions)
mkdir -p /data/db
  • Now open terminal and use mongod  to start the server
mongod

mongod

  • Use mongo command to use the database
mongo

mongo

Cheers ! 🙂

 

Advertisement

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Python GUI with PySide2 and QtCreator

Posted by Kulani Mahadewa on March 7, 2020
Posted in: Kali Linux. Tagged: gui, Kali, Kali 2020, Kali Linux, kit selection, Linux, mainWindow.py, mainWinow.ui, no kits, no kits available, pyqt, pyqt5, pyside, pyside2, python, Python GUI application, QApplication, qt, Qt 5.14, Qt Version, qt wideget application, qt widget, Qt5, QtCore, QtCreator, QtDesigner, QtGui, QtWidgets. Leave a comment

Hi, In this post I explain how to create a GUI application for Python using Qt. Qt is a cross-platform software development framework.  It provides PySide to support creating GUI applications for Python. There is also PyQt another python package supporting the same functionality. This post explains the differences between the two packages. They are basically alternatives. So, in this post I’m using PySide2 the latest version of PySide supporting the Qt 5.14 version.  In brief, you can first generate the layout using QtCreator tool. Then export that into your Python application for adding functionalities to the UI components.

Step 1: Install QtCreator/QtDesigner

There are two version of the QtCreator is available. You can use the open source version.

  • Prerequisite:
sudo apt-get install build-essential libgl1-mesa-dev
  • Download the installer:  from https://www.qt.io/offline-installers. I installed qt-opensource-linux-x64-5.14.1.run.
  • Installing: The installer can be directly executed on linux machine (I’m using Kali Linux 2020)  when  provide access to execute. It will prompt to create a user account through the installer. Then verify your email and continue. Once installed the application can be find through the application searching as qt.

qt setup

Step 2: Create an Qt Application using the QtCreator

  • Select Qt Widget application -> Provide the name and location -> select qtmake as the build system -> Next, you can edit class name information -> Next, select Kit Selection as ‘Desktop’ -> Finish

Screenshot_2020-03-08_01-57-38

  • When you install for the first time there won’t be any kits available.

Hence, you need to do the following steps first.

    • Install qt5-defaults
sudo apt-get install qt5-default
    • At the QtCreator Select Tools -> Options -> at Kits goto Qt Versions -> Maual -> Add -> give qmake file of qt5 location (usr/lib/x86_64-linux-gnu/qt5/bin/qmake)

Screenshot_2020-03-08_02-10-12

qt setup versoin

    • Then at the Kits window –> Select Desktop -> Update the Qt Version to the added Qt version.
    • Now, you can create the Qt Widget application as described above.
  • When you created the Qt application you can use the ‘Design’ View to add the layouts and the components as desired.

Screenshot_2020-03-08_02-20-47

Step 3: Export your designed mainWindow.ui as mainWindow.py

The mainWindow.ui is an xml file.

Screenshot_2020-03-08_02-21-00

You can covert it to a python file as folllows.

pip3 install PySide2
pyside2-uic mainwindow.ui -o mainWindow.py

The generated mainWindow.py:

Screenshot_2020-03-08_02-31-30

Step 4: Create Python GUI Application

Now, you can create a python project including the mainWindow.py, and another python file app.py to refer the components in the mainWindow.py and provide functionalities.

you import the Ui_mainWindow from the ainWindow.py  in app.py

app.py:

import sys
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from path.to.mainWindow import Ui_mainWindow

class MainWindow(QMainWindow, Ui_mainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setupUi(self)
self.assignWidgets()
self.show()

def assignWidgets(self):
self.goButton.clicked.connect(self.goPushed)

def goPushed(self):
self.goText.append("Test Go!")

if __name__ == '__main__':
app = QApplication(sys.argv)
mainWin = MainWindow()
ret = app.exec_()
sys.exit( ret )

You can refer to following tutorials for more information

  • https://it.toolbox.com/blogs/jeffhoogland/pyside-tutorial-using-qt-designer-with-pyside-031315
  • https://doc.qt.io/qtforpython/PySide2/QtWidgets/QMainWindow.html

Cheers ! 🙂

 

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Peekaboo Tracer

Posted by Kulani Mahadewa on March 5, 2020
Posted in: Tracers. Tagged: dynamorio, generating trace, modularized, peekaboo, seqence of instructions, Testing, trace, tracer. Leave a comment

Hi, Today I’m introducing the Peekaboo Tracer available at GitHub. You can use it to obtain the sequence of instructions executed while running a program or function as a trace. A trace in general, is a sequence of events happened when performing a task. So, if any errors were occurred while performing the task, the trace can be analyzed to find the problem or the cause.  Hence, the objective of Peekaboo is to help the users generate the traces.

Challenges in Tracing

The typical challenges in generating and managing a trace:

    • Length of the trace is tool long: If a single trace file includes all the attributes of a instruction, then the file size becomes too big.
    • Customized requirements: which attributes of the instructions are included in the trace (An instruction includes an instruction address, opcode, register value, memory value, memory address): If a single trace includes selected attributes for each instruction. Then reading the trace becomes difficult.

Solution by Peekaboo

In addressing the above challenges, Peekaboo introduces modularization. In precise, it generates a file for each attribute in a instruction such that each attribute file includes a sequence of attributes corresponding to the sequence of instructions executed. Hence, depending on the interest of the user, he can generates the trace including selected attributes.

Set up Peekaboo

Peekaboo is built on top of DynamoRIO instrumentation tool. Hence, we required to download the latest build of DynamoRIO to test the Peekaboo.

  • Download DynamoRIO DynamoRIO-Linux-7.91.18319.tar.gz
  • Download Peekaboo Source: git clone https://github.com/melynx/peekaboo.git

Next, following the guide in the Peekaboo documentation..

cd peekaboo_dr
mkdir build
cd build
DynamoRIO_DIR=/path/to/DynamoRIO/DynamoRIO-Linux-7.91.18319 cmake ..
make

cmake

make

Run Peekaboo

Generate the trace for executing ls command as follows.

path/to/DynamoRIO/DynamoRIO-Linux-7.91.18319/bin64/drrun -c /path/to/peekaboo/peekaboo_dr/build/libpeekaboo_dr.so -- ls

Results: Generated Trace Files

trace modules

Cheers ! 🙂

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Wi-Fi Connection Settings For Kali Linux

Posted by Kulani Mahadewa on March 3, 2020
Posted in: Kali Linux. Tagged: advanced network configurations, configurations, connection, edit, edit network configurations, Encryption Required, Kali, Kali 2020, Kali Linux, Kali Linux 2020, Linux, MSCHAPv2, network, no EAP, password, security, settings, Tunnel TLS, username, Wi-Fi, wifi, wifi security, WPA, WPA2 Enterprise. Leave a comment

Hi, To Connect With your School or Work Place Wi-Fi, you may use following settings in the “Advanced Network Configuration”.settngs

pre settings

Cheers ! 🙂

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Use MongoDB Cloud with Python on Kali 2020

Posted by Kulani Mahadewa on March 1, 2020
Posted in: Kali Linux. Tagged: Cloud, Connect with MongoDB cloud, Kali, Kali 2020, Kali Linux, Kali Linux 2020, MongDB Atles, MongDB Cloud, mongoDB, pymongo, python, Python 3.6 or later, Python 3.8, Unable to locate package mongod, Unable to locate package mongodb-org. Leave a comment

Hi, today I give a step by step guide to use mongoDB Atles  with a python program. I decided to use the cloud version since it’s easy and as well as free. And most importantly I got ‘Unable to locate package mongodb-org/mongo’ error while trying to install on Kali 2020.1. If you still want to install mongodb on host please refer to this.

 Step 1: Create an Account of MongoDB Atlas

Visit https://www.mongodb.com/download-center to create a free account.

Step 2: Next Create a New Cluster

You have to give the IP address that can access the cluster. It could be your device or can allow for anyone.

  • Find IP of your device: On browser visit http://httpbin.org/ip
  • The IP for anyone to access : 0.0.0.0/0 (Have security issues)

Next, give give the name and password for a DB user. These credentials later required to connect with the cluster from the python program.

mognodbcluster

Step 3. Connect the DB

Since I’m using the MongoDB within a Python program, I select as follows.

“Connect  Your Application” -> Choose “Python” driver and version (3.6 or later) used in the program

Next, copy the generated String and replace the <password> with the given password when generating the DB user.

connecte db

Step 4. Generate a Database and a Collection

Select ‘Collection’ –> It will prompt to create the database. Provide a name from Database and a Collection. –> Create

Screenshot_2020-03-01_21-23-38

Step 5: Update Python Program

You should install the pymongo driver to use with the program.

from pymongo import MongoClient
client = MongoClient(<Past the generated String >)db = client.get_database('service')collection = db.get_collection('authdetails')

Cheers !

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Scraping JavaScript Web Sites which requires Authentication

Posted by Kulani Mahadewa on February 20, 2020
Posted in: Web Scrapping. Tagged: Authentication, cannot connect to docker daemon, cookies, docker, dynamic content, JavaScript, javascript authentication, login form, python, scrape, scrape javascript web site, scrape website, scrapy, scrapy-splash, selenium, SpalashRequest, splash, SplashFormRequest, web authentication, Web Scrapping. Leave a comment

Hi, In this post I give a detailed guide for scraping web pages which contains JavaScript contents and login forms. I’m using the following existing tools based on python.

  • Scrapy: A web scrapping framework
  • Splash: A lightweight browser
  • Selenium: A web application test-automation tool

Scrapy provides a simple framework to scrap web sites. However, it originally does not provide facility to generate dynamic contents of JavaScript code. Therefore, Scrapy-Splash plugin was introduced. With this plugin a ‘SplashRequest’ can be used to send requests to JavaScript enabled sites and receive the dynamic content in response. However, I had trouble using corresponding ‘SplashFormRequst’ to login in to the web site, before scrapping. Hence, I used the selenium to login to the website first, then pass the cookies to ‘SplashRequest’ for further scrapping the web site.

Step 1: Generating a Scrapy Project

You can refer to scrapy documentation on how to install, create project, and create your spider. In brief

  • Install Scrapy
pip install Scrapy
  • Goto the desired directory ->
scrapy startproject <project name>
  • In the generated project, goto ‘spiders/’ subdirectory. Then create a new python file naming your spider.

Refer: https://docs.scrapy.org/en/latest/intro/tutorial.html#our-first-spider to write your first spider.

import scrapy
from scrapy.spiders import CrawlSpider

class LoginSpider(CrawlSpider):
    name = NAME
    start_urls = [LOGIN_URL]

    def parse(self, response):
        print(response)

Step 2: Installing Splash

To install splash I followed an existing tutorial by ScrapingAuthority. It installs splash through docker platform. In brief the steps are to

  • Install docker
sudo apt install docker.io
  • Install Splash
sudo docker pull scrapinghub/splash
Possible Error and Solution:

If you get following error:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See ‘docker run –help’.

# sudo service docker stop
# sudo service docker start 
# sudo docker run -p 8050:8050 scrapinghub/splash

docker

  • Install scrapy-splash python plugin
sudo pip install scrapy-splash
  • Update scrapy project’s settings.py with splash related configurations.
DOWNLOADER_MIDDLEWARES = {
    'scrapy_splash.SplashCookiesMiddleware': 723,
    'scrapy_splash.SplashMiddleware': 725,
    'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810,
}
SPLASH_URL = 'http://localhost:8050'
DUPEFILTER_CLASS = 'scrapy_splash.SplashAwareDupeFilter'
HTTPCACHE_STORAGE = 'scrapy_splash.SplashAwareFSCacheStorage'
  • Start splash server
sudo docker run -p 8050:8050 scrapinghub/splash
  • Update the YourSpider.py
import scrapy
from scrapy.spiders import CrawlSpider

class LoginSpider(CrawlSpider): 
    name = NAME 
    start_urls = [LOGIN_URL] 

    def parse(self, response): 
        print(response)
        yield SplashRequest(url=LOGIN_URL, callback=self.after_login, endpoint='render.html) 
    def after_login(self, response): 
        print(response)

 Step 3: Use Selenium to Login to the Web Page

  • Install selenium
pip install selenium
  • Update YourSpider.py as follows.
import scrapy
from scrapy.spiders import CrawlSpider

class LoginSpider(CrawlSpider): 
    name = NAME 
    start_urls = [LOGIN_URL] 

    def parse(self, response): 
        print(response)
        browser = webdriver.Chrome('/usr/bin/chromedriver', chrome_options=chrome_options)
        browser.get('https://ifttt.com/login?wp_=1')
        username = browser.find_element_by_id(USERNAME_KEY)
        password = browser.find_element_by_id(PASS_KEY)
        username.send_keys(USERNAME)
        password.send_keys(PASS)
        browser.find_element_by_name("commit").click()
        time.wait(10)
        yield SplashRequest(url=browser.current_url, callback=self.after_login, endpoint='render.html',cookies=self.browser.get_cookies()) 

    def after_login(self, response): 
        print(response)

 

Cheers ! 🙂

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Setup Chrome Driver for Selenium on Kali Linux

Posted by Kulani Mahadewa on February 19, 2020
Posted in: Kali Linux. Tagged: browser, Chrome, chrome browser, chrome driver, Driver, Kali Linux, python, selenium, web scraping. 4 Comments

Hi, In this post I briefly explain how to setup chrome driver on Kali linux, to use with selenium for web scraping. First, you need to have Chrome browser installed on Kali. Next, you can download the chrome driver match with the browser version and setup on python selenium scripts.

Step 1: Install Chrome Browser

The following steps are to install chrome browser version 80.0.3987.106 (Official Build) (64-bit). Reference:  https://computingforgeeks.com/install-google-chrome-browser-on-kali-linux/

sudo apt update

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb cat /etc/apt/sources.list.d/google-chrome.list 
google-chrome-stable  --no-sandbox

Update:

On Kali 2020.1 use following commands: Since Kali 2020.1 supports non-root user, it is not required to use  –no-sandbox option. If you are using root user account, then again have to use –no-sandbox option.

sudo apt update
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb 
google-chrome-stable

Step 2: Download Chrome Driver

Next, visit the web site https://chromedriver.chromium.org/downloads and download the linux_64 zipped version of ChromeDriver 80.0.3987.106. You can optionally move the driver file to /usr/bin/ folder.

chmod +x '/home/python tool/chromedriver_linux64/chromedriver'
sudo mv -f '/home/python tool/chromedriver_linux64/chromedriver' /usr/bin/chromedriver

Step 3: Setup Chrome Driver inside python script

In the python script you should specify the location of the chrome driver, as well as configure options to have chrome driver working with selenium.

from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/usr/bin/chromedriver', chrome_options=chrome_options)
driver.get(URL)

Alternatively Can Use Firfox (Kali Linux includes Firfox Browser by default):

Download the firfox driver match with the browser version from https://github.com/mozilla/geckodriver/releases e.g., for browser versions >=60, driver version 26

geckodriver-v0.26.0-linux64.tar.gz

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
browser = webdriver.Firefox(capabilities=cap, executable_path=r'/root/Tools/Firefox/geckodriver')

 

Cheers ! 🙂

 

 

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Use MongoDB on Kali Linux with PyCharm

Posted by Kulani Mahadewa on February 5, 2020
Posted in: Kali Linux, Linux. Tagged: Kali, kali lin, mongo, mongod, mongoDB, PyCharm, pymongo. Leave a comment

Hi, In this post I will detail how I installed and used MongoDB on Kali Linux, including how I resolved the issues came across.

Step 1: Install mongodb on Kali Linux

  • Use the following command to install mongodb (refer: source)
sudo apt-get install mongodb

Alternatively, you can remove existing installations with the following command before executing the above install command.

sudo apt-get purge mongo*
  • Run the mongodb server

I tried the following  two commands based on the existing tutorials, however with errors.

#1 mongod

Error:error0

#2 sudo systemctl start mongod

Error:

erro1

Solution:

create /data/db directory

sudo mkdir -p /data/db
sudo chmod g+w /data/db
mongod

 

server run 2

Step 2: Set up PyCharm

  • Install pymongo using the PyCharm interpreter. (File -> Settings -> Under ‘Project’ find the  ‘Project Interpreter’)

Step 3: Create a mongodb database

Open a new terminal and use command

mongo

Following that you can use an existing tutorial : https://www.tutorialspoint.com/mongodb/mongodb_create_collection.htm on creating and managing mongoDBs as follows.

create db

Step 4: Use the created mongoDB on PyCharm

import pymongo

uri = 'mongodb://127.0.0.1:27017'
client = pymongo.MongoClient(uri)
db = client['actionmonitor']
collection = db['pagedefaults']

Cheers ! 🙂

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Security Publications

Posted by Kulani Mahadewa on January 12, 2020
Posted in: Security Research. Tagged: conference, iceccs, Internet of Things, iot, publications, research, security papers, smart home, TSE. Leave a comment

Tech Star

Hi, I’am a security researcher at National University of Singapore. My research interests are:

  • Security Analysis of Smart Home Systems.
  • Formal Verification of Application-Layer Protocols.

Find me on:

ResearchGate: https://www.researchgate.net/profile/Kulani_Mahadewa

Publications:

Security Analysis of IoT Smart Home Systems:

  1. Scrutinizing Implementations of Smart Home Integrations.
    Kulani Mahadewa, Kailong Wang, Guangdong Bai, Ling Shi, Yan Liu, Jin Song Dong and Zhenkai Liang. IEEE Transactions on Software Engineering, TSE 2019 [paper][demo]
  2. HOMESCAN: Scrutinizing Implementations of Smart Home Integrations. Kulani Mahadewa, Kailong Wang, Guangdong Bai, Ling Shi, Jin Song Dong and Zhenkai Liang. 23rd International Conference on Engineering of Complex Computer Systems, ICECCS 2018, Melbourne, Australia, December 12-14, 2018[paper][pptx][demo]
  3. Security Analysis of Smart Home Implementations. Mahadewa K. (2018) In: Sun J., Sun M. (eds) Formal Methods and Software Engineering. ICFEM 2018. Lecture Notes in Computer Science, vol 11232. Springer, Cham

View original post

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Move Android User Installed Certificates to System CA Store

Posted by Kulani Mahadewa on December 2, 2019
Posted in: certificate pinning. Tagged: cacerts, cert, certificate pinning, pinningj. Leave a comment

Hi ! In android devices there are two CA stores i.e., system store and user store

  • system store path: /system/etc/security/cacerts
  • user store path: /data/misc/user/0/cacerts-added

Usually, the certificates such as FiddlerRoot cert that are installed by the user, are saved in the user store. Sometimes, the user installed certificates may not be trusted by the applications. Hence, you may want to move them into the system store.

You can follow the following steps to do that.

  • Check the user store
adb shell
cd /data/misc/user/0/cacerts-added
ls
  • Mount the system directory to enable read/write capability
adb shell
ja3gxx:/system/etc/security/cacerts # su
ja3gxx:/ # mount -o rw,remount /system
  • Move the required user installed Cert to system store
1|ja3gxx:/data/misc/user/0/cacerts-added # mv e5c3944b.0 /system/etc/security/cacerts 

Cheers ! 🙂

Share this:

  • Twitter
  • Facebook
  • LinkedIn

Like this:

Like Loading...

Posts navigation

← Older Entries
Newer Entries →
  • Welcome to Tech Star World… !

  • Blog Stats

    • 161,102 hits
  • Kulani Mahadewa

    Kulani Mahadewa

    I’m a Ph.D. candidate with the Department of Computer Science, National University of Singapore. I am interested in Python, Java, and Android developments. My research interests are IoT security and privacy, program analysis, fuzzing, and protocol verification. This blog was started in 2012 while I was working as an intern in software engineering. However, I recently started posting content about my research work and research interests. I hope you enjoy my blog posts.

    View Full Profile →

  • Enter your email address to follow this blog and receive notifications of new posts by email.

  • Advertisements
  • Archives

    • March 2021 (3)
    • October 2020 (1)
    • July 2020 (1)
    • May 2020 (2)
    • April 2020 (2)
    • March 2020 (6)
    • February 2020 (3)
    • January 2020 (1)
    • December 2019 (1)
    • June 2019 (1)
    • April 2019 (3)
    • March 2019 (6)
    • February 2019 (8)
    • January 2019 (3)
    • January 2018 (9)
    • November 2016 (1)
    • August 2016 (2)
    • May 2016 (2)
    • February 2016 (1)
    • January 2016 (2)
    • December 2015 (3)
    • September 2015 (1)
    • August 2015 (1)
    • May 2015 (2)
    • April 2015 (1)
    • March 2015 (6)
    • February 2015 (4)
    • January 2015 (7)
    • December 2014 (2)
    • October 2014 (5)
    • July 2014 (1)
    • June 2014 (1)
    • May 2014 (1)
    • April 2014 (3)
    • March 2014 (1)
    • September 2012 (1)
    • August 2012 (5)
    • July 2012 (9)
  • Recent Posts

    • Scanning & Enumeration: Step 1. Scanning Hosts
    • Tools for Passive Reconnaissance on Kali
    • Create a Simple Port Scanner on Kali Linux
    • Create Kali Linux Live USB stick with Etcher on Windows
    • System Execution Sequence – Part 1: BIOS/UEFI and Bootloader
    • Did you know that your Philips Hue bulb can be hijacked by a malicious hub in the neighborhood?
    • Why Smart Homes Require Integration Analysis?
    • Use mitmproxy to Capture Traffic on the Same Machine
    • Running PyCharm Traffic through Fiddler
    • Fix ERR_CONNECTION_TIMED_OUT error on Android with Fiddler Proxy
  • Advertisements
  • Topics

  • Tags

    ADB Android Android application android kernel android studio apk Apktool automate AVD barcode brunch classes.dex connection current position custom rom CyanogenMod decompile eclipse Eclipse IDE Emulator export Fiddler file explorer firmware flashing galaxys4 Genymotion GitHub google gps gps provider Gradle GT-19500 GT-I8150 https iceccs install internal databases iot java jd-gui Kali Kali 2020 Kali Linux Kali Linux 2020 Linux Maven mongoDB Octoplus box openwrt PyCharm python python3 qrcode reverse engineering root Samsung scanner security Server Key smart home source code sqlite ssl ssl certificate Testing tplink TSE Ubuntu Ubuntu 14.0 Vulnerability Analysis web security Windows xposed xposed module
  • Flag Counter
  • Advertisements
  • Relax …

  • Advertisements
    Advertisements
    Advertisements
    Advertisements
    Advertisements
    Advertisements
Blog at WordPress.com.
Tech Star
Blog at WordPress.com.
  • Follow Following
    • Tech Star
    • Join 39 other followers
    • Already have a WordPress.com account? Log in now.
    • Tech Star
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...
 

    %d bloggers like this: