This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the quick brown fox jumps over the lazy dog | |
import md5, sys | |
def main(argv): | |
me = argv[0] | |
# Get the first line from this file, remove # and strip extra characters | |
data = open(me, 'r').readlines() | |
first_line = data[0][1:].strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define STOP_MAX 20 | |
// Lazy method: If negative, add "base" until no longer negative. | |
int lazy_mod(int n, int base) { | |
while (n < 0) { | |
n += base; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
char buffer[1024]; | |
char buffer2[2048]; | |
fgets(buffer, 1023, stdin); | |
sprintf(buffer2, "echo $((%s))", buffer); | |
system(buffer2); // TADA! :D | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <sys/mman.h> | |
int main(void) { | |
char rawr[] = "Rawr!\n"; | |
char bytecode[] = { | |
0x60, // pusha | |
0xb8, 0x04, 0x00, 0x00, 0x00, // mov eax, 4 | |
0xbb, 0x01, 0x00, 0x00, 0x00, // mov ebx, 1 | |
0xb9, /* for rawr */ 0,0,0,0, // mov ecx, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TCP Traffic Generator | |
import socket | |
import time | |
DEFAULT_PAYLOAD = 100 ;# MiB | |
DEFAULT_BYTERATE = 100 ;# MiB/sec | |
DEFAULT_TARGET = ("10.0.0.2", 31337) | |
SEC_FRACTION = 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace my_proxy.Lists | |
{ | |
public class EncryptedEntryProcessor : IEntryProcessor | |
{ | |
private readonly ICryptoTransform _encryptor; | |
private readonly ICryptoTransform _decryptor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packet capturing on Linux (requires root!) | |
# May need to enable promiscuous mode with: | |
# ifconfig eth1 up | |
# ifconfig eth1 promisc | |
from socket import * | |
s = socket(PF_PACKET, SOCK_RAW, htons(0x0800)) | |
s.setsockopt(IPPROTO_IP, IP_HDRINCL, 1) | |
while True: | |
print s.recvfrom(65565) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** Configuration Phase ***/ | |
$addr = 'furc'; | |
$port = 6500; | |
$name = 'CPU'; | |
$pass = 'password'; | |
$col = '" 367**888 "!'; | |
$desc = '//Central Processing Unit//'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# OOSD132 Lecture Downloader | |
# | |
# Author: IceDragon <[email protected]> | |
# Contact: http://www.icerealm.org/contact | |
# | |
# Exit Codes: | |
# 0 - No new changes | |
# 1 - Downloaded new files (or at least tried to) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASE_URL='http://www.cs.bgu.ac.il' | |
MATERIAL="$BASE_URL/~oosd132/Practical_Sessions" | |
MATERIAL_DIR="$HOME/bgu/oosd" | |
CMD_DOWNLOAD_DATA="wget -o /dev/null -O - $MATERIAL" | |
EXIT_CODE=0 | |
###--# BODY #--################################################################ | |
function getFilePaths { |