Skip to content

Instantly share code, notes, and snippets.

View nikhilgeo's full-sized avatar
🏗️

Nikhil nikhilgeo

🏗️
View GitHub Profile
@nikhilgeo
nikhilgeo / Python2andPython3.md
Last active October 29, 2020 14:47
Working with python2 and python3 on macOS, Windows and Ubuntu

In macOS Catalina

python2 and python3 is already installed and python command on terminal points to python2

➜  ~ python --version
Python 2.7.16
➜  ~ python3 --version
Python 3.7.3

# Install virtualenv and virtualenvwrapper
sudo pip3 install virtualenv
# Jenkins pipeline script in declarative snytax to run bandit on git repo
# Needs git token added to the jenkins server in credential store
# Runs the job in a docker so jekins should have docker installed.
# Need a third-party library called jenkinsci-unstashParam-library to fetch the baseline json uploaded as job parameter.
properties([parameters(
[string(defaultValue: 'NameofScan', description: 'Use only alphabets, without space', name: 'SCAN_NAME', trim: true), string(defaultValue: 'git@abc.com:test/repo1.git', description: 'Enter the "Clone with SSH" url', name: 'REPO', trim: true),
string(defaultValue: 'dev', description: 'Select the release branch to run scans for particular release', name: 'Branch', trim: true),
choice(choices: ['YES', 'NO'], description: 'Run normal scan', name: 'NORMAL_SCAN'),
choice(choices: ['YES', 'NO'], description: 'Run baseline scan to hide previous found issues. If you choose YES you MUST upload baseline json file in next step.', name: 'BASELINE_SCAN'),
@nikhilgeo
nikhilgeo / AndroidCheetSheet.md
Last active May 8, 2020 15:27
AndroidCheetSheet

Objection commands

Patch apk

# objection patchapk --source my.apk

Get Objection shell

# objection explore
@nikhilgeo
nikhilgeo / CommandHandbook.md
Last active April 29, 2020 07:30
Commands Hand books

Linux

safe search for text in all files e.g search for clean_up( in all the files recursive.

$ grep -nre clean_up\( --exclude-dir={proc,dev,lib,sys}

search for file and don't get into other filesystems

$ find . -xdev -name file_name*
@nikhilgeo
nikhilgeo / gist:911b76faf3e965143128a7ccb74772c9
Last active July 26, 2020 13:03
Create CA and self-signed cert X.509 v3
1 Create CA
1.1 Create keys
openssl genrsa -out rootCA_key.key 2048
-des3 algorithm to encrypt the key and will require you to enter a password in order for the key file to be created.
1.2 Create Root CA cert with constraint CA = true
openssl req -x509 -new -nodes -key rootCA_key.key -sha256 -days 1024 -out rootCA_crt.pem -extensions v3_ca -reqexts v3_req -config /usr/local/etc/openssl/openssl.cnf
2 Create SSL cert