Skip to content

Instantly share code, notes, and snippets.

View leha-bot's full-sized avatar
🐝
"Then" (c). I may be slow to respond, sorry about this.

Alex leha-bot

🐝
"Then" (c). I may be slow to respond, sorry about this.
View GitHub Profile
@brenopolanski
brenopolanski / docker-cp-container-host.md
Created November 2, 2017 17:37
Docker - copy file from container to host

In order to copy a file from a container to the host, you can use the command:

docker cp <containerId>:/file/path/within/container /host/path/target
HMODULE hUser = GetModuleHandleA("user32.dll");
if (hUser)
{
pfnSetWindowCompositionAttribute setWindowCompositionAttribute = (pfnSetWindowCompositionAttribute)GetProcAddress(hUser, "SetWindowCompositionAttribute");
if (setWindowCompositionAttribute)
{
ACCENT_POLICY accent = { ACCENT_ENABLE_BLURBEHIND, 0, 0, 0 };
WINDOWCOMPOSITIONATTRIBDATA data;
data.Attrib = WCA_ACCENT_POLICY;
data.pvData = &accent;

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

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active April 12, 2025 06:26
Hyperlinks in Terminal Emulators
@Newlifer
Newlifer / .vimrc
Created April 21, 2017 09:26
.vimrc
set nocompatible
set backspace=indent,eol,start
" improve perfomance
set lazyredraw
set synmaxcol=256
syntax sync minlines=256
set fileencodings=ucs-bom,utf-8,default,latin1
set fileencoding=utf-8
@shelomentsevd
shelomentsevd / exceptions.cpp
Last active February 11, 2017 19:59
Short note about exceptions in C++
// C++ exceptions short-note
// Example
#include <exception>
class MyException: public std::exception
{
virtual const char * what() const throw()
{
return "Exception's description";
}
};
@antelle
antelle / invisibles.txt
Last active April 6, 2020 09:21
Invisibles
U+2060 foo⁠bar WORD JOINER
U+2061 foo⁡bar FUNCTION APPLICATION
U+2062 foo⁢bar INVISIBLE TIMES
U+2063 foo⁣bar INVISIBLE SEPARATOR
U+180E foo᠎bar MONGOLIAN VOWEL SEPARATOR
U+200B foo​bar ZERO WIDTH SPACE
U+200C foo€€‌bar ZERO WIDTH NON-JOINER
U+200D foo‍bar ZERO WIDTH JOINER
U+FEFF foobar ZERO WIDTH NO-BREAK SPACE
@silgon
silgon / boost_log_example.cpp
Created December 10, 2015 23:09
Boost Log example with channel and file generation.
// compile with
// g++ -std=c++11 test_log_default.cpp -DBOOST_LOG_DYN_LINK -lboost_log -lboost_thread -lpthread -lboost_system
#include <iostream>
#include <boost/log/expressions.hpp>
#include <boost/log/sources/severity_channel_logger.hpp>
#include <boost/log/sources/record_ostream.hpp>
#include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/sinks.hpp>
@sim642
sim642 / boost-windows.md
Last active November 27, 2024 22:54
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder for installation, e.g. C:\Program Files\boost.

GCC setup

  1. Open Command Prompt.
@tkaczenko
tkaczenko / main.cpp
Last active September 27, 2021 06:49
Чтение .wav файла (С++ / СPP) / Reading .wav file (C++ / CPP)
#include <iostream>
#include <cstdio>
#include <cmath>
#include "string.h"
#include "mem.h"
//Wav Header
struct wav_header_t
{
char chunkID[4]; //"RIFF" = 0x46464952