Skip to content

Instantly share code, notes, and snippets.

View smellslikeml's full-sized avatar
👃
You smell that?

smellslikeml smellslikeml

👃
You smell that?
View GitHub Profile
@smellslikeml
smellslikeml / tor_proxy_requests.py
Created October 21, 2018 16:30
tor_proxy_file_request
import requests
from urllib.request import urlretrieve, ProxyHandler, build_opener, install_opener
def check_ip():
current_ip = requests.get(
url='http://icanhazip.com/',
proxies=socks_proxy,
verify=False
)
return current_ip.text
@smellslikeml
smellslikeml / bash_get_ip.sh
Created October 21, 2018 16:33
bash_get_ip
curl -s checkip.dyndns.org | sed 's#.*Address: \(.*\)</b.*#\1#'
wget -qO - ipv4bot.whatismyipaddress.com
curl 'https://api.ipify.org?format=txt'
@smellslikeml
smellslikeml / encrypt_decrypt.py
Created October 21, 2018 16:42
file_encryption
#!/usr/bin/env python
import os
import fnmatch
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
from Crypto.Cipher import AES, PKCS1_OAEP
def encrypt_file(data, enc_filename):
try:
@smellslikeml
smellslikeml / keygen.py
Created October 21, 2018 16:45
Generate RSA keys
#!/usr/bin/env python
from Crypto.PublicKey import RSA
new_key = RSA.generate(2048, e=65537)
public_key = new_key.publickey().exportKey('PEM')
private_key = new_key.exportKey('PEM')
print(public_key)
print(private_key)
@smellslikeml
smellslikeml / linuxprivchecker.py
Created October 21, 2018 16:56
Mike Czumak's Linux Privilege Escalation Check Script
#!/usr/env python2
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@smellslikeml
smellslikeml / screenshot.py
Created October 21, 2018 17:52
screenshot with Qt5
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
@smellslikeml
smellslikeml / tweet_logger.py
Created October 22, 2018 17:28
tweepy_scraper
#!/usr/bin/env python
import sys
from datetime import datetime
import os
import json
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
consumer_key = os.environ['CONSUMER_KEY']
@smellslikeml
smellslikeml / tweepy_streamer.py
Created October 22, 2018 17:30
tweepy_stream
#!/usr/bin/env python
import os
import sys
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
import json
import socket
consumer_key = os.environ['CONSUMER_KEY']
@smellslikeml
smellslikeml / bte_rssi.py
Created October 22, 2018 18:07
query for RSSI signal strength with btmgmt
#!/usr/bin/env python
import subprocess
def rssi_vals(addr):
try:
p = subprocess.Popen('sudo btmgmt find | grep {}'.format(addr), stdout=subprocess.PIPE, shell=True)
a, b = p.communicate()
read_lst = []
for reading in str(a).split('\\n')[:-1]:
@smellslikeml
smellslikeml / w2v_tSNE_plot.py
Last active October 25, 2018 01:17
ntlk, gensim word2vec, sklean t-SNE embedding, matplotlib
#!/usr/bin/python
import sys
import re
import string
from gensim.models import Word2Vec, Phrases
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from itertools import islice