Skip to content

Instantly share code, notes, and snippets.

View cgimenes's full-sized avatar

Marcelo Gimenes de Oliveira cgimenes

View GitHub Profile
@cgimenes
cgimenes / debugcss.js
Created July 14, 2017 00:22
Debug CSS
[].forEach.call($$("*"),function(a){
a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)
})
@cgimenes
cgimenes / mysqlSniffer.sh
Last active July 21, 2017 13:19
tcpdump MySQL traffic
#!/bin/bash
intf=$1
port=$2
if [ -z "${intf}" ]; then
intf="eth0"
fi
if [ -z "${port}" ]; then
port="3306"
fi
@cgimenes
cgimenes / fileServer.sh
Created July 21, 2017 13:21
Python file server
python3 -m http.server
python2 -m SimpleHTTPServer
@cgimenes
cgimenes / sshWireshark.sh
Created July 22, 2017 14:55
wireshask over ssh
wireshark -k -i <(ssh sheep@46.101.153.159 "tshark -F pcap -w - -f 'not tcp port 22'")
@cgimenes
cgimenes / java.service
Created October 31, 2017 03:27
Deploy Java (/usr/lib/systemd/system/)
[Unit]
Description=Java Service
[Service]
User=nobody
# The configuration file application.properties should be here:
WorkingDirectory=/webapps
ExecStart=/usr/bin/java -Xmx256m -jar dmgco.jar
SuccessExitStatus=143
TimeoutStopSec=10
@cgimenes
cgimenes / nginx.conf
Created October 31, 2017 03:28
simple redirect by uri
location /api {
rewrite ^/api(.*) $1 break;
proxy_pass http://localhost:8084;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
@cgimenes
cgimenes / nmap.sh
Created May 17, 2018 17:13
Get all machines answering ICMP within an IP range
nmap -sn 192.168.0.0/24
@cgimenes
cgimenes / webscraper.rb
Last active February 14, 2019 02:01
Simple ruby web scraper
require 'httparty'
require 'nokogiri'
require 'cgi'
all_objects = []
('a'..'z').each do |letter|
page = 1
total_pages = 1
@cgimenes
cgimenes / webscraper.py
Created February 14, 2019 17:50
Simple python web scraper
import requests
from bs4 import BeautifulSoup
page = 0
urls = []
while True:
print(f"Page: {page}")
site = requests.get(f"https://pudim.com.br/?page={page}");
if site.status_code is 200:
content = BeautifulSoup(site.content, 'html.parser')
@cgimenes
cgimenes / smbver.sh
Last active February 15, 2019 19:38
Will listen for the first 7 packets of a null login and grab the SMB Version. by rewardone
#!/bin/sh
#Author: rewardone
#Description:
# Requires root or enough permissions to use tcpdump
# Will listen for the first 7 packets of a null login
# and grab the SMB Version
#Notes:
# Will sometimes not capture or will print multiple
# lines. May need to run a second time for success.
if [ -z $1 ]; then echo "Usage: ./smbver.sh RHOST {RPORT}" && exit; else rhost=$1; fi