Skip to content

Instantly share code, notes, and snippets.

View davidlares's full-sized avatar
🎯
Focusing

David E Lares S davidlares

🎯
Focusing
View GitHub Profile
@davidlares
davidlares / NPM.md
Last active April 17, 2019 04:45
Node's NPM CLI commands and SemVer for software projects

NPM Commands

  1. npm init: NPM package manifest wizard
  2. npm whoami: check for the authenticated user
  3. npm adduser: add a user to the NPM session
  4. npm init --scope=<username>: add the auth user to the NPM .json manifest
  5. npm install <modulename>: installing a specific NPM module or package
  6. npm ls: dependencies listing (specific directory)
  7. npm test: run tests using the scripts located at the package.json file
@davidlares
davidlares / setup.sh
Last active September 2, 2019 01:56
Rails 5.2 full environment Setup for Debian/Ubuntu OS
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs yarn
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@davidlares
davidlares / ANDROID.md
Last active October 9, 2024 21:37
Backdooring Android Apps with FatRat and Metasploit Framework

Backdooring Android Apps with FatRat and Metasploit Framework

We have to set a point, mobile applications are a HUGE market today. Many entrepreneurs left behind web-based experiences for building disruptive mobile solutions. The battle of smart-phones remains today between IOs and Android. Both have pros and cons, they are designed and configured with default security settings that maybe not the ideal for non-experienced people.

This writing demonstrates a practical and simple example on how to generate a Reverse TCP back-door on an existing APK file.

This is a pretty common "Social Engineering Attack", and it's focused on generating a reverse TCP connection, where the attacker easily can generate shell access to your Android phone in the time you are using the infected application and do some harmful stuff or access your private information without any concern.

And when a mean “Social Engineering Attacks” is because the way it propagates, I’ll explain in a bit how are the

@davidlares
davidlares / disallow.py
Created August 8, 2019 02:37
Python script for checking robots.txt's 'Disallow' property presence with urllib2
#!/usr/bin/python
import urllib2
class DisallowPresent(Exception):
def __init__(self, path) :
self.disallowed = path
def __str__(self) :
@davidlares
davidlares / tcpClient.py
Last active September 2, 2019 01:51
Client-Server programming using sockets (Python built-in library)
#!/usr/bin/python
# socket network module (methods and APIs)
import socket
import sys
# creating a TCP Socket -> listening to an specific port
# AF_INET -> address family , SOCK_STREAM -> Kind of socket (required)
tcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@davidlares
davidlares / rawInjection.py
Last active January 19, 2024 20:46
Raw Sockets with Python: Sniffing and network packet injections.
#!/usr/bin/python
import socket
import struct
# creating a rawSocket for communications
# PF_SOCKET (packet interface), SOCK_RAW (Raw socket) - htons (protocol) 0x08000 = IP Protocol
rawSocket = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.htons(0x0800))
# deciding interface - packet sniffing and then injection
@davidlares
davidlares / data.sh
Last active September 11, 2019 19:56
Terraform's Digital Ocean instance configuration files with an Nginx Server
apt-get update && apt-get install nginx -y
@davidlares
davidlares / 0-YAML.md
Last active October 6, 2023 13:56
A basic YAML syntax review concept and implementation.

A basic YAML syntax review concepts

In a short note, YAML files represent configuration data in most of the times. According to Wikipedia: YAML "is a human-friendly data serialization standard for all programming languages". Basically we can say that is similar to XML and JSON notation and it is pretty used on DevOps activities for IaC configurations and for sharing data across multiple applications.

Features

  1. key-Value Pair: there's nothing more to say to this. You have a "Key" that acts as an Identification for value itself.

    Here's an example:

@davidlares
davidlares / playbook-copyfile.yaml
Last active October 18, 2022 04:47
A simple Ansible playbook script for copying files to remote machines
name: Copy file to target servers
hosts: all
tasks:
- name: Copy file
copy:
src: /tmp/test-file.txt
dest: /etc/foo.conf
@davidlares
davidlares / hosts
Last active January 2, 2020 19:41
Digital Ocean's basic droplet setup with Ansible
[server]
Here goes your Droplet IP
[server:vars]
ansible_user=root
ansible_ssh_private_key_file=~/.ssh/id_rsa.pub