Skip to content

Instantly share code, notes, and snippets.

View Ricky-Wilson's full-sized avatar
💭
Writing an ADB Lib

Ricky Wilson Ricky-Wilson

💭
Writing an ADB Lib
View GitHub Profile
import socket
import urlparse
CONNECTION_TIMEOUT = 5
CHUNK_SIZE = 1024
HTTP_VERSION = 1.0
CRLF = "\r\n\r\n"
socket.setdefaulttimeout(CONNECTION_TIMEOUT)
@Ricky-Wilson
Ricky-Wilson / SeekAndDestroy.py
Created January 8, 2020 22:50
Find and exploit netgear routers
import nmap
# initialize the port scanner
nmScan = nmap.PortScanner()
# scan localhost for ports in range 21-443
nmScan.scan('127.0.0.1', '21-443')
# run a loop to print all the found result about the ports
for host in nmScan.all_hosts():
print('Host : %s (%s)' % (host, nmScan[host].hostname()))
@Ricky-Wilson
Ricky-Wilson / cpfind.sh
Created March 20, 2020 06:38
Find files that match a pattern and copy them
#!/bin/bash
while getopts "r:p:o:" flag; do
case "$flag" in
# Where to stert searching.
r) ROOT=$OPTARG;;
# The pattern.
p) NAME=$OPTARG;;
# where to store the findings.
alias x="chmod +x"
alias install="sudo apt-get update; sudo apt install -y "
alias update="sudo apt-get update"
alias search="apt search"
alias rm="rm -rf"
alias nano="nano -m"
alias wc="wc -l"
alias lll="ls -R **"
alias du="du -sh"
@Ricky-Wilson
Ricky-Wilson / fix-names.sh
Created March 20, 2020 06:59
Replace white space in file names
#!/bin/bash
find $1 -name "*.apk" -type f -print0 | \
while read -d $'\0' f
do mv -v "$f" "${f// /-}"
done
@Ricky-Wilson
Ricky-Wilson / mirror.sh
Created March 20, 2020 07:00
Mirror a website
#!/bin/bash
wget \
--mirror \
--convert-links \
--adjust-extension \
--page-requisites \
-e robots=off \
--html-extension \
-U Mozilla \
@Ricky-Wilson
Ricky-Wilson / random-mac.sh
Created March 20, 2020 07:01
Generate a random MAC address
#!/bin/bash
MAC=`(date; cat /proc/interrupts) | \
md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "$MAC"
@Ricky-Wilson
Ricky-Wilson / backup.sh
Last active March 20, 2020 07:09
Create a full backup of an android device using ADB
#!/bin/bash
adb backup -apk -shared -all -f $1
@Ricky-Wilson
Ricky-Wilson / AdbCommands
Created March 22, 2020 03:45 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@Ricky-Wilson
Ricky-Wilson / adbwifi.sh
Created March 24, 2020 05:00
Android ADB Helpers
#!/bin/sh
ip=$( adb shell ifconfig wlan0 | cut -f 3 -d ' ' )
port=5555
adb tcpip $port
adb connect $ip:$port