Skip to content

Instantly share code, notes, and snippets.

View cwgreene's full-sized avatar

Chris Greene cwgreene

  • Exploding at the origin
View GitHub Profile
-_DT_INIT - __gmon_start__()
-entry
- __libc_start_main(FUN_001013af,in_stack_00000000,&stack0x00000008,&LAB_00101530,&DAT_001015a0,param_3,auStack8)
-FUN_00100b80
-_FINI_0
- __cxa_finalize(PTR_LOOP_00302008)
- FUN_00100b80()
-_INIT_0
-FUN_00100c5a
- puts("Welcome to the command system")
4 [(0.9975212116554136, 217), (0.9976284071334284, 218), (0.9977563426549008, 219), (0.9978162881914118, 216), (0.9996343894298404, 128), (0.99963778150841, 141), (0.9997083692210671, 23), (0.9997137984345786, 59), (0.9997342715268968, 115), (0.9997351012764296, 43)]
5 [(0.9995775139325738, 157), (0.9996008253283728, 13), (0.9996532007491311, 105), (0.9996704603227529, 29), (0.9996889799997735, 186), (0.9997123305369241, 200), (0.9997154731235033, 44), (0.9997156531995951, 131), (0.9997253060382593, 119), (0.9997274171819115, 95)]
12 [(0.9996212998508183, 162), (0.9996477229820526, 124), (0.9996805000057345, 62), (0.9996908718174604, 29), (0.9996954742964997, 55), (0.9996975570379236, 147), (0.999702330793057, 118), (0.9997088951840694, 140), (0.9997297575083467, 72), (0.9997329143239089, 106)]
13 [(0.9995998189813694, 73), (0.9996067223459536, 5), (0.9996155937677557, 248), (0.9996179744655996, 39), (0.9996415758509715, 211), (0.9996747156456098, 233), (0.999675148895007, 213), (0.9996900998703226, 132), (0.
# Let's set the terminal to terminate scripts on
# the first error of a script
PS /home/chris/test/stderrtest> $ErrorActionPreference='Stop'
# So, let's take a look at a simple c program.
PS /home/chris/test/stderrtest> cat ./test.c
#include <stdio.h>
int main() {
fprintf(stderr, "message 1\n");
alert('hi');
@cwgreene
cwgreene / a-gets.3-1993.md
Last active January 27, 2020 00:22
Historical man pages of `gets`

DESCRIPTION

gets reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF, which it replaces with '\0'. No check for buffer overrun is performed (see BUGS below).

BUGS

Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead.

ulong hxp2019__check__h578f31d490e10a31(uint param_1,uint param_2)
{
long lVar1;
int iVar2;
uint uVar3;
uint uVar4;
int iVar5;
undefined8 *puVar6;
long in_FS_OFFSET;

So, we take a look at the binary and do some basic decompilation.

void main(void)
{
  uint switch_00;
  int switch;
  char *buf;
  undefined8 uVar1;
  FILE *stream;
0 1 
2 
3 
4 
5 
6 
7 
8 
9
10
@cwgreene
cwgreene / tcash.md
Last active September 26, 2021 04:48

Tcash

Problem description

Upon connecting to the server we are presented with the following options

I heard that tcache is pretty bad, but disabling it is pretty annoying.
But chunks that're greater than 0x408 don't go in tcache :)

Faultbox

We are greeted upon connecting to the server with the following:

====================================
            fault box
====================================
1. print encrypted flag
2. print encrypted fake flag