-i
- ignore errors
-c
- continue
-t
- use video title as file name
--extract-audio
- extract audio track
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
background-color: #f2f2f2; | |
display: flex; | |
justify-content: center; |
#!/usr/bin/env python3 | |
import sys | |
def crc8(data: int) -> int: | |
crc = 0xFF | |
polynom = 0x31 | |
data_bytes = data.to_bytes(2, 'big') | |
for byte in data_bytes: |
Source material: | |
http://security.stackexchange.com/questions/24444/what-is-the-most-hardened-set-of-options-for-gcc-compiling-c-c | |
https://wiki.gentoo.org/wiki/Hardened_Gentoo | |
https://wiki.debian.org/Hardening | |
================================================================================================================> | |
GCC Security related flags and options: | |
CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2" | |
LDFLAGS="-Wl,-z,now -Wl,-z,relro" |
#!/usr/bin/perl | |
###################################################################### | |
# killcx : | |
# | |
# Close a TCP connection under Linux. | |
# | |
# (c) Jerome Bruandet - <floodmon@spamcleaner.org> | |
# | |
# version 1.0.3 - 18-May-2011 | |
# |
x86-64 (also known as just x64 and/or AMD64) is the 64-bit version of the x86/IA32 instruction set. Below is our overview of its features that are relevant to CS107. There is more extensive coverage on these topics in Chapter 3 of the B&O textbook. See also our x86-64 sheet for a compact one-page reference. | |
Registers | |
The table below lists the commonly used registers (sixteen general-purpose plus two special). Each register is 64 bits wide; the lower 32-, 16- and 8-bit portions are selectable by a pseudo-register name. Some registers are designated for a certain purpose, such as %rsp being used as the stack pointer or %rax for the return value from a function. Other registers are all-purpose, but have a conventional use depending on whether caller-saved or callee-saved. If the function binky calls winky, we refer to binky as the caller and winky as the callee. For example, the registers used for the first 6 arguments and return value are all caller-saved. The callee can freely use those registers, overwriting |
-Wall -Wextra | |
Turn on all warnings to help ensure the underlying code is secure. | |
-Wconversion -Wsign-conversion | |
Warn on unsign/sign conversion | |
-Wformatsecurity | |
Warn about uses of format functions that represent possible security problems | |
-Werror | |
Turns all warnings into errors. | |
-arch x86_64 | |
Compile for 64-bit to take max advantage of address space (important for ASLR; more virtual address space to chose from when randomising layout). |
/* --- Usage --- */ | |
g++ server.c -o server | |
g++ client.c -o client | |
./server | |
./client 127.0.0.1 | |
/* --- server.c --- */ | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> |
#!/bin/bash | |
# | |
# Trap control-C (SIGINT) and instead send signal specified as | |
# arg 1 to a program which is the rest of the arguments | |
# | |
# e.g. | |
# intrap USR1 dd if=/dev/urandom of=/dev/null bs=1024 count=10000 | |
# | |
# ... will send SIGUSR1 to the specified dd process (causing it | |
# to dump status information). Note that if you do this, you'll |
iptables -t mangle -N badz | |
iptables -t mangle -N blockz | |
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 80 -j blockz | |
iptables -t mangle -A badz -m recent --set --name terrible --rsource | |
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 --tcp-flags FIN,SYN,RST,ACK SYN -m recent --update --seconds 3600 --name terrible --rsource -j DROP | |
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 -m string --string "malicious_string" --algo bm --to 65535 -m recent --set --name bad --rsource | |
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 -m string --string "malicious_string" --algo bm --to 65535 -m recent --update --seconds 10 --hitcount 3 --name bad --rsource -j badz |