Skip to content

Instantly share code, notes, and snippets.

@c3l3si4n
c3l3si4n / Remote_IoT_Service_SpiderLabs_2020.py
Last active August 9, 2020 00:54
Remote IoT Service @ SpiderLabsCTF 2020 writeup
"""
First part: Leaking password
"""
import paramiko
from time import sleep
import sys
from pwn import p64
def test_password(password):
@c3l3si4n
c3l3si4n / cpf.java
Last active March 22, 2020 00:36
Java - algoritmo de verificação de cpf | cpf verification and validation algorithm
public class Cpf {
private static final int[] cpfWeight = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2}; // pesos do cpf, para uso no algoritmo de digito verificador
private static int calculateVerifierDigit(String input, int[] weight) { // funcao de digito verificador, recebe a mensagem a ser verificada e seu peso
int sum = 0; // declaracao da soma
for (int i = input.length() - 1, digit; i >= 0; i--) {
digit = Integer.parseInt(input.substring(i, i + 1)); // itera por cada digito do input
sum += digit * weight[weight.length - input.length() + index]; // 10 - 11 + index
}
sum = 11 - sum % 11; // pega o "módulo 11" da soma
return sum > 9 ? 0 : sum; // se a soma for 10, retornar 0.
@Repository
public interface customerRepository extends JpaRepository<Customer, Long>{
}
@Repository
public interface productsRepository extends JpaRepository<Products, Long>{
}
@Entity
public class Products {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private String name;
@Unique
private String nickname;
private BigDecimal price;
@Entity
public class Customer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private String firstName;
private String lastName;
@Unique
private String identityNumber;
@c3l3si4n
c3l3si4n / PJBank.txt
Last active June 10, 2019 18:35
PJBank
curl --location --request POST "https://sandbox.pjbank.com.br/contadigital/ac42a32f416cebbde7ee61e16020ba7f4b955bbe" \
--header "X-CHAVE-CONTA: 8f450e24c6ecfdd2e905b489c401ac7105550dbd" \
--header "Content-Type: application/json" \
--data "{
\"valor\" : \"900.00\"
}"