Skip to content

Instantly share code, notes, and snippets.

View daviddev16's full-sized avatar
🤑
NullPointerException

David Duarte daviddev16

🤑
NullPointerException
View GitHub Profile
@spinpx
spinpx / tcp-reset.org
Last active April 9, 2025 05:49
TCP Reset attack in practice #Security #Network

TCP Reset attack

RESET is a flag in TCP packets to indicate that the conection is not longer working. So, if any of the two participants in a TCP connection send a packet contains such a RESET flag, the connection will be closed immediately.

Thus it can be use to attack TCP connections once the attacker can forge TCP packets from any of the two parties if he or she know their IPs, ports and the sequence number of current TCP connection.

The attack can be used to make certain users to fail to use certain network services based on TCP if we know the information above.

In practice, we should eavesdrop the victims’ communications to get their IPs, ports and the sequence number. You can do it by:

@jittagornp
jittagornp / ImageDominantColor.java
Last active August 14, 2025 12:27
for find dominant color of image
package com.pamarin.api.util;
import java.awt.image.BufferedImage;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
package br.com.appproblmatica;
import java.io.File;
import org.apache.log4j.Level;
import android.os.Environment;
import de.mindpipe.android.logging.log4j.LogConfigurator;
/**
@RicardoMurad
RicardoMurad / BuscaBinariaRecursiva.java
Last active December 27, 2022 14:31
Busca binária recursiva em java
package com.foo.bar;
import java.util.Arrays;
public class BuscaBinariaRecursiva {
public static void main(String[] args) {
int[] array = { 1, 8, 34, 67, 9, 6, 78, 12, 56, 41, 90 };
Arrays.sort(array);
System.out.println(Arrays.toString(array));
@jacksonfdam
jacksonfdam / gist:3000275
Created June 26, 2012 23:56
Regular Expressions List
//Regular Expressions List
//Short Tutorial
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc.
. // match any character except newline
x // match any instance of x
^x // match any character except x
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z
| // an OR operator - [x|y] will match an instance of x or y