Skip to content

Instantly share code, notes, and snippets.

@gitpraetorianlabs
gitpraetorianlabs / gist:cf58e409a5b2d2a1c2ec
Created August 20, 2014 20:18
Basic starter code needed to retrieve and solve Praetorian crypto challenges
import requests
try: input = raw_input
except NameError: pass
# Global values
base = "http://crypto.praetorian.com/{}"
email = input("Enter your email address: ")
auth_token = None
# Used for authentication
@gitpraetorianlabs
gitpraetorianlabs / sample_mastermind.py
Last active February 10, 2016 17:07
Mastermind sample code
import requests, json, sys
if sys.version_info < (3,0):
sys.exit('Python version < 3.0 does not support modern TLS versions. You will have trouble connecting to our API using Python 2.X.')
email = 'careers@praetorian.com' # Change this!
r = requests.post('https://mastermind.praetorian.com/api-auth-token/', data={'email':email})
r.json()
# > {'Auth-Token': 'AUTH_TOKEN'}
headers = r.json()
headers['Content-Type'] = 'application/json'
@gitpraetorianlabs
gitpraetorianlabs / gist:32309dd5a2be73ef2230
Last active September 14, 2015 13:10
SMB GPP AUX Enumeration
msf > use auxiliary/scanner/smb/smb_enum_gpp
msf auxiliary(smb_enum_gpp) > set SMBUSER jsmith
SMBUSER => jsmith
msf auxiliary(smb_enum_gpp) > set SMBPASS Password1!
SMBPASS => Password1!
msf auxiliary(smb_enum_gpp) > set SMBDOMAIN ACME
SMBDOMAIN => ACME
msf auxiliary(smb_enum_gpp) > set RHOSTS 10.10.10.10
RHOSTS => 10.10.10.10
msf auxiliary(smb_enum_gpp) > show options
@gitpraetorianlabs
gitpraetorianlabs / base.rb
Last active November 12, 2015 19:17
ROTA Challenge Ruby starter code
require 'rest-client'
require 'pp'
require 'json'
class RotaAPI
def initialize
@base_url = 'https://rota.praetorian.com/rota/service/play.php'
res = RestClient.get("#{@base_url}?request=new")
@cookies = res.cookies
@gitpraetorianlabs
gitpraetorianlabs / machine_server.py
Last active February 24, 2017 00:01
Example code to communicate with "Machine Learning Binaries" technical challenge.
import requests
import logging
import base64
import time
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
class Server(object):
url = 'https://mlb.praetorian.com'
#include <stdio.h>
// Function that calls another function with some arguments.
// This will be below the max amount of a(x) registers.
// by b1ack0wl
void main(){
int a = 0;
int b = 0x41;
=-------------------------------=
| [0x4003b0] |
| main: | // Disassembling the main() function
| (fcn) sym.main 68 |
| addiu sp, sp, -0x28 | // Adjust stack by 40 bytes
| sw ra, 0x24(sp) | // Return address is saved onto the Stack
| sw fp, 0x20(sp) | // Frame pointer is saved onto the Stack
| move fp, sp | // Move stack pointer to the frame pointer
| sw zero, 0x18(fp) | // Initialize int a to 0
| addiu v0, zero, 0x41 | // Add 0x41 to zero and store the result into $v0
=------------------------------=
| [0x4003f4] |
| (fcn) sym.pass_args_to_me 52 | // Disassembling the pass_args_to_me function
| addiu sp, sp, -8 | // Adjust stack address by 8 bytes (int = 4 bytes)
| sw fp, 4(sp) | // Save Frame pointer Address
| move fp, sp | // Move SP to FP (This is behavior is an indication that we&#39;re dealing with local variables)
| sw a0, 8(fp) | // Save int a into the frame pointer
| sw a1, 0xc(fp) | // Save int b into the frame pointer.
| lw v1, 8(fp) | // Load int a into $v1
| lw v0, 0xc(fp) | // Load int b into $v0
#include <stdio.h>
// Function that calls another function with some arguments.
// Passing more than 4 arguments to see what happens
// by b1ack0wl
void main(){
int a = 0;
int b = 1;
=-------------------------------=
| [0x4003b0] |
| main: |
| (fcn) sym.main 188 |
| addiu sp, sp, -0x60 |
| sw ra, 0x5c(sp) |
| sw fp, 0x58(sp) |
| move fp, sp |
| sw zero, 0x30(fp) | // Initialize int a to 0
| addiu v0, zero, 1 | // Perform (0+1) and store the unsigned result in register $v0