diff --git a/opsec/openwebuilocalllms/index.html b/opsec/openwebuilocalllms/index.html index 7197ec7..91e4d1c 100644 --- a/opsec/openwebuilocalllms/index.html +++ b/opsec/openwebuilocalllms/index.html @@ -201,7 +201,7 @@ We'll show how to check prompt length and set appropriate context size in Open W
-Open LLMs Past and Present In this tutorial, you've set up a private LLM experience using ollama and Open WebUI. By exposing it via Tor, your conversations remain anonymous and private. None of your data will be sent anywhere or used for training new models. While the open model ecosystem is still somewhat behind the proprietary technologies and big datacenters, it quickly catches up. In this tutorial, you've set up a private LLM experience using ollama and Open WebUI. Your conversations remain anonymous and private, no data will be sent anywhere or used for training new models.
+Open LLMs - Past and Present
Ever since LLaMA 1 was leaked on 4chan in February 2023, we started seeing more and more companies caring about so called "open" LLMs. Those can be downloaded and run on users computer without any restrictions.
In early 2025 we also heard A LOT about deepseek-r1. An open reasoning LLM that tried to compete with OpenAI's ChatGPT. While it wasn't Deepseeks first model (their earlier work includes deepseek-coder, deepseek-v2.5 MoE and deepseek-v3), the hype was global. It brought a lot of attention to open LLM ecosystem and made proprietary AI companies loose billions.
@@ -693,8 +693,32 @@ bio.seek(0)
print(bio.read())
```
+Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+The code has a format string vulnerability. `printf(newbuf)` uses user-controlled data (`newbuf`) as the format string, allowing an attacker to potentially read from or write to arbitrary memory locations. `strncpy` limits the copy to 60 bytes, but the format string vulnerability remains because `printf` can interpret those bytes as format specifiers.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -751,7 +775,31 @@ print(bio.read())
```
Q4 - Russian-English translation
+ Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+The code is vulnerable to a format string vulnerability. The `strncpy` function with a size of 0x3f (63) copies the input string into `newbuf` without null-termination, and then `printf` is called directly with this potentially unformatted string as the format string. This allows an attacker to control the format string and read or write arbitrary memory locations.
Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -800,8 +848,32 @@ for byte in bio:
print(byte)
```
Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+The code is vulnerable to a buffer overflow because `strncpy` doesn't perform a length check and can write beyond the bounds of `newbuf`. If `inbuf` is longer than 63 characters, the program will overwrite memory, potentially leading to a crash or security exploit.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -858,8 +930,34 @@ bio.seek(0)
print(bio.read())
```
Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+Yes, the code contains a vulnerability due to improper use of `strncpy`. Although it limits copying to `0x3f` (63) characters, `newbuf` has room for one more character (the null terminator). After using `strncpy`, there's no guarantee that `newbuf` is null-terminated if the source string is longer than 63 characters. This can lead to undefined behavior when `printf(newbuf)` is called, potentially resulting in a buffer overflow or a crash if non-null bytes follow.
+
+Additionally, the use of `printf(newbuf)` with an untrusted input (`inbuf`) without format specifiers allows for format string vulnerabilities, as it directly uses the contents of `newbuf` as a format string, which could be manipulated to execute arbitrary code.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -941,8 +1039,32 @@ This corrected script reads from 'a.txt', modifies its content by performing bit
Make sure your environment has access permissions for reading the file. Adjust any error handling as per specific requirements or data formats present within 'a.txt'.
Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+Yes, there's an issue with the use of `strncpy`. If `inbuf` contains more than or equal to 64 characters (the size limit minus one for null terminator), it won't be properly copied into `newbuf`, leading to undefined behavior when accessing its contents later on in your code due to a potential buffer overflow vulnerability.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -996,8 +1118,32 @@ bio.seek(0)
print(bio.read().decode())
```
Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+The code contains a potential buffer overflow vulnerability due to the use of `strncpy` in the `print_text` function. Although it limits copying up to 64 bytes (0x3f in hexadecimal), it does not null-terminate `newbuf` if the input string is longer than 62 characters, leading to unpredictable behavior or a crash. To fix this, replace `strncpy` with `strlcpy`, which guarantees null-termination and specifies the buffer size.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -1058,8 +1204,35 @@ print(bio.getvalue())
```
Note: In the original code, `f.read` was called without any arguments, which would return a generator object. I changed it to simply `for byte in f`, which will iterate over each line of the file. Also, `bio.write(bytes([byte ^ 6]))` should be `bio.write(bytes([byte[0] ^ 6]))`, because `byte` is already a single character (not a list or bytes), so we need to access its first element using `[0]`. Finally, I replaced `f.close()` with the context manager syntax `with open... as f:`, which ensures that the file is always properly closed.
Q4 - Indentifying C vulnerability
+
+ > Do you see any vulnerability in this C code?
+```c
+#include
+The code has two potential vulnerabilities:
+
+1. **Undefined Behavior**: The `strncpy` function is used with a count of 63 (0x3f), which may not be the maximum length of the `newbuf` array, potentially leading to buffer overflow.
+2. **Lack of Input Validation**: The `print_text` function does not check if `inbuf` is null before copying it to `newbuf`, allowing a potential NULL pointer dereference attack.
Q4 - Russian-English translation
+ Q5 - Russian-English translation
> Translate to english:
```
Заметил что через какое-то время перестает работать i2pd. Пока не перезапустишь сервис, либо не нажмешь в админке перезагрузку конфигов. Это известный баг? Или я что-то не так настроил?Обновился до последней версии. Ни чего не поменялось. У меня. mac os сборка. Из интересного даже локал хост с консолью не открывается, точнее он это делает раз через раз. Но когда открывается показывает что тунели есть. Ведет себя буд-то утечка памяти, или что то такое.
@@ -1095,7 +1268,8 @@ Only output the translation, nothing else.
Closing Remarks
-
+
+While the open model ecosystem is still somewhat behind the proprietary technologies and big datacenters, it quickly catches up.
It's safe to assume in a few years we will have models as capable as current Claude or OpenAI products, running with fraction of the cost on your own hardware. What a time to be alive!