Skip to content

Instantly share code, notes, and snippets.

@Tandrial
Tandrial / THM-fortress.md
Last active September 11, 2021 09:18
WriteUps for THM/HTB boxes

TryHackMe - Fortress [HARD][MEDIUM]

Fortress is a Linux based Box on TryHackMe. Due to unintended issues with the configuration of the box the difficulty was decreased from HARD to MEDIUM, see Unintended Ways for some methods to get root on the box.

The description of the box suggests to add two hosts:

10.10.222.252   fortress

10.10.222.252 temple.fortress

@Tandrial
Tandrial / THM.md
Last active July 17, 2021 18:59
Pentest Training
@Tandrial
Tandrial / getHash.py
Created October 21, 2018 19:36
Redeye Crypto
#!/usr/bin/python
from Crypto.Util.number import *
from hashlib import md5
#redeye{flag}
def conv(d):
return bytes_to_long(d)
def add_padd(FLAG,H):
x = 0
@Tandrial
Tandrial / iterTools.kt
Last active November 26, 2023 08:12
Pythons iterTools in Kotlin
/*
* Copyright (c) 2019 Michael Krane
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@Tandrial
Tandrial / CourseUtils.java
Last active September 29, 2016 19:47
[Java] Using a nested for loop or nested while loop fails to iterate through all elements REFACTOR
public boolean detectConflict(Course aCourse) { //FIXME
boolean foundConflict = false;
for (Course existingCourse : schedule) {
for (Integer timeofNewCourse : aCourse.getSchedule()) {
for (Integer timeofExistingCourse : existingCourse.getSchedule()) {
if (timeofExistingCourse.equals(timeofNewCourse)) {
System.out.print(String.format("%s%d course cannot be added to %s's schedule. ",
aCourse.getDepartment().getDepartmentName(),
aCourse.getCourseNumber(),
this.getName()));
@Tandrial
Tandrial / StdDraw.java
Created September 26, 2016 12:43
3D mathematics - Rotation at a point in time
/******************************************************************************
* Compilation: javac StdDraw.java
* Execution: java StdDraw
* Dependencies: none
*
* Standard drawing library. This class provides a basic capability for
* creating drawings with your programs. It uses a simple graphics model that
* allows you to create drawings consisting of points, lines, and curves
* in a window on your computer and to save the drawings to a file.
*
@Tandrial
Tandrial / DivRules.java
Last active September 21, 2016 15:29
Divisibility rule
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class DivRules {
public static boolean isDivBy(int divisor, long num) {
assert (divisor > 0 && divisor <= 10);
if (num == 0)
return true;
try {
@Tandrial
Tandrial / LogicEval.java
Last active October 7, 2015 19:31
LogicEvaluator based on Dijkstra's 2 Stack Eval
import java.util.Scanner;
import java.util.Stack;
public class LogicEval {
public final static String operands = "!&| ";
public final static String numbers = "TF";
public final static String validToken = operands + numbers;
public static boolean eval(String expression) {
Stack<Character> values = new Stack<Character>();