Skip to content

Instantly share code, notes, and snippets.

View cedriczirtacic's full-sized avatar
🐗
æ

cedric cedriczirtacic

🐗
æ
View GitHub Profile
@cedriczirtacic
cedriczirtacic / robots.js
Last active October 26, 2017 17:52
fetch and check robots.txt entries
#!/bin/env node
// https://gist.github.com/cedriczirtacic
const colors = require('colors');
function help(e) {
if (e != undefined || e != "")
console.info("usage: %s <url>", e);
process.exit(1);
}
@cedriczirtacic
cedriczirtacic / disclosure.log
Last active November 26, 2017 18:08
Oracle's taleo.net platform cross-site scripting bug
[1] 17/10/2017: Contacted Oracle security alert.
[2] 17/10/2017: Sent bug and description to Oracle security team.
[3] 23/10/2017: Global Information Security Team verified the vulnerability and forwarded the issue to the appropiate team for resolution.
[4] 30/10/2017: Ticket S0934612 was assigned.
[5] ??/11/2017: Fixed.
[6] 24/11/2017: Status report for issue S0934612 ("Under investigation / Being fixed in main codeline").
#!/bin/env node
// https://gist.github.com/cedriczirtacic
var argv = process.argv;
if (argv.length < 3) {
console.info("%s <url>", argv[1]);
process.exit(1);
}
var url = argv[2];
@cedriczirtacic
cedriczirtacic / readmacho.c
Last active October 15, 2017 15:14
quick & dirty read Macho-O binary headers
// like: otool -h <binary>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <mach-o/loader.h>
int main(int argc, char *argv[]) {
struct mach_header_64 *hdr;
@cedriczirtacic
cedriczirtacic / patch1.diff
Last active October 11, 2017 18:11
hexer 1.0.3 various buffer overflows (poc + fixes)
--- main.c.old 2017-10-11 11:00:46.980000015 -0600
+++ main.c 2017-10-11 11:09:21.803333352 -0600
@@ -152,7 +152,8 @@
printf("recover from file `%s'.\n", optarg);
break;
case 'c': /* command */
- startup_commands[startup_commands_n++] = optarg;
+ if (startup_commands_n <= HEXER_MAX_STARTUP_COMMANDS)
+ startup_commands[startup_commands_n++] = optarg;
break;
@cedriczirtacic
cedriczirtacic / russian_roulette.S
Last active September 29, 2017 21:46
SIGSEGV russian roulette
.section .text
.global _start
_start:
pushq %rbp
movq %rsp, %rbp
subq $1, %rbp
// call sys_getrandom
movl $318, %eax
leaq -1(%rbp), %rdi
@cedriczirtacic
cedriczirtacic / rot13.S
Last active August 25, 2017 20:49
assembly rot13()
//as -o rot13.o rot13.S && ld -o rot13 rot13.o
.section .data
string:
.asciz "Hello World.\n"
.section .text
.global _start
_start:
leaq string, %rdi
call rot13
@cedriczirtacic
cedriczirtacic / tmux.cheat
Created August 16, 2017 21:52 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@cedriczirtacic
cedriczirtacic / 64_or_32.S
Last active August 14, 2017 20:45
check if 64 or 32 bits using CS segment (64=33, 32=23)
// To try it in i386:
// as --32 -o cs.o cs.S && ld -melf_i386 -o cs cs.o
.section .text
.global _start
_start:
movw %cs, %cx
shr $4, %cx
cmpb $3, %cl
je x86_64
@cedriczirtacic
cedriczirtacic / get_original_hwaddr.c
Last active August 4, 2017 17:31
using ioctl(2) to get the original hwaddr of a network interface
// gcc -o get_orig_hwaddr get_orig_hwaddr.c
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
char *get_addr (int fd, struct ifreq *ifrq) {