One way to conceptualize the difference between knowledge and information is this: knowledge involves some metric of computational difficulty to arrive at, while mere information lacks this property.
Tuesday, April 09, 2024
Tuesday, November 28, 2023
mapcidr patch
Project Discovery’s mapcidr had a bug when converting IP addresses. The “-ip-format” flag did not properly work for one of the cases.
For example, echo '127.0.0.1' | mapcidr -ip-format 5 would incorrectly return the integer representation or decimal value 281472812449793, when it should have returned the decimal value 2130706433. The problem could be seen in the Go function here which uses functionality imported from the math library.
func IPToInteger(ip net.IP) (*big.Int, int, error) {
val := &big.Int{}
val.SetBytes([]byte(ip))
if len(ip) == net.IPv4len {
return val, 32, nil //nolint
} else if len(ip) == net.IPv6len {
return val, 128, nil //nolint
} else {
return nil, 0, fmt.Errorf("unsupported address length %d", len(ip))
The function was easily fixed by removing the early "setBytes" value and rewriting it to correctly set the bytes conditionally for each if-statement, depending on the IP type.
func IPToInteger(ip net.IP) (*big.Int, int, error) {
val := new(big.Int)
// check if the ip is v4 => convert to 4 bytes representation
if ipv4 := ip.To4(); ipv4 != nil {
val.SetBytes(ipv4)
return val, 32, nil
}
// check if the ip is v6 => convert to 16 bytes representation
if ipv6 := ip.To16(); ipv6 != nil {
val.SetBytes(ipv6)
return val, 128, nil
}
return nil, 0, fmt.Errorf("unsupported IP address format")
}
Tuesday, November 07, 2023
DMARC
Lately I've overheard some people discussing email spoofing with regard to organizations that don't implement DMARC. Namely, "APTs" taking advantage of organizations that don't utilize Domain-based Message Authentication, Reporting and Conformance.
Monday, October 09, 2023
Enumerating TLS Certificates with jq and Bash
Doubling back to share some more notes about web application security adjacent stuff. This is a bash script for reconnaissance that uses some tooling from Project Discovery - mapcidr and tlsx - in combination with jq and Bash, to enumerate TLS certificates.
Friday, September 15, 2023
Using Bash to Sort IPs by Subnet Uniqueness
This is a helpful Bash script to parse IP addresses by the uniqueness of their subnets. This can be quite helpful in various scenarios.
Thursday, September 14, 2023
Binary, IPv4, and Subnets
The IPv4 protocol which we broadly (but not totally) use today rests on an addressing system that was designed in the 1970s and formally published in 1980.
Tuesday, September 05, 2023
The Etymology of 'Deadline'
The word 'deadline' has a popular etymology story around 19th century prison culture. The explanation of the meaning behind the word 'deadline' often goes something like this — as many etymologists and US dictionaries frequently cite it:
Using Python To Access archive.today, July 2025
It seems like a lot of the previous software wrappers to interact with archive.today (and archive.is, archive.ph, etc) via the command-line ...
-
Latin1 was the early default character set for encoding documents delivered via HTTP for MIME types beginning with /text . Today, only ...
-
From "Overfitting and the strong version of Goodhart's law" : Increased efficiency can sometimes, counterintuitively, lead to ...
-
Playing around with writing malware proof-of-concepts, running red and blue team simulations in my computer lab against Windows Home edition...