Skip to content

Instantly share code, notes, and snippets.

@timsonner
timsonner / decimal-converter.cpp
Last active March 7, 2023 23:30
C++. See binary, hex, octal, and decimal representations of a number.
// Include headers for classes...
#include <iostream>
#include <iomanip>
#include <string>
#include <bitset>
// Classes from different namespaces...
using std::cout;
using std::cin;
using std::endl;
@timsonner
timsonner / calculator.cpp
Created March 6, 2023 20:57
C++. Calculator. Usage of namespace and switch statements.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
// Define a top-level namespace for the calculator
namespace calculator {
// Define a nested namespace for the functions
namespace functions {
@timsonner
timsonner / Terminal.cs
Last active April 4, 2023 11:21
C#. Unity. System.Diagnostics library. Spawn system processes, TMP_InputField and TMP_Text. Mock Terminal.
using System.Diagnostics;
using System.IO;
using System.Threading;
using TMPro;
using UnityEngine;
public class Terminal : MonoBehaviour
{
public TMP_InputField inputField;
public TMP_Text outputText;
@timsonner
timsonner / BreakSSL.cs
Last active March 30, 2025 09:53
C#. Unity. Bypass SSL certificate verification of UnityWebRequest.
using UnityEngine;
using UnityEngine.Networking;
using TMPro;
using System.Collections;
public class NetworkRequest : MonoBehaviour
{
public TMP_InputField ipAddressField;
public TMP_Text resultText;
@timsonner
timsonner / random-circles.bas
Last active April 4, 2023 14:24
QBasic. Draw random circle at random coordinate with random radius and fill color.
SCREEN 12 ' Set screen mode to 640x480, 32-bit color
DO ' Infinite loop
RANDOMIZE TIMER ' initialize the random number generator
' Generate random circle properties
x = INT(RND * 641) ' Random x-coordinate 0 to 640
y = INT(RND * 481) ' Random y-coordinate 0 to 480
r = INT(RND * 101) ' Random radius 0 to 100
@timsonner
timsonner / check-hash.go
Created May 28, 2023 17:29
GoLang. Checks the hash of a file against an expected hash.
package main
import (
"crypto/md5"
"crypto/sha256"
"encoding/hex"
"flag"
"fmt"
"hash"
"io"
@timsonner
timsonner / scan-for-web-servers.go
Created June 3, 2023 00:24
GoLang. Scans a range of IPs for web servers running on ports 80, 8080, and 443.
package main
import (
"fmt"
"net"
"sync"
)
func main() {
var wg sync.WaitGroup
@timsonner
timsonner / go-gob-client.go
Last active July 13, 2023 22:52
GoLang. gob client. Connects and sends message to gob server.
// Client
package main
import (
"encoding/gob" // Package for encoding and decoding data
"fmt" // Package for formatted I/O
"net" // Package for network operations
)
@timsonner
timsonner / go-gob-server.go
Last active July 13, 2023 22:11
GoLang. gob server. Waits for connection from gob client.
// Server
package main
import (
"encoding/gob" // Package for encoding and decoding data
"fmt" // Package for formatted I/O
"net" // Package for network operations
)
@timsonner
timsonner / test-domain-creds.go
Last active June 4, 2023 19:02
GoLang. Tests a users credentials against a M$ domain. Pre-cursor to a password spraying script. Run this in Windows.
package main
import (
"fmt"
"syscall"
"unsafe"
)
const (
LOGON32_LOGON_NETWORK = 3