- Dołączył
- 26 Maj 2015
- Posty
- 19192
- Reakcje/Polubienia
- 55827
źródło:Zaloguj lub Zarejestruj się aby zobaczyć!zapewne kojarzy się Wam z popularnym sposobem naZaloguj lub Zarejestruj się aby zobaczyć!– choć może być również używany w innych zastosowaniach (np. „zwykłe” szyfrowanie pliku). Właśnie ogłoszono podatnośćZaloguj lub Zarejestruj się aby zobaczyć!, dotykającąZaloguj lub Zarejestruj się aby zobaczyć!, ale też innych pakietów związanych m.in. z szyfrowaniem poczty: thunderbirdowy pluginZaloguj lub Zarejestruj się aby zobaczyć!orazZaloguj lub Zarejestruj się aby zobaczyć!.
O co chodzi w problemie? (który sięga aż końcówki lat 90-tych!) Zacytujemy w całości opis zZaloguj lub Zarejestruj się aby zobaczyć!:
Tu zatrzymajmy się na moment. Jak widać – atakujący może podczas szyfrowania podać parametr wskazujący na nazwę oryginalnego, szyfrowanego pliku. A ta wartość (nazwa pliku) może być uzupełniona o znaki złamania linii.The OpenPGP protocol allows to include the file name of the original input file into a signed or encrypted message. During decryption and verification the GPG tool can display a notice with that file name. The
displayed file name is not sanitized and as such may include line feeds or other control characters. This can be used inject terminal control sequences into the out and, worse, to fake the so-called status
messages.
Więc wstrzykujemy znaki końca linii, w kolejnych liniach wstrzykujemy komunikaty mówiące o tym kto podpisał maila.These status messages are parsed by programs to get information from gpg about the validity of a signature and an other parameters. Status messages are created with the option „–status-fd N”
where N is a file descriptor. Now if N is 2 the status messages and the regular diagnostic messages share the stderr output channel. By using a made up file name in the message it is possible to fake status messages. Using this technique it is for example possible to fake the verification status of a signed mail.
Jeśli podczas uruchomienia GPG –status-fd jest ustawiony na 2, zarówno błędy jak i zwykłe statusy są wysyłane naZaloguj lub Zarejestruj się aby zobaczyć!I dalej – informacja, która jest realnym statusem (np. poprawny podpis) wyłuskiwana jest z wyniku na podstawie prefiksu [GNUPG:] – który kontroluje przecież atakujący. Możemy zatem przejść do PoC-a:
Widzicie powyżej: –set-filename, złamanie linii i wstrzyknięty prefiks [GNUPG:]
Zaloguj lub Zarejestruj się aby zobaczyć!
W programie pocztowym daje to taki wynik:
Warto zauważyć, że zarówno zgadza się podpis, ale również widać, że wiadomość została zaszyfrowana (a nie została). Dwa w jednym.
Na koniec jest też mały niuans: aby być podanym, GPG musi być odpalany z opcją –verbose, co nie jest ustawieniem domyślnym np. w Enigmailu (uwaga: –verbose może być ustawione w konfiguracji gpg, ale także ręcznie przy uruchomieniu). Wiele jednak narzędziZaloguj lub Zarejestruj się aby zobaczyć!.
Jest też dobra to znaczy zła informacja: mamy osobnegoZaloguj lub Zarejestruj się aby zobaczyć!W tym przypadku nawet z wyłączoną opcją –verbose w GPG można fałszować podpisy. Opisane są dwa sposoby, dla zobrazowania problemu – pierwszy z nich:
Tutaj ponownie problem zasadza się na chałupniczym sposobie przesyłania statusów przez GPG (po prostu w dużym ciągu tekstowym, który następnie jest przeparsowywany):Simply generate two keys, and sign a message with both. Import the public keys into a new keyring, and set full trust for one of them. Sign a message first with the untrusted key, and second with the trusted key. Enigmail will display the signature from the untrusted key as trusted.
Co robić?Again, we exploit the awkwardness of the text-based GnuPG status interface.
Zaktualizować GPG do co najmniej wersjiZaloguj lub Zarejestruj się aby zobaczyć!,Zaloguj lub Zarejestruj się aby zobaczyć!,Zaloguj lub Zarejestruj się aby zobaczyć!. Inne komponenty (np. biblioteki programistyczne) zapewnie będąZaloguj lub Zarejestruj się aby zobaczyć!.
Zaloguj
lub
Zarejestruj się
aby zobaczyć!