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
--- src/gifread/gifread.c.orig 2023-10-30 19:44:00.082877489 +0000 | |
+++ src/gifread/gifread.c 2023-10-30 22:42:08.789142913 +0000 | |
@@ -363,6 +363,11 @@ | |
lastbit = (2 + count) * 8; | |
} | |
+ if (code_size && (size_t)(curbit + code_size - 1) / 8 >= sizeof(buffer)) { | |
+ GIFError("Malformed GIF (CVE-2023-43907)"); | |
+ return -1; | |
+ } |
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
def fixed_length_secure_compare(a, b) | |
raise ArgumentError, 'length mismatch' unless a.bytesize == b.bytesize | |
res = 0 | |
if a.bytesize >= 4 && a.bytesize % 4 == 0 | |
ai = a.unpack "L*" | |
bi = b.unpack "L*" | |
ai.each { |int| res |= int ^ bi.shift } | |
else | |
ab = a.bytes |
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/sh | |
# | |
# PROVIDE: zenbleed_workaround | |
# REQUIRE: root mountcritlocal microcode_update | |
# BEFORE: SERVERS | |
# KEYWORD: nojail resume | |
# Source: https://gist.github.com/Freaky/2560975d3c94246b86f464b8be75c967 | |
# | |
# Copyright (c) 2023 Thomas Hurst <[email protected]> |
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
#!/usr/bin/env ruby | |
def usage() abort("#{$0} [base nzb] [number of new nzbs]") end | |
file = ARGV.shift | |
nzb = File.read(file) | |
num = Integer(ARGV.shift) rescue usage | |
header, nzb = nzb.split(/(?=<file)/, 2) | |
files = nzb.scan(/<file.*?<\/file>/m) |
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
#!/usr/bin/env ruby | |
times = ARGF | |
.each_line | |
.map { |line| /^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.{1,77})/.match(line) } | |
.select(&:itself) | |
.map { |md| [Integer(md[1] + md[2]), md[3]] } | |
.each_cons(2) | |
.map { |a, b| [b[0] - a[0], a[1]]} | |
.sort_by(&:first) |
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
FROM rust:1.33-stretch as build | |
WORKDIR /usr/src/tarssh | |
# Make a blank project with our deps for Docker to cache. | |
# We skip rusty-sandbox because it does nothing useful on Linux. | |
COPY Cargo.toml Cargo.lock . | |
RUN mkdir -p src \ | |
&& echo 'fn main() { }' >src/main.rs \ | |
&& cargo build --release --no-default-features --features drop_privs |
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
use std::env; | |
use std::net::SocketAddr; | |
use std::sync::atomic::{AtomicUsize, Ordering}; | |
use std::time::{Duration, Instant}; | |
use exitcode; | |
use env_logger; | |
use log::{error, info, warn}; |
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 <stdint.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define MIN(a,b) (((a)<(b))?(a):(b)) | |
#define LO ((uint64_t)0x0101010101010101L) | |
#define HI ((uint64_t)0x8080808080808080L) | |
#define LOOP_SIZE (2 * sizeof(uint64_t)) |
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
#!/usr/bin/env ruby | |
require 'readline' | |
run = true | |
puts | |
worker = Thread.new do | |
i = 0 | |
while run | |
STDOUT.print("\e[s\r\e[A\e[KMoo moo baa #{i += 1}\n\e[u"); |
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
#!/usr/local/bin/ruby | |
Host = '192.168.100.1' | |
require 'net/http' | |
require 'timeout' | |
def get(page) | |
Timeout.timeout(5) { Net::HTTP.get(Host, page) } | |
rescue => e | |
STDERR.puts "GET http://#{Host}/#{page} failure: #{e.class}: #{e.message}" |
NewerOlder