Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

May 10, 2016

SSH, SSL, Linux Kernel


openssh -- openbsd
The do_setup_env function in session.c in sshd in OpenSSH through 7.2p2, when the UseLogin feature is enabled and PAM is configured to read .pam_environment files in user home directories, allows local users to gain privileges by triggering a crafted environment for the /bin/login program, as demonstrated by an LD_PRELOAD environment variable.
2016-04-30

openssl -- openssl
The ASN.1 implementation in OpenSSL before 1.0.1o and 1.0.2 before 1.0.2c allows remote attackers to execute arbitrary code or cause a denial of service (buffer underflow and memory corruption) via an ANY field in crafted serialized data, aka the "negative zero" issue.
2016-05-04

linux -- linux_kernel
The redirect_target function in net/ipv4/netfilter/ipt_REDIRECT.c in the Linux kernel before 2.6.0 allows remote attackers to cause a denial of service (NULL pointer dereference and OOPS) by sending packets to an interface that has a 0.0.0.0 IP address, a related issue to CVE-2015-8787.
2016-05-02

Jan 20, 2016

SSH色々

JVNVU#95595627
OpenSSH のクライアントに複数の脆弱性 (最終更新日:2016/01/19)
http://jvn.jp/vu/JVNVU95595627/

Someone Just Leaked a Hard-Coded SSH Password Backdoor in Fortinet Firewalls (2016/01/12)
http://thehackernews.com/2016/01/fortinet-firewall-password-hack.html

FortiOS SSH Undocumented Interactive Login Vulnerability (2016/01/12)
http://www.fortiguard.com/advisory/fortios-ssh-undocumented-interactive-login-vulnerability

Qualys Security Advisory - Roaming through the OpenSSH client: CVE-2016-0777 and CVE-2016-0778 (2016.01.14)
https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt

@kjmkjmさんの所に、分かり易い解説あり
http://www.st.ryukoku.ac.jp/~kjm/security/memo/2016/01.html#20160115_openssh
| 攻略 SSH サーバーが、
|   クライアント側の情報 (例: プライベート鍵) を盗んだり CVE-2016-0777
|   ... 特定の条件が必要だが、クライアント側で buffer overflow を発生させたり CVE-2016-0778
| できる
...
| 対応:
|   OpenSSH 7.1p2 に移行する。7.1p2 ではローミング機能がデフォルト無効となっている。
|   http://www.openssh.com/txt/release-7.1p2 に記載されている patch を適用して
|   OpenSSH をつくりなおし、インストールする。
|
|  回避方法: ローミング機能を無効に設定する。
|     システムの ssh_config ファイル ... に UseRoaming no を追加する
|     各ユーザの ~/.ssh/config に UseRoaming no を追加する
|     ssh のコマンドラインオプションで -oUseRoaming=no を指定する
だそうです。


May 22, 2015

色々5/22

Twitter上の嫌がらせ行為で通報を受けたTwitterはどう対処しているのか?
(2015/05/19)
http://gigazine.net/news/20150519-twitter-abuse-problem/

マルウェアはどうやってウィルス対策ソフトから逃れようとするのか?
(2015/05/15)
http://csi.sproutgroup.co.jp/archives/000107.html

CozyDukeを侮るなかれ (2015/05/14)
https://blog.kaspersky.co.jp/no-monkeys-for-cozyduke/7488/
5/27追記-->
OpenSSH環境に対するLogjam脆弱性の対応 (2015/05/25)
http://tech.naviplus.co.jp/2015/05/25/openssh%E7%92%B0%E5%A2%83%E3%81%AB%E5%AF%BE%E3%81%99%E3%82%8Blogjam%E8%84%86%E5%BC%B1%E6%80%A7%E3%81%AE%E5%AF%BE%E5%BF%9C/
これsshにも影響あるのか。orz

OpenSSH-6.5p1 日本語マニュアルページ (2014/05/31)
http://www.unixuser.org/~euske/doc/openssh/jman/sshd_config.html

//

Feb 26, 2015

SSHD_CONFIGと、Log Level メモ

LogLevelについて

QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG,DEBUG1, DEBUG2 および DEBUG3。
デフォルトでは INFO です。


DEBUG2、DEBUG3 はそれぞれさらに冗長

参考
 http://www.unixuser.org/~euske/doc/openssh/jman/sshd_config.html

以上、2014.08のメモから抜粋

Feb 19, 2015

SSH protocol 1.99 のメモ

SSH protocol 1.99
  http://tools.ietf.org/html/rfc4253#section-5.1

Jun 17, 2014

Tera Term 4.84 will mitigate notify_nonfatal_error

Synopsis
In the following ASCII-figured environment, it seemed working in the beginning, but the next error message occurred (in unexpected/unknown timing), and every time it occurs, I need to press nasty [ok] many times. That has been my headache.

Thanks to yutakapon san, Tera Term's coming version 4.84 will also improve my experience of web browsing through SSH tunnel (under sshd + proxy server).

Environment
PC + Tera Term + forwarding (port 3128/tcp) + browser with proxy (my_PC:3128)
    |
(ssh tunnel under low quality network)
    |
ssh server (sshd) + proxy server (port 3128/tcp)
    |
Internet

Error Message (English)
A communications error occurred while sending forwarded data to a local port. The forwarded connection will be closed.

Error Message (Japanese)
ローカルポートに転送データを送信中、通信エラーが発生しました。転送接続を閉じます。

Plausible Cause and History 
In case I open many sessions (for HTTP communication through SSH tunnel) at a time,
a certain kind of error {in the condition “if(!UTIL_sock_buffered_write ...)”} occurs, I guess.
Ref:  http://sourceforge.jp/projects/ttssh2/scm/svn/blobs/head/tags/teraterm-4_82/ttssh2/ttxssh/fwd.c 
  1839th: if(!UTIL_sock_buffered_write ...)  
  1845th: notify_nonfatal_error(pvar, pvar->ts->UIMsg);

(It doesn't occur when I use a single session in the different application like POP3 and so on.)

The error situation seems common in Tera Term 4.66, 4.76, 4.82.

So, I requested to stop “notify_nonfatal_error” (partly), and then Tera Term project person kindly corresponded that it will be implemented in the future version 4.84.

unfortunately the link becamse unavailable now.) , 
which doesn't cause error message and doesn't require me nasty operation to press [ok]. 

In the temporal cure version, {probably/mainly because of the continuing condition "!UTIL_sock_buffered_write ...",} browsing seems still slower than direct connection to the internet without proxy, but I highly appreciate the fact that it doesn't require to press [ok] anymore.

I hereby wrote rough translation in English, for the sake of English-speaking users, paying respect to the project people. Thank you all who are in the project for the great software, Tera Term.

Japanese original article:

Apr 14, 2012

SSHとSSLとの間の鍵変換

■秘密鍵が有る場合
SSH秘密鍵=SSL鍵。
ssh-keygen -t rsa で鍵発行済み鍵は、SSL用の2048-bit RSA 秘密鍵となる。

SSL秘密鍵からSSH公開鍵を生成するには
ssh-keygen -f ssl_private_key_file -y > ssh.pub

SSH秘密鍵からSSL公開鍵を生成するには
openssl rsa -in ssh_private_key_file -pubout -out ssl.pub

■秘密鍵が無い場合
SSH公開鍵か、SSL certだけが有る場合は、より困難になる。
SSL certから、SSL公開鍵を抽出し、SSLと SSH公開鍵との交換が出来なけ
ればならない。

SSL certから、SSL公開鍵を抽出するには
openssl x509 -in cert_file -pubkey -noout > ssl.pub

第二段階は、より複雑。Debianでは以下の通り。

apt-get install lsh-utils

ssh-conv < ssh.pub | sexp-conv

もし、ssl.pub とssh.pubが同じ鍵を参照するなら、次の二つの出力は酷似し、明ら
かに相互変換可能な事が分かるだろう。
ssh-conv < ssh.pub | sexp-conv -s hex

openssl rsa -in ssl.pub -pubin -noout -text

スクリプト
sed -e'1d' -e'$d' < /tmp/test.pub | \
 pkcs1-conv --public-key-info --base-64 | \
 sexp-conv | \
 sed -e'1s/(rsa/(rsa-pkcs1-sha1/' | \
 sexp-conv -s transport

上記の出力は、次と同一である。
ssh-conv < ssh.pub | sexp-conv -s transport

而して、変換可能になった。フルパイプラインは
sed -e'1d' -e'$d' \< ssl.pub | \
 pkcs1-conv --public-key-info --base-64 | \
 sexp-conv | \
 sed -e'1s/(rsa/(rsa-pkcs1-sha1/' | \
 sexp-conv -s transport | \
    lsh-export-key --openssh > newssh.pub

備考
 上記はRSA鍵のみ。DSA鍵には使えない。
 また、悪い鍵に対する公開テストで、1024-bit RSA keyには使えない事が分かっ
ている。

  Debian "etch"システムで、レタータイプの鍵をつかっていたら、
 鍵を、2048-bit RSA に変えたほうが良い。

------------------------------------------------------
元ネタ

Converting keys between SSH and SSL (Mast Kalandar 2008/05/15)

Howto: Convert an OpenSSL key to a public/private OpenSSH key-pair (.bootstrap 2009/04/11)

How can I use the same key for SSH and SSL (https)  (serverfault.com 2010/02/18)

Convert keys between GnuPG, OpenSsh and OpenSSL (Sysmic.org  2010/03/24)

PKCS8秘密鍵→SSH2公開鍵変換ツール (kurushima @ 自堕落な技術者のヰキ(公開版))
> PKCS#8 RSA 秘密鍵(PINの無いもの)のPEM型式から
> SSH2公開鍵に変換したものをファイル出力するツールです。
//