Skip to content

Instantly share code, notes, and snippets.

View ryanbekabe's full-sized avatar
💭
Cuckoo Sandbox for identify Malware, JupyterLab for Machine Learning

ryanbekabe

💭
Cuckoo Sandbox for identify Malware, JupyterLab for Machine Learning
View GitHub Profile
@ryanbekabe
ryanbekabe / unzip_all.py
Created March 15, 2019 02:12 — forked from kalkulus/unzip_all.py
PYTHON: unzip all files in a directory
#!/usr/bin/python
import os, zipfile
for filename in os.listdir("."):
if filename.endswith(".zip"):
print filename
name = os.path.splitext(os.path.basename(filename))[0]
if not os.path.isdir(name):
try:
zip = zipfile.ZipFile(filename)

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@ryanbekabe
ryanbekabe / start-video-stream-w-opencv.py
Created May 23, 2019 09:31 — forked from keithweaver/start-video-stream-w-opencv.py
Stream video in Python using OpenCV
# For more info: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html
import cv2
import numpy as np
# Playing video from file:
# cap = cv2.VideoCapture('vtest.avi')
# Capturing video from webcam:
cap = cv2.VideoCapture(0)
currentFrame = 0
@ryanbekabe
ryanbekabe / port-forwarding.py
Created May 28, 2019 02:53 — forked from WangYihang/port-forwarding.py
port forwarding via python socket
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tcp Port Forwarding (Reverse Proxy)
# Author : WangYihang <wangyihanger@gmail.com>
import socket
import threading
import sys
@ryanbekabe
ryanbekabe / ProceduralVsOop.php
Created June 21, 2019 00:53 — forked from sycue/ProceduralVsOop.php
PHP Procedural vs. Object-Oriented Programming (OOP)
<?php
// Procedural
function example_new() {
return array(
'vars' => array()
);
}
function example_set($example, $name, $value) {
$example['vars'][$name] = $value;
@ryanbekabe
ryanbekabe / mongoDB.py
Created June 22, 2019 03:44 — forked from cjgiridhar/mongoDB.py
CRUD for MongoDB with Pymongo
import pymongo
from pymongo import Connection
conn = Connection()
db = conn['myDB']
collection = db['language']
#Creating a collection
db.language.insert({"id": "1", "name": "C", "grade":"Boring"})
db.language.insert({"id": "2", "name":"Python", "grade":"Interesting"})
@ryanbekabe
ryanbekabe / mongo-struc.js
Created June 22, 2019 10:11 — forked from hkasera/mongo-struc.js
A script for mongo shell to get the collection structure.
var conn = new Mongo();
db = conn.getDB(<DB_NAME>);
var cursor = db.<COLLECTION>.find();
var items = [];
items = cursor.toArray();
var dbstruc = {};
for (var i = 0; i < items.length; ++i) {
var target = items[i];
getKP(target,dbstruc);
}
@ryanbekabe
ryanbekabe / client.py
Created June 29, 2019 23:43 — forked from kittinan/client.py
Python OpenCV webcam send image frame over socket
import cv2
import io
import socket
import struct
import time
import pickle
import zlib
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('192.168.1.124', 8485))
@ryanbekabe
ryanbekabe / client.py
Created July 3, 2019 03:27 — forked from yoavram/client.py
Example of uploading binary files programmatically in python, including both client and server code. Client implemented with the requests library and the server is implemented with the flask library.
import requests
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print r.text
@ryanbekabe
ryanbekabe / flaskaudiostream.py
Created August 5, 2019 03:36 — forked from hosackm/flaskaudiostream.py
Flask streaming an audio file
from flask import Flask, Response
app = Flask(__name__)
@app.route("/wav")
def streamwav():
def generate():
with open("signals/song.wav", "rb") as fwav:
data = fwav.read(1024)