Skip to content

Instantly share code, notes, and snippets.

View aravindkumarsvg's full-sized avatar

Aravind Kumar SVG aravindkumarsvg

View GitHub Profile
@aravindkumarsvg
aravindkumarsvg / shell_stabilization.md
Last active May 27, 2024 10:31
Stabilize a reverse shell for linux target

Pre-requisites

  • Get the reverse shell in netcat
  • check python support in the target system
which python

Shell Stablization

  1. If your terminal is using zsh, then you need to switch to bash
@aravindkumarsvg
aravindkumarsvg / adb_caller.sh
Created August 10, 2020 05:41
Calling a phone number repeatedly using ADB
#!/bin/bash
# Enabling ADB over network
# adb kill-server && adb start-server # restart adb server
# adb tcpip 5555 # start adb service
# adb connect <phone_id> # connect to the device
# For enabling loudspeaker and cut the call, make sure to change it based on your phone screen
# Ref for getting touch coordinates: https://android.stackexchange.com/questions/164295/how-can-i-see-the-pointer-location-and-simulate-it
@aravindkumarsvg
aravindkumarsvg / Vagrantfile
Last active September 13, 2020 14:27
Vagrantfile for Apache Spark setup in Ubuntu Xenial 16
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
# Spark Jobs history
config.vm.network "forwarded_port", guest: 4040, host: 4040
# Spark Master
config.vm.network "forwarded_port", guest: 8080, host: 8080
@aravindkumarsvg
aravindkumarsvg / npm-audit_report-generation.sh
Last active December 9, 2021 18:31
Generates npm audit report for multiple directories and searching for multiple package.json inside those given directories
#!/bin/bash
# Global variable declarations
format="plain"
directories=()
current_directory=`pwd`
report_directory="${current_directory}/report/"
fresh_report_directory="0"
# usage
@aravindkumarsvg
aravindkumarsvg / get-swap_using_process.sh
Created March 29, 2018 10:39
Gets the processes which is using the swap space
#!/bin/bash
# Loops through the proc directory
for processId in `ls /proc/`; do
# Checks for the status file for a process
if [[ $processId =~ ^[0-9]+$ && -r "/proc/${processId}/status" ]]; then
# Gets the swap space usage for the process
swapUsage=`grep VmSwap "/proc/${processId}/status" | awk '{print $2}'`
if [[ ! -z $swapUsage && $swapUsage > 0 ]]; then
# Gets the process name
# utility function which is used to create and change
# to the given directory name
# Add to the .bashrc file
# usage:
# mkcd directory_name
mkcd() {
local directory_name="${1}"
if [ -z $directory_name ]
then
echo "Pass the directory name as the argument!!!" > /dev/stderr
@aravindkumarsvg
aravindkumarsvg / delete-dupfiles.sh
Last active July 13, 2018 18:49
Replaces the duplicate files with the hard link to the file which comes first in the lexical sorting
#!/bin/bash
#################################################################################
# #
# - Removes the duplicate normal files from the given directory and makes them #
# as the hard link for the non removed file. #
# - The non removed file is the one which comes first in the lexical ordering #
# - Script uses fdupes utility to find out the duplicate files #
# #
# = Usage: bash script.sh duplicate_files_folder #
@aravindkumarsvg
aravindkumarsvg / restart-network_manager.sh
Last active August 12, 2017 10:21
Automatically restart network manager in case of connection timeouts due to wifi problems
#!/bin/bash
#############################################################
#
# Restarts the Network Manager automatically when the
# Network disconnects, because of wifi connectivity problem
#
#############################################################
# Function which checks for the root user execution
@aravindkumarsvg
aravindkumarsvg / check-network.sh
Created July 20, 2017 15:00
Checks for the Network connection
#!/bin/bash
########################################################
#
# Checks for Network connection by using Ping utility
#
########################################################
# Main flow of Execution
main() {
@aravindkumarsvg
aravindkumarsvg / docker_image-remover.sh
Created July 14, 2017 16:04
Removes the Docker images and also able to add some exclusions for image deletion
#!/bin/bash
#================================================
# Removes the Docker images based on conditions
#================================================
# Variable Declaration
declare -A image_exclusion=( ["node"]="8-alpine" ["jenkins"]="latest" )
# Checks whether image has been excluded or not