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)
@ryanbekabe
ryanbekabe / recursivehash.php
Last active April 6, 2019 06:13
PHP Hash MD5 SHA256 File Recursive
<?php
//bekabeipa@gmail.com
if(isset($_GET['recursivehash']) AND isset($_GET['rest']))
{
//https://stackoverflow.com/questions/34190464/php-scandir-recursively
//https://stackoverflow.com/questions/15687363/php-access-global-variable-in-function
//global $varrest;
date_default_timezone_set('Asia/Jakarta');
$waktupengiriman=date("YmdHi");

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

#Python PE Analyst - DLLs of .exe
#16/04/2019 - bekabeipa@gmail.com
#DB MySQL structure: id;filename;md5;sha256;filesize;dump
import datetime
import time
import pefile
import mmap
import pymysql
pymysql.install_as_MySQLdb()
#Python PE Analyst - MD5-SHA256-Size-DLLs of .exe
#16/04/2019 - bekabeipa@gmail.com
#DB MySQL structure: id;filename;md5;sha256;filesize;dump
import datetime
import time
import pefile
import mmap
import hashlib
import pymysql
pymysql.install_as_MySQLdb()
#Python PE Analyst - MD5-SHA256-Size-PE Section-DLLs of .exe
#16/04/2019 - bekabeipa@gmail.com
#DB MySQL structure: id;filename;md5;sha256;filesize;dump;time
import datetime
import time
import pefile
import mmap
import hashlib
import pymysql
pymysql.install_as_MySQLdb()
@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"})