Category Archives: Uncategorized

Uncategorized but very important

Windows Subsystem for Linux. Accessing files.

Linux distributions uses the Filesystem Hierarchy Standard (FHS) which defines the universal directory structure (like home, usr, bin, tmp and so on) and directory contents. To access to Windows c: drive from install WSL Linux distribution use /mnt/c directory. Let us create c:\Temp\ubuntu.txt file from WSL ubuntu 24.04 distribution: C:\>wsl -d Ubuntu-24.04 smoke29@MSI:/mnt/c$ sudo echo… Read More »

Create and Deploy Smart Contract

The first post “Installing Ethereum Development tools: geth and truffle on Ubuntu 22” was about preparation of development and testing environment to create first simple smart contract application. Now let us create application itself. Again, everything on Ubuntu 22 machine. Create working directory and initialize new and empty Ethereum project: # mkdir -p /workspace/contract1 #… Read More »

ChatGTP client in c#

It is continuation of previous post “Ask ChatGPT to answer a question using curl command” but request to ChatGPT server is sent by c# code. The authentication secret key in example below has been revoked, so if you want copy-paste the code you need to use your own OpenAI authentication secret key or request new… Read More »

Ask ChatGPT to answer a question using curl command.

It is my beginning trail of ChatGPT (Generative pre-trained transformer) from OpenAI. It is possible to chat with ChatGPT there: https://chat.openai.com. However the main goal of this post to ask ChatGPT by sending raw HTTP request. To get access to OpenAI API you need to generate security key using this link: https://platform.openai.com/account/api-keys. The security key… Read More »

ssh Vulnerability DoS test

This test was created when I worked with CVE-2002-20001 vulnerability. The vulnerability is about diffie-hellman-group-exchange-sha256 key exchange algorithm with high computational complexity which is using long exponents that arguably make certain calculations unnecessarily expensive. To test the issue I created small bash script ddosssh.sh to simulate DDoS attack on ssh server using different key exchange… Read More »

How to Replace a Substring in a String in c++ code

A bit away for from security themes just simple c++ coding related to string processing, changing substring in char array. Recently I had a task to hide some private info in log replacing it with asterisks. It is the code, I tried to do it the new substituted substring may longer or shorter then initial… Read More »

Golang. UTF-8 String from unsafe pointer

It is a continuation of previous post “Compare storage of string in memory for c++ and golang using dgb” where gbg debugger was used to read characters defined in string variable directly from memory. The example below shows how to read string bytes from memory using unsafe pointer. String encoding is UTF-8, and it contains… Read More »

Calculate SHA-256 programmatically (c++ and golang)

SHA-256 is 256 bit hash value calculated by SHA-2 (Secure Hash Algorithm 2). SHA-256 is used in some of the multiple well known authentication and encryption protocols, including SSL, TLS, IPsec, SSH, and PGP. Also it is used for secure password hashing and cryptocurrency transaction verification. Here is c++ example how to calculate SHA-256 has… Read More »