Skip to content

Instantly share code, notes, and snippets.

@DavidMah
DavidMah / gist:9475427
Created March 10, 2014 22:04
immutability of directories
root@willbell:~# ls
root@willbell:~# mkdir lol
root@willbell:~# cd lol/
root@willbell:~/lol# ls
root@willbell:~/lol# touch banana
root@willbell:~/lol# touch frog
root@willbell:~/lol# chattr +i banana
root@willbell:~/lol# echo asdasdasd >> banana
-bash: banana: Permission denied
root@willbell:~/lol# echo asdasdasd >> frog
eb 13 11:39:49 d-69-91-159-88 racoon[338]: IKE Packet: transmit success. (Information message).
Feb 13 11:39:49 d-69-91-159-88 racoon[338]: IKEv1 Information-Notice: transmit success. (Delete IPSEC-SA).
Feb 13 11:39:49 d-69-91-159-88 racoon[338]: IKE Packet: transmit success. (Information message).
Feb 13 11:39:49 d-69-91-159-88 racoon[338]: IKEv1 Information-Notice: transmit success. (Delete ISAKMP-SA).
Feb 13 11:39:49 d-69-91-159-88 configd[14]: network configuration changed.
Feb 13 11:39:55: --- last message repeated 1 time ---
Feb 13 11:39:55 d-69-91-159-88 configd[14]: SCNC: start, triggered by SystemUIServer, type L2TP, status 0
Feb 13 11:39:55 d-69-91-159-88 pppd[482]: pppd 2.4.2 (Apple version 560.13) started by mahhaha, uid 501
Feb 13 11:39:55 d-69-91-159-88 pppd[482]: L2TP connecting to server '54.84.174.161' (54.84.174.161)...
Feb 13 11:39:55 d-69-91-159-88 pppd[482]: IPSec connection started
What share permissions exist? <li>Read - Reader</li><li>Change - Contributor</li><li>Full Control - Owner/Co-owner</li>
How do security permissions work on a FAT32 filesystem? They don't - there is no notion of permissions on FAT32.
What are the two ways of receiving permissions for a file in NTFS? <li>Explicit permissions are set manually</li><li>Inherited permissions are set through the parent object</li>
What are the NTFS standard permissions? <li>Read</li><li>Write</li><li>Read and Execute</li><li>List Folder Contents</li><li>Modify</li><li>Full Control</li>
What is the difference between Modify and Full Control permissions in NTFS? The only difference is that Full Control allows permissions to be managed.
What are combined permissions? Combined permissions are derived from multiple security accounts or multiple security ID sources. They apply under different rules in different contexts.
For combined permissions on a share or just NTFS just individually (not both share and ntfs), what are the rules under
.section .data
potato:
.long 65, 66, 10
.section .bss
.lcomm buffer, 500
.section .text
.globl _start
_start:
movq $1, %rbx
Programs can often be closed in a few different ways:
1. Sending EOF to standard input. Some program's whole purpose is to only read from standard input, process that data in some way, and output some other information gathered from that input. EOF means End of File. If you are sending information from a file as standard input to a process, then once all of the data in the file is consumed, it will send EOF. If you are typing to the shell to send information to a process's standard input, then you can manually send EOF to the program by hitting CTRL+D.
2. Send SIGINT to a program. Operating systems have these notions of signals. You can send signals to programs, and these programs should have code meant to handle these signals. SIGINT is a signal meant for interrupting a process. Usually, the way a program will handle this type of signal is to just quit. You can send SIGINT to a program through the shell by hitting CTRL+C.
3. Send SIGQUIT to a program. Similar to SIGINT, but conventions dictate that this is
mah@Mah [~/.dropbox-dist] ➜ ps -ef | grep dropbox
mah 22579 1 0 Oct03 ? 00:23:04 /home/mah/.dropbox-dist/dropbox
mah 25809 25761 0 09:03 pts/22 00:00:00 grep --color=auto dropbox
@DavidMah
DavidMah / magic.s
Last active December 24, 2015 12:29
.section .text
.globl _start
_start:
movq %rsp, %rbp
# Our team name starts here
movb $45, %al
movb $0, %bl
int $0x80
movq %rax, %rbx
#!/usr/bin/env python
import binascii
from hashlib import sha1, sha512
from itertools import product
import re
import struct
import socket
import sys
def generate(prefix):
@DavidMah
DavidMah / network-device-bootstrap.md
Created August 23, 2013 19:56
How Does Network Hardware Bootstrap?

How Does Network Hardware Bootstrap?

Cisco http://www.cisco.com/en/US/docs/ios/fundamentals/configuration/guide/cf_autoinstall.html#wp1148764

  • Connect the machine to the network and turn it on.
  • If you do not respond to the setup prompts, AutoInstall will begin automatically after a short period of time.
  • It sends out a DHCP request hunting for its ip address. Through DHCP, the machine receives an IP, a TFTP server IP (dhcp option 150), and a DNS server IP (dhcp option 6). The machine receives the TFTP server's IP address using ridiculous proprietary cisco DHCP option 150 (yes dhcpd will have to serve this. yes I mad).
@DavidMah
DavidMah / quiz.py
Last active December 20, 2015 15:29
Lightweight CLI Flash Cards
#!/usr/bin/env python
import json
import random
import os
import sys
DECKS_DIR = "decks"
# In the decks dir, store JSON encoded files
# matchinf the following format