tag:blogger.com,1999:blog-45440218558584943282024-02-08T14:42:21.232+09:00マスタ@日記マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.comBlogger392125tag:blogger.com,1999:blog-4544021855858494328.post-84508403496167755182018-05-29T00:26:00.002+09:002018-05-29T00:26:38.074+09:00beginnersCTF2018_Crypt_writeup Veni, vidi, viciファイルをダウンロードして解凍すると<br />
part1<br />
part2<br />
part3<br />
と3つの文字が・・・。<br />
<br />
catコマンドを実行してみる。<br />
<br />
root@kali2:/tmp/ctf2018begin/crypt/veni_vidi_vici# cat part1<br />
Gur svefg cneg bs gur synt vf: pgs4o{a0zber<br />
root@kali2:/tmp/ctf2018begin/crypt/veni_vidi_vici# cat part2<br />
Lzw kwugfv hsjl gx lzw xdsy ak: _uDskk!usd_u<br />
root@kali2:/tmp/ctf2018begin/crypt/veni_vidi_vici# cat part3<br />
{ʎɥdɐɹɓ0ʇdʎᴚ :sı ɓɐlɟ ǝɥʇ ɟo ʇɹɐd pɹıɥʇ ǝɥ⊥<br />
<br />
part3は、逆から読むと<br />
Ther part of the flag is:<br />
となっているのでフラグの一部がそのまま記載<br />
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Rypt0graphy}</span><br />
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">問題の意味を調べると</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">シーザー暗号ということが容易に推測できる。</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">シーザー暗号のツールを使ってみる。</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-variant: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">http://anti.rosx.net/etc/tools/enc_caesar.php</span></span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-variant: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span></span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">part1は13文字ずらしてみる。</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The first part of the flag is: ctf7b{n3more</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">part2は8文字ずらしてみると</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The second part of the flag is: _cLass!cal_c</span></div>
<div>
<span style="background-color: transparent; color: black; display: inline; float: none; font-family: "times new roman"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span></div>
<div>
1と2と3をつなぎあわせてれば正解だあああと思ったらなんとincorrect<br />
!!</div>
<div>
<br /></div>
<div>
どうなってるんだああああ。</div>
<div>
別の方法でシーザー暗号をかけてみることに。</div>
<div>
pythonでもシーザー暗号使えることが判明</div>
<div>
参考は以下</div>
<div>
https://qiita.com/balius_1064/items/baaa6ae8a657d05e4348</div>
<br />
以下が毛会<br />
<br />
oot@kali2:/tmp/ctf2018begin/crypt/veni_vidi_vici# python<br />
Python 2.7.14+ (default, Apr 2 2018, 04:16:25) <br />
[GCC 7.3.0] on linux2<br />
Type "help", "copyright", "credits" or "license" for more information.<br />
>> import codecs<br />
>> codecs.decode('Gur svefg cneg bs gur synt vf: pgs4o{a0zber')<br />
u'Gur svefg cneg bs gur synt vf: pgs4o{a0zber'<br />
>> codecs.decode('Gur svefg cneg bs gur synt vf: pgs4o{a0zber','rot13')<br />
u'The first part of the flag is: ctf4b{n0more'<br />
>> codecs.decode('Lzw kwugfv hsjl gx lzw xdsy ak: _uDskk!usd_u','rot13')<br />
u'Ymj xjhtsi ufwy tk ymj kqfl nx: _hQfxx!hfq_h'<br />
>> import codecs<br />
>> codecs.decode('Lzw kwugfv hsjl gx lzw xdsy ak: _uDskk!usd_u','rot13')<br />
u'Ymj xjhtsi ufwy tk ymj kqfl nx: _hQfxx!hfq_h'<br />
<br />
part1は意味のある文字がでた。ただし、webサイト上の値とは異なる値がでた。<br />
part2は[The second~]の文字がでてこない。<br />
<br />
なので<br />
part1---pythonの結果<br />
part2---webサイトの結果<br />
を利用して再度、part1,2,3のFLAGをくみあわせたらcorrectだった。<br />
<br />
<br />
所要時間80分。<br />
<br />
<br />
やっと自力ではじめて問題をとけた!!!!!!<br />
<br />
<br />
<br />
The second part of the flag is: _cLass!cal_c'<br />
<br />
Rypt0graphy}マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-87658678945198600362018-05-05T22:09:00.000+09:002018-05-05T22:09:04.882+09:00今更dockerをさわってみる_virtualbox上のcentos6上に導入<span style="background-color: white; color: black; cursor: auto; display: inline; float: none; font-family: "calibri" , "helvetica" , sans-serif , "emojifont" , "apple color emoji" , "segoe ui emoji" , "notocoloremoji" , "segoe ui symbol" , "android emoji" , "emojisymbols"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
</span>
<br />
<div dir="ltr" id="divtagdefaultwrapper" style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div style="margin-bottom: 0px; margin-top: 0px;">
方針:virtualbox上のcentos6.9に導入する。</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
■1.導入<br />
1.os最新化<br />
<span style="color: black;">
yum update</span></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<span style="color: black;">2.dockerインストール</span><br />
<span style="color: black;">
yum install epel-release</span><br />
<span style="color: red;"><span style="color: black;">
sudo tee /etc/yum.repos.d/docker.repo <<- font=""><span style="background-color: white;"><br /><span style="background-color: blue; color: lime;">
[dockerrepo]</span></span><br /><span style="color: lime;">
name=Docker Repository<br />
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/<br />
enabled=1<br />
gpgcheck=1<br />
gpgkey=https://yum.dockerproject.org/gpg<br />
EOF</span></-></span></span></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<span style="color: black;">yum install docker-engine</span></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
3.dockerサービス起動<br />
service docker start</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
4.docker composeのインストール<br />
sh -c "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
chmod +x /usr/local/bin/docker-compose</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
参照<br />
https://qiita.com/is_mgmt_dept/items/f4a7c64d72c2cba440c2</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
■2.基本操作<br />
以下を参考にさわってみる。<br />
https://www.ogis-ri.co.jp/otc/hiroba/technical/docker/part1.html</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
操作の概要</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
---<br />
•イメージの取得(pull)<br />
•イメージの一覧表示(images)<br />
•コンテナのライフサイクル管理 ◦作成(create)<br />
◦起動(start)<br />
◦停止(stop)<br />
◦削除(rm)</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
•コンテナの一覧表示(ps)<br />
---</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###イメージ一覧###<br />
[root@localhost ~]# docker images <br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
新しいメールが /var/spool/mail/root にあります</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###バージョン確認###<br />
[root@localhost ~]# docker -v<br />
Docker version 1.7.1, build 786b29d<br />
[root@localhost ~]# docker-compose -v<br />
docker-compose version 1.5.2, build 7240ff3</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###動作中のコンテナ一覧###<br />
[root@localhost ~]# docker ps<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###全コンテナ一覧(停止中含)###<br />
[root@localhost ~]# docker ps -a<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-top: 0px;">
■■3.hello-worldを実行</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
[root@localhost ~]#<span style="color: red;"> docker run hello-world</span><br />
Unable to find image 'hello-world:latest' locally<br />
latest: Pulling from hello-world<br />
882673a3c694: Pull complete<br />
83f0de727d85: Pull complete<br />
Digest: sha256:4555e23a9cf5a1a216bd8b0d71b08a25e4144c2ecf6adb26df9620245ba99529<br />
Status: Downloaded newer image for hello-world:latest</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
Hello from Docker!<br />
This message shows that your installation appears to be working correctly.</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
To generate this message, Docker took the following steps:<br />
1. The Docker client contacted the Docker daemon.<br />
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.<br />
(amd64)<br />
3. The Docker daemon created a new container from that image which runs the<br />
executable that produces the output you are currently reading.<br />
4. The Docker daemon streamed that output to the Docker client, which sent it<br />
to your terminal.</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
To try something more ambitious, you can run an Ubuntu container with:<br />
$ docker run -it ubuntu bash</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
Share images, automate workflows, and more with a free Docker ID:<br />
https://hub.docker.com/</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
For more examples and ideas, visit:<br />
https://docs.docker.com/engine/userguide/</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
新しいメールが /var/spool/mail/root にあります</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###全コンテナ一覧(停止中含)###<br />
[root@localhost ~]# docker ps -a<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
dfc38761efe1 hello-world "/hello" 3 minutes ago Exited (0) 3 minutes ago pensive_einstein<br />
新しいメールが /var/spool/mail/root にあります</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###イメージ一覧###<br />
[root@localhost ~]# docker images<br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
hello-world latest 83f0de727d85 3 weeks ago 1.848 kB</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br />
■■Alpine Linuxの操作<br />
Alpine Linuxコンテナ向けに開発されている軽量Linuxディストリビューション</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br />
###イメージの取得###<br />
[root@localhost ~]# docker pull alpine<br />
latest: Pulling from alpine<br />
28a0c8bbcab3: Pull complete<br />
9797e5e798a0: Pull complete<br />
Digest: sha256:ed8059bd90dd8cd6b7bfddedc7bba0f7555f766a00daf6a6efc86fa3339c09ef<br />
Status: Downloaded newer image for alpine:latest</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###イメージの確認###<br />
[root@localhost ~]# docker images<br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
hello-world latest 83f0de727d85 3 weeks ago 1.848 kB<br />
alpine latest 9797e5e798a0 3 months ago 4.143 MB<br />
[root@localhost ~]#</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###alpineイメージからコンテナを起動し、echoコマンドを実行###<br />
[root@localhost ~]# docker run alpine echo "hello from alpine"<br />
hello from alpine<br />
[root@localhost ~]#<br />
###対話操作を可能にするコマンド "-it"を付与###<br />
###プロンプトが"/ #"となり"ls"コマンドの入力が可能###<br />
[root@localhost ~]# docker run -it alpine bin/sh<br />
/ # ls<br />
bin etc lib mnt root sbin sys usr<br />
dev home media proc run srv tmp var</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###別ウィンドウで動作中のコンテナ一覧###<br />
###alpineがbin/shを実行###</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
[root@localhost ~]# docker ps<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
5dc3c0d3f46a alpine "bin/sh" 45 seconds ago Up 44 seconds
</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
### コンテナaplineを停止###<br />
[root@localhost ~]# docker stop 5dc3c0d3f46a<br />
5dc3c0d3f46a<br />
[root@localhost ~]# docker ps<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###同タイミングで別ウィンドウ上のプロンプトは<br />
/ # <br />
から<br />
[root@localhost ~]#<br />
となる。</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
### コンテナaplineを開始###<br />
[root@localhost ~]# docker start 5dc3c0d3f46a<br />
5dc3c0d3f46a<br />
[root@localhost ~]# docker ps<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
5dc3c0d3f46a alpine "bin/sh" 5 minutes ago Up 8 seconds clever_brown</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
##コンテナ操作を再開するにはattachを使用###<br />
[root@localhost ~]# docker attach 5dc3c0d3f46a<br />
/ #</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
なお、Ctrl+Cを実行しても<br />
/ #<br />
から<br />
[root@localhost ~]#<br />
へ変更できなかった。</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
■削除<br />
https://www.ogis-ri.co.jp/otc/hiroba/technical/docker/part1.html<br />
の通り、コンテナを削除<br />
その後はコンテナの起動ができないことを確認</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
[root@localhost ~]# docker rm 5dc3c0d3f46a<br />
5dc3c0d3f46a<br />
[root@localhost ~]# docker images<br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
hello-world latest 83f0de727d85 3 weeks ago 1.848 kB<br />
alpine latest 9797e5e798a0 3 months ago 4.143 MB<br />
[root@localhost ~]# docker start 5dc3c0d3f46a<br />
Error response from daemon: no such id: 5dc3c0d3f46a<br />
Error: failed to start containers: [5dc3c0d3f46a]</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
■■後片付け<br />
##導入したイメージalpineとコンテナalpineを削除###</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###コンテナの確認##<br />
###alpineは消えたと思ったのになぜかある###<br />
[root@localhost ~]# docker ps -a<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
24fe1e1924b0 alpine "echo 'hello from al 11 minutes ago Exited (0) 11 minutes ago high_torvalds<br />
dfc38761efe1 hello-world "/hello" 26 minutes ago Exited (0) 26 minutes ago pensive_einstein</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###イメージの確認###<br />
[root@localhost ~]# docker images<br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
hello-world latest 83f0de727d85 3 weeks ago 1.848 kB<br />
alpine latest 9797e5e798a0 3 months ago 4.143 MB</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###まずはイメージから削除###<br />
###-fを付けない場合、削除できなかった###<br />
###IDは IMAGE IDを指定###<br />
[root@localhost ~]# docker rmi -f 9797e5e798a0<br />
Untagged: alpine:latest<br />
Deleted: 9797e5e798a034d53525968de25bd25c913e7bb17c6d068ebc778cb33e3ff6e5<br />
Deleted: 28a0c8bbcab32237452c3dadfb8302a6fab4f6064be2d858add06a7be8c32924<br />
[root@localhost ~]# docker images<br />
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE<br />
hello-world latest 83f0de727d85 3 weeks ago 1.848 kB</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
###続いてコンテナの削除###</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
##削除前:alpineあり###<br />
[root@localhost ~]# docker ps -a<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
24fe1e1924b0 alpine "echo 'hello from al 21 minutes ago Exited (0) 21 minutes ago high_torvalds<br />
dfc38761efe1 hello-world "/hello" 36 minutes ago Exited (0) 36 minutes ago pensive_einstein</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
##削除実行:rmの後は container id を指定###<br />
[root@localhost ~]# docker rm 24fe1e1924b0<br />
24fe1e1924b0</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
##削除後:alpineなし###</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
[root@localhost ~]# docker ps -a<br />
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br />
dfc38761efe1 hello-world "/hello" 36 minutes ago Exited (0) 36 minutes ago pensive_einstein</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
イメージとコンテナの削除方法参照<br />
https://qiita.com/tifa2chan/items/e9aa408244687a63a0ae</div>
<span id="ms-rterangepaste-end"></span>
<div style="margin-bottom: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<div id="Signature">
<div dir="ltr" id="divtagdefaultwrapper" style="background-color: white; color: black; font-family: Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px;">
<div style="margin-bottom: 0px; margin-top: 0px;">
<br /></div>
<br />
<div style="margin-bottom: 0px; margin-top: 0px;">
</div>
</div>
</div>
</div>
<span style="background-color: white; color: black; cursor: auto; display: inline; float: none; font-family: "calibri" , "helvetica" , sans-serif , "emojifont" , "apple color emoji" , "segoe ui emoji" , "notocoloremoji" , "segoe ui symbol" , "android emoji" , "emojisymbols"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
</span><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike>マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-48665182463555500182018-05-04T23:04:00.003+09:002018-05-04T23:04:44.909+09:00ksnctf square cipher解いてみた。問題文の意味を調べると<br />
four square-cipherなる暗号とのこと。<br />
http://www.crypto-online.net/eng/four-square.html<br />
を利用して、1行ずつ解読していけばFLAGがどこかに<br />
現れると思ったが、うまくいかず。これで3時間くらいは要した。<br />
<br />
他方針にいくのは、自力だと難しい。<br />
これは、自力ではとけなかったので、writeupを参照した。<br />
大文字と小文字と並んでいる数に着目するとのこと。<br />
<br />
以下の方法でFLAGゲット。<br />
<br />
1.pythonでいかのようなプログラムを作成<br />(最初はこんなプログラムは書かず、3をやろうとするとめちゃめちゃ大変だった)<br />
大文字なら0、小文字なら1へ変換するプログラム。<br />
LIST = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]<br />list = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]<br />for i in "aBCDe":<br /> if i in list:<br /> print "1",<br /> elif i in LIST:<br /> print "0",<br />
<br />
2.1の結果をテキストファイルにコピペ。<br />そして31行ずつで区切る。これは力業。<br />
<br />
3.エクセルに張り付け。<br />あらかじめ、正方形用のシートを用意しておく。<br />1マスに1文字入るようにあからじめテキスト加工→貼り付け。<br />そして、1のみを黒く塗りつぶす。<br />http://office-qa.com/Excel/ex210.htm<br />
<br />
4.該当画像を取得。<br />Irfanviewで余計な部分をカット。<br />QRコードを読み取るWebサイト<br />https://tool-taro.com/qr_code_decode/<br />にて、解読するとFLAGがでてくる。<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-47296526353606802422018-05-02T21:02:00.000+09:002018-05-02T21:02:00.259+09:00ksnctf Johnを解いてみた。Johnってなんだ??とか思いながら。チャレンジ。<br />
<br />
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
user99</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
の部分は</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
http//ksnctf.sweetduet.info/q/14/dicti0nary_8Th64ikELWEsZFrf.txt</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
とするとなぜか文字列がたくさん!!</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
なんだこれは??</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
FLAG</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
で検索するもノーヒット。</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
これが何の役にたつのか最初はさっぱりわからなかった。</div>
<div style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<br /></div>
問題文から/etc/passwdかと思った。調べると実際には/etc/shadowの内容と非常に酷似しているようだ。<br />
<br />
解答を得る方法として、以下を思いつく。<br />
/etc/shadow内の内容を復号する方法と同じ方法で問題文の情報を復号してみる。<br />
<br />
復号方法を調べると、[John the ripper]なるソフトがあることが判明。<br />
<br />
これはまさしく問題文のjohnと<br />
<br />
手元にvirtualbox上にkali linuxがあるので、John the ripperがあるかみたら、あった!!<br />
<br />
ラッキー<br />
<br />
つづいて解いてみる。<br />
<br />
John the ripperの使い方は<br />
以下のページを参考<br />
<a href="http://kontany.net/blog/?p=128" target="_blank">パスワードクラックツール JOHN THE RIPPER 使い方まとめ</a><br />
<br />
解析手法としてwordlistなるオプションがある<br />
<br />
なるほど、<br />
wordlistに設定するファイル名を<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">http//ksnctf.sweetduet.info/q/14/dicti0nary_8Th64ikELWEsZFrf.txt</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">にある情報を指定すればよいのか!!</span><br />
<b><br /></b>
<b><br /></b>
ただし、最初は以下のエラーが発生。<br />
#unshadow john14 > un_john14<br />
#john --wordlist=***/dict14 un_john14<br />
Using default input encoding: UTF-8<br />
No password hashes loaded (see FAQ)<br />
<br />
<br />
<br />
john14の内容は<br />
問題文の内容をコピペ<br />
vi john<br />
で作成<br />
<br />
dict14の内容は<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">http//ksnctf.sweetduet.info/q/14/dicti0nary_8Th64ikELWEsZFrf.tx</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">vi dict14</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">で作成</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span>
何が悪いのか。<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">エラーについてググるもよくわからず。</span><b></b><br />
上記リンクで指定されたファイル(/etc/passwd,/etc/shadow,<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: meiryo,arial,helvetica,osaka,"MS PGothic",sans-serif; font-size: 17px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 27px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">/usr/share/dict/words</span>)で同じことをやると正常実行できる。<br />
<br />
そこでunshadowコマンドの実施をせずに、問題内容をviではりつけたファイルそのものを<br />
unshadowせずに、実行するとみごと各ユーザーに対するPWを得られた。<br />
#john --listword=***/14dict john14<br />
~~~<br />
~~~<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">floating (user13)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
HELD (user10)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
ADDITIONAL (user02)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
ultimate (user08)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
opinion (user15)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
karaoke (user17)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
zero (user19)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
QUESTION (user16)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
SPIRITS (user06)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
DELIGHT (user20)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
__________ (user04)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
GENDER (user03)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
FREQUENT (user00)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
JENNY (user09)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
SUFFERS (user11)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
strange (user18)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
zecht (user14)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
independent (user07)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
applies (user05)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
LATTER (user01)</span><br style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" /><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
LEAVE (user12)</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">~~~</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">~~~</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span>
ただし、この後がよくわからなかった。<br />
<br />
ただ、もう一度みるとFとかLとかAがある!!<br />
<br />
そこでuser00から並べ替えると、F -> L ->A ->Gとなっている。<br />
つまり、FLAGは、user00から昇順で並べ替えた時各PWの1文字目がFLAGとなっていると予想。<br />
<br />
みごと正解した。<br />
<br />
やっと自力で解けた!!<br />
<br />
とってもうれしい。マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-64814829926902416292018-05-01T22:04:00.003+09:002018-05-01T22:04:52.917+09:00ksnctf basic is secureを解くまずは該当ファイルをwiresharkで開く。<br />
httpで絞る<br />
問題タイトルから<br />basic認証→IDとPWが該当フラグではないか?<br />(前にやったことがあったから推測)<br />と推測<br />
GET /~q8/<br />の部分をみると<br />Authorization: Basicの行がある<br />これが実際の認証情報。<br />ただしこれはフラグではなかった。<br />Authorization: Basicの行をクリックすると<br />Credentialsの行が現れる。<br />ここにFLAGあり。<br />正解だった。<br />ちなみに、Authorization: Basicの値を<br />echo '~~~' | base64 -d<br />とするとFLAGをGETできる。<br />
http://opooner.hatenablog.com/entry/2014/07/20/032702<br />
----<br />ちなみに,WebでBasic認証をするときIDとPassをコロンでつなげたid:Passがbase64でエンコードされているらしい<br />----マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-51625656189629643062018-05-01T00:19:00.001+09:002018-05-01T00:19:37.523+09:00ksnctf math Ⅱをトレース解答では2分探索で解けるとのこと。<br />
以下のところで、FLAGは得られた。<br />
<a href="http://www.cyamax.com/entry/2017/09/03/004419" target="_blank">ksnctf #17 Math II </a><br />
<span id="goog_569159955"><br /></span>
ただし、対数の計算では正確な数字を得られなかった。<br />
<br />
Y^101=X(X=12341234と仮で置き換え)<br />
となるYを求める。<br />
<br />
log<span style="font-size: xx-small;">y</span>Y^101=log<span style="font-size: xx-small;">y</span>X<br />
101=log<span style="font-size: xx-small;">y</span>12341234<br />
log<span style="font-size: xx-small;">y</span>12341234=log<span style="font-size: xx-small;">10</span>12341234 / log<span style="font-size: xx-small;">10</span>Y<br />
<br />
と対数の公式から置き換えられる。<br />
<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">pythonが導入された環境で</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">12341234(1234は問題上のx=の数字)を解く。</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span>
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">>>import math</span><br />
>>print(math.log(10,2748……))<br />
3912.43902305<br />
<br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">y</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">12341234=log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">12341234 / log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Y=101</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">より</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">101*<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Y=<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">12341234 =<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">3912.43902305</span></span></span></span><br />
<b><i><u><sub><br /></sub></u></i></b>
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">log</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; font-family: Times New Roman; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">10</span><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Y=<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">3912.43902305 / 101 = 38.7370200302</span></span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">>>print <span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">3912.43902305 / 101</span></span></span><br />
で計算<br />
Y=10^<span style="-webkit-text-stroke-width: 0px; background-color: transparent; color: black; display: inline !important; float: none; font-family: Times New Roman; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">38.7370200302</span><br />
10の約38乗が今回の答え。<br />
ただしpythonで求めると<br />
>>print(math.pow(10,38.7370200302))<br />
5.45783032701e+38<br />
となった。<br />
この値では、不正解だった。<br />
解答の値と比較すると考え方は問題ない。<br />
ただし、上記の計算方法だとeという文字が表示されてしまいすべてを数字で表現できなかった。<br />
<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-37142508682325655452018-04-21T21:04:00.000+09:002018-04-21T21:04:58.564+09:00ksnctf simple auth の解答をトレース Simple Auth<br />
をトレースする。<br />
自力で解きたいが、まだまだ力不足なのでしばらくは他の人のブログを参考にしています。<br />
<br />
問題はこちら<br />
http://ksnctf.sweetduet.info/problem/32<br />
<br />
他の人のブログをみてみる<br />
「\[strcasecmp()] simple authメモ - Namareba食べたい」<br />
http://namareba.hatenablog.com/entry/2014/06/21/014412<br />
?password[]=hoge<br />
のように書き換えればよいと記載。<br />
fiddlerなるツールで書き換えたらしい。<br />
fiddlerは今ないので、一旦とばし。<br />
https://github.com/jacobsoo/ksnctf-Challenges/tree/master/Simple-Auth<br />
回答がかいてある。<br />
----<br />
import urllib<br />
import urllib2<br />
url = 'http://ctfq.sweetduet.info:10080/~q32/auth.php'<br />
data = {<br />
"password[]": "hello",<br />
}<br />
req = urllib2.Request(url, urllib.urlencode(data), headers={'Content-type': 'application/x-www-form-urlencoded', 'Accept' : 'text/plain'})<br />
resp = urllib2.urlopen(req)<br />
szPage = resp.read()<br />
print szPage<br />
----<br />
このスクリプトを書いてauth.phpという名前で保存。<br />
http://localhost/auth.php<br />
や<br />
コマンドで<br />
php auth.php<br />
を実行するもt、FLAGがでてこない。<br />
どうやったら、上記のスクリプトがうまく動くかがわからない。<br />
保留<br />
<br />
http://orangetech.hateblo.jp/entry/2017/02/08/113447<br />
「chromeデバッカで少し書き換えて、適当な文字列入れてsubmitするとFLAGが表示されます。」<br />
<br />
chromeがないので、保留。<br />
<br />
https://qiita.com/nana0723japan/items/56d668f170f6443b24c3<br />
firebug<br />
環境用意が必要そう。いったん保留。<br />
<br />
http://imoimo.hatenadiary.com/entry/2017/02/17/161816<br />
具体的な実行環境の情報なし<br />
<br />
<br />
以下の方針のもと、調査を続行<br />
http://ksnctf.sweetduet.info/q/32/auth.php<br />
を一部書き換えて実行してみる。<br />
<br />
疑問<br />
どうやってphpを実行する?<br />
<br />
centos6にphpをインストールして以下コマンドを実行してみた。<br />
yum -y install php php-devel php-mbstring php-mysql php-mcry pt php-gd php-pear php-pecl-apc<br />
chmod 755 auth.php<br />
./php auth.php<br />
auth.phpは問題文のsourceをコピペ<br />
<br />
結果<br />
ソースファイルが表示されるだけ。<br />
<br />
一体全体何をすればいいのかなあ?<br />
phpを実行する方法がなんかそもそも違っている気がする。<br />
<br />
結局は、他ページを探すことで回答を得る。<br />
curlコマンドで一発解決している事例あり。<br />
http://blog.theo.com.tw/Writeups/ksnctf/ksnctf-32-Simple-Auth/<br />
<br />
<br />
最終的には、以下のコマンドでフラグゲット<br />
curl -X POST -F ' password="" ' http://ctfq.sweetduet.info:1<br />
0080/~q32/auth.php<br />
反省<br />
phpは、もっと初歩的な知識を体系的に学ばないと他の人のサイト見ても使いこなせない。マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-84096852190422649992017-04-29T22:01:00.001+09:002017-04-29T22:01:45.368+09:00ctf Simple Auth IIの解答をトレースしてみた writeupSQLインジェクションの問題を解きたく、この問題にチャレンジ。<br />
が結果的にはSQLインジェクションとはそもそも関係なさそう。<br />
<br />
今回は、他サイトの解法をそのままトレースすることにした。<br />
<br />
参考サイト<br />
<br />
http://imoimo.hatenadiary.com/entry/2016/06/24/175733<br />
<br />
http://timeislong.hatenablog.com/entry/2016/07/13/183000<br />
<br />
<br />
https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q10138372915<br />
開放の考え方が参考になる。<br />
<br />
FLAGゲットをするストーリーとしては<br />
データベースの中身からFLAGを探す<br />
じゃあデータベースをみるには?<br />
ー>ダウンロードを試みる<br />
ーー>どうやってダウンロードする??<br />
ーーーー>しかし、webアドレスの一部を変えてダウンロードできるっていう考えがなかなかたどりつかない。<br />
これはなれるしかないか?<br />
<br />
1.<br />
http://ksnctf.sweetduet.info/problem/35<br />
<br />
内の2つのサイトを開く<br />
<br />
2.<br />
<br />
<br />
http://ctfq.sweetduet.info:10080/~q35/auth.php<br />
を<br />
http://ctfq.sweetduet.info:10080/~q35/database.db<br />
として実行<br />
ー><br />
database.dbがダウンロード<br />
<br />
3.database.dbに対してsqlite3コマンドを実行<br />
ー>その後selectコマンドでフラグをゲット<br />
<br />
ctf4b@ctf4b-vm:~$ pwd<br />
/home/ctf4b<br />
tf4b@ctf4b-vm:~$ cd Downloads/<br />
ctf4b@ctf4b-vm:~/Downloads$ ls<br />
database.db<br />
ctf4b@ctf4b-vm:~/Downloads$ ls -l<br />
合計 4<br />
-rw-rw-r-- 1 ctf4b ctf4b 2048 4月 29 21:01 database.db<br />
ctf4b@ctf4b-vm:~/Downloads$<br />
ctf4b@ctf4b-vm:~/Downloads$ sqlite3 database.db<br />
SQLite version 3.11.0 2016-02-15 17:29:24<br />
Enter ".help" for usage hints.<br />
sqlite> select * from user;<br />
root|FLAG_iySDmApNegJvwmxN<br />
sqlite><br />
<br />
<br />
問題は一応とけた。だが疑問点あり<br />
<br />
疑問<br />
<br />
sourceの中からどうしてdatabase.dbにそもそも着目できる??<br />
source部分には、database.dbは以下の1箇所。<br />
推測:database.db前後の以下の式は、id,pwを入力すると直接実行されるSQL文ということか?<br />
------<br />
<br />
if ($_POST['id']!=='' or $_POST['password']!=='')<br />
{<br />
$try = true;<br />
$db = new PDO('sqlite:database.db');<br />
$s = $db->prepare('SELECT * FROM user WHERE id=? AND password=?');<br />
$s->execute(array($_POST['id'], $_POST['password']));<br />
$ok = $s->fetch() !== false;<br />
}<br />
------<br />
<br />
sqlite3とはそもそも何か?<br />
SQLiteのデータベースを操作するためのコマンド<br />
<br />
https://hydrocul.github.io/wiki/commands/sqlite.html<br />
<br />
上記で実施した<br />
sqlite3 database.db<br />
とは<br />
sqlite3 データベース名<br />
でデータベースへ接続するコマンドを実行していることを意味する。<br />
<br />
そこからselectでデータベースの中身を調べてFLAGを探す<br />
今回はselect * from user;<br />
でflagをget<br />
これはselect * from user;自体はもはや決まり文句のようなコマンド?<br />
<br />
もしくはsource内のSELECT * FROM userを参考にしたか??<br />
PHPあたりを勉強するともっとわかるのだろうか??<br />
<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-35663466004165739282017-03-05T21:23:00.003+09:002017-03-25T20:26:38.748+09:00kali linuxのインストールとWing IDEの準備<a href="http://t0.gstatic.com/images?q=tbn:ANd9GcQEozJQfyEnLEjva1-okwYigVh2r8rGvJ431U2NTbKKdDzVL1IJ" target="_blank">サイバーセキュリティプログラミング pythonで学ぶハッカーの思考</a><br />
を購入<br />
<br />
さっそく、第1章を読んで、kali linuxとWing IDEを導入<br />
kali linuxはVirtualBoxに導入<br />
参照ページは<a href="https://www.websec-room.com/2014/01/07/1485" target="_blank">こちら</a><br />
<br />
その後、python環境の確認と必要パッケージの導入実施<br />
以下コマンドのみ紹介<br />
<br />
###バージョン確認###<br />
#python --version<br />
<br />
###パッケージ管理ツールのインストール###<br />
#apt-get install python-setuptools pytho-pip<br />
<br />
###GitHubを使ったトロイの木馬をビルドするために使うモジュールのインストール###<br />
#pip intall github3.py<br />
<br />
###正しくインストールされたかの確認###<br />
#python<br />
>>>import github3<br />
>>>exit()<br />
<br />
<br />
続いてWing IDEの導入<br />
結果からいうと本に記載のあるdebの導入は失敗<br />
dpkg -i <a href="https://wingware.com/pub/wingide/5.1.5/wingide5_5.1.5-1_amd64.deb">wingide5_5.1.5-1_amd64.deb</a><br />
(本では<a href="https://wingware.com/pub/wingide/5.1.5/wingide5_5.1.5-1_i386.deb">wingide5_5.1.5-1_i386.deb</a> しかし検証環境は64bitのためamd64.debを使用)<br />
<br />
https://wingware.com/pub/wingide/5.1.5/<br />
より<br />
<a href="https://wingware.com/pub/wingide/5.1.5/wingide-5.1.5-1-x86_64-linux.tar.gz">wingide-5.1.5-1-x86_64-linux.tar.gz</a><br />
をダウンロードして導入<br />
導入手順は<a href="http://www.yukun.info/blog/2015/02/python-kali-linux-wingide-install.html" target="_blank">こちら</a>を参照<br />
<br />
起動は、GUIからはできなかった。<br />
以下のコマンドでWingIDEを起動<br />
#wing5.1<br />
<br />
その後は<br />
[Stack Data]タブ<br />
<br />
[Debug Probe]タブ<br />
の使い方の説明あり。<br />
[Debug Probe]タブについては<br />
エディタ画面に以下のコマンドを記載<br />
converted_integer<br />
1<br />
converted_interger = 2<br />
その後F5を押すとスクリプトの実行を再開できると本には説明がある。<br />
F5をおしてみたが、実際成功しているのかどうかがよくわからない。<br />
<br />
予定<br />
<a href="http://t0.gstatic.com/images?q=tbn:ANd9GcQEozJQfyEnLEjva1-okwYigVh2r8rGvJ431U2NTbKKdDzVL1IJ" target="_blank">サイバーセキュリティプログラミング pythonで学ぶハッカーの思考</a><br />
の2章実施<br />
<br />
<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com1tag:blogger.com,1999:blog-4544021855858494328.post-26714103252464831012017-01-15T02:10:00.001+09:002017-01-15T02:10:11.928+09:00esxi 5.5から6.5へアップデート時Initializing IOV発生_以下の手順で、esxi 5.5から6.5へアップデート<br />
<br />
環境<br />
作業環境:windows10<br />
esxiはHP ML110 G7にインストール<br />
<br />
1.esxi6.5のisoイメージをダウンロード<br />
<br />
2.isoイメージをDVDに書き込み<br />
<br />
3.esxi環境にdvdをセット。<br />
<br />
4.esxiを再起動。再起動後、F11をクリック⇒dvdで起動する<br />
<br />
5.6.5のインストーラーを選択。<br />
<br />
6.initializing IOVとなって、そのまま処理が止まった。<br />
<br />
以下のページに対処方法の記載あり。<br />
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q14155250564<br />
<br />
VMインストーラー起動直後にShift Oを押す(画面下部に記載あり)<br /> ↓<br /> 出てきたコマンドの後ろにそのまま(スペース)noIOMMUを入力してエンター<br /> ↓<br /> 普通にインストール→完了したらDVDメディアを取り出して、再起動<br /> ↓<br /> また最初の起動画面でShift Oを押す(画面下部に記載あり)<br /> ↓<br /> 出てきたコマンドの後ろにそのまま(スペース)noIOMMUを入力してエンター<br /> ↓<br /> 普通にVMが起動するので、トラブルシューティングオプションからSSHを使用するよう設定する。またIPアドレスを振って外部からSSH接続できるようにしておく<br /> ↓<br /> 外部のPCからSSH接続(チャレンジレスポンス)で接続し、そのあとに<br /> vi /bootbank/boot.cfg<br /> 開いたらkerneloptの項目の後ろに(スペース)noIOMMUを入力し保存する。<br />
<br />
例<br />
------<br />
bootstate=0<br />kernel=tboot.b00<br />title=Loading VMware ESXi<br />kernelopt=no-auto-partition <span style="color: red;">noIOMMU</span><br />modules=b.b00 --- jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- char<br />build=6.5.0-4564106<br />updated=2<br />
------<br />↓<br /> 再起動してみて<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike>マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-15726758974845810112016-08-13T18:51:00.002+09:002016-08-29T23:36:28.132+09:00centos6でRMforgeのインストール<div>
<div class="color1">
centos6インストール後、初期設定にてRMforgeのインストールを試みるも失敗。</div>
<div class="color1">
<br /></div>
<div class="color1">
実行コマンドは以下</div>
<div class="color1">
#<a href="https://www.server-world.info/command/html/yum.html"><span style="color: black;"><b>yum</b></span></a><span style="color: black;"><b> -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm</b></span></div>
<div class="color1">
<br /></div>
<div class="color1">
参考サイト</div>
<div class="color1">
<a href="https://www.server-world.info/query?os=CentOS_6&p=initial_conf&f=6" target="_blank">リポジトリを追加する</a></div>
<div class="color1">
http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm</div>
<div class="color1">
へアクセスしても失敗するのでアドレスが変わった模様。</div>
<div class="color1">
<b><br /></b></div>
<div class="color1">
ググって直接ダウンロード</div>
<div class="color1">
サイトは以下</div>
<div class="color1">
http://www.mirrorservice.org/sites/apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/</div>
<div class="color1">
ダウンロードしたファイル名</div>
<div class="color1">
<a href="http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm">rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm</a></div>
<div class="color1">
<table><tbody>
<tr><td align="right">2013-03-20 15:59 </td><td align="right">12K</td><td></td></tr>
</tbody></table>
<b></b><i></i><u></u><sub></sub><sup></sup><strike></strike></div>
</div>
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-75555124534595369902016-07-23T00:35:00.000+09:002016-08-04T00:33:25.472+09:00virsh startコマンド実行時モニターに接続中にプロセスが終了しましたエラー発生centos7環境でKVM環境を構築し、ゲストOSの作成にも成功。<br />
<br />
その後<br />
<a href="https://centossrv.com/kvm-clone.shtml" target="_blank">https://centossrv.com/kvm-clone.shtml</a><br />
を参考にゲストOSの複製<br />
<br />
しかし複製したゲストOSを起動時にエラー発生。<br />
<br />
[root@centos7 ~]# virsh start centos7guest2<br />
エラー: ドメイン centos7guest2 の起動に失敗しました<br />
エラー: 内部エラー: モニターに接続中にプロセスが終了しました: 2016-07-22T15:21:26.084792Z qemu-kvm: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-centos7guest/org.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such file or directory<br />
2016-07-22T15:21:26.084864Z qemu-kvm: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain-centos7guest/org.qemu.guest_agent.0,server,nowait: chardev: opening backend "socket" failed<br />
<br />
以下の手順で回避<br />
[root@centos7 ~]# virsh edit centos7guest2<br />
<br />
<channel type="unix"><br /> <source mode="bind" path="/var/lib/libvirt/qemu/channel/target/domain-<b><font color="#ff0000">centos7guest2</font></b>/org.qemu.guest_agent.0"></source><br /> <target name="org.qemu.guest_agent.0" type="virtio"><br /> <address bus="0" controller="0" port="1" type="virtio-serial">
<br /> </address>
</target></channel><address bus="0" controller="0" port="1" type="virtio-serial">
</address>
<br />
/*** 赤字部分を、複製後の仮想マシンを設定***/<br />
/****viコマンドと同じ要領で編集可能***/<br />
<br />
<br />
[root@centos7 ~]# virsh start centos7guest2<br />
ドメイン centos7guest2 が起動されました<br />
[root@centos7 ~]#<br />
<br />
参考<br />
<a href="http://komeiy.hatenablog.com/entry/2016/01/16/175030" target="_blank">ぽぽぽぽーんのネットワークとOSS</a>マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-61929712806696594842016-07-07T18:52:00.002+09:002016-07-07T18:52:48.357+09:00Inspiron 3521でwindows7からwindows10へのアップグレードに成功Windows7を利用しているが、Windows10への無償アップグレードの期限が7月29日までということで、アップデートを実施した。<br />
<br />
1.まずはバックアップ<br />
念のため、イメージとフォルダ単位の2通りでバックアップ実施。<br />
参照サイトは<a href="https://blogs.technet.microsoft.com/cs3_windows/2015/07/28/windows-7/" target="_blank">こちら</a><br />
バックアップ先はバッファロー製の外付けHDD<br />
1つイメージのバックアップで約2時間。<br />
フォルダ単位のバックアップで約2時間。<br />
バックアップは夜中に実施。<br />
<br />
2.windows10のアップグレード<br />
翌日は8時30頃から、Windows10のアップデート作業に入る。<br />
以下のサイトのstep1から順番に参照にして、アップデート作業を実施。<br />
<a href="https://www.microsoft.com/ja-jp/atlife/article/windows10/guide/03.aspx" target="_blank">Windows10アップグレードガイド</a><br />
途中media centerを削除する旨のメッセージが表示されるなど、ガイドには載っていない画面ショットも少しみられる。<br />
9時から作業してその後、仮眠をとって11時ごろにおきたらstep5まで移動していた。<br />
その後step22までにおよそ1時間で終了。<br />
<br />
<br />
その後はDVDを再生するため以下のサイト参考にしてWindowsDVDプレイヤーを導入。<br />
手元にあるDVDは特に問題なく再生できている。<br />
<br />
合計作業時間 約5時間。<br />
<br />
その他気づいたこと<br />
Windows7のデスクトップ上にあるアイコンはそのままWindows10でも残っている。<br />
フリーソフトの<a href="http://soft.edolfzoku.com/hayaemon2/" target="_blank">ハヤえもんは</a>、Windows10でも動作しました。<br />
ハヤえもんのバージョンは2.52でした。<br />
<br />
<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-55102108999199326232016-03-27T23:32:00.001+09:002016-03-27T23:32:30.384+09:00/varの空き領域を増やす_centos6# df -h /***既存の/varの空き容量を確認***/<br />Filesystem Size Used Avail Use% Mounted on<br />/dev/mapper/vg_centos6-lv_root<br /> 69G 59G 6.4G 91% /<br />tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />/dev/sda1 477M 142M 310M 32% /boot<br />/dev/mapper/vg_centos6-lv_home<br /> 174G 61M 165G 1% /home<br /><span style="color: red;">/dev/mapper/vg_centos6-lvol0<br /> 60G 32G 25G 57% /var</span><br />
kvmのイメージファイルを/var/kvm/image以下に保存したい。<br />
<br /># ls /var/kvm/images/<br />template1.img www1.img<br />
<br />
# du -h /var/kvm/images/<br />32G /var/kvm/images/<br />
<br />
/varの空き容量を40G増やすことにする。<br />
<br />
# lvdisplay<br /> --- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_root<br /> LV Name lv_root<br /> VG Name vg_centos6<br /> LV UUID 0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:27:49 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 70.00 GiB<br /> Current LE 17920<br /> Segments 3<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:0<br />
--- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_home<br /> LV Name lv_home<br /> VG Name vg_centos6<br /> LV UUID F6FT0Y-TKse-zeMy-dEwc-JBMW-66fG-x9GxGW<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:28:16 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 176.58 GiB<br /> Current LE 45205<br /> Segments 1<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:2<br />
--- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_swap<br /> LV Name lv_swap<br /> VG Name vg_centos6<br /> LV UUID 9OSVwv-wmEa-CYcA-aYn0-q3Br-0CmH-tUliqW<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:29:42 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 5.81 GiB<br /> Current LE 1488<br /> Segments 1<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:1<br />
--- Logical volume ---<br /> LV Path /dev/vg_centos6/lvol0<br /> LV Name lvol0<br /> VG Name vg_centos6<br /> LV UUID aeIEuE-jj2a-pDTV-N2pL-BCSG-W8e5-NX3gw7<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2016-03-24 12:18:36 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 60.00 GiB<br /> Current LE 15360<br /> Segments 2<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:3<br />
# vgdisplay /***空き容量があることを確認***?<br /> --- Volume group ---<br /> VG Name vg_centos6<br /> System ID<br /> Format lvm2<br /> Metadata Areas 2<br /> Metadata Sequence No 9<br /> VG Access read/write<br /> VG Status resizable<br /> MAX LV 0<br /> Cur LV 4<br /> Open LV 4<br /> Max PV 0<br /> Cur PV 2<br /> Act PV 2<br /> VG Size 2.05 TiB<br /> PE Size 4.00 MiB<br /> Total PE 536424<br /> Alloc PE / Size 79973 / 312.39 GiB<br /><span style="color: red;"> Free PE / Size 456451 / 1.74 TiB</span><br /> VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
<br /># lvextend -L +40G /dev/vg_centos6/lvol0 /***/varに割り当てられた論理ボリュームを40G増やす***/<br /> Size of logical volume vg_centos6/lvol0 changed from 60.00 GiB (15360 extents) to 100.00 GiB (25600 extents).<br /> Logical volume lvol0 successfully resized<br /><br /># df -h /***/varはまだ増えていない***/<br />Filesystem Size Used Avail Use% Mounted on<br />/dev/mapper/vg_centos6-lv_root<br /> 69G 59G 6.4G 91% /<br />tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />/dev/sda1 477M 142M 310M 32% /boot<br />/dev/mapper/vg_centos6-lv_home<br /> 174G 61M 165G 1% /home<br /><span style="color: red;">/dev/mapper/vg_centos6-lvol0<br /> 60G 32G 25G 57% /var</span><br /># vgdisplay /***Freeの値は減っている***/<br /> --- Volume group ---<br /> VG Name vg_centos6<br /> System ID<br /> Format lvm2<br /> Metadata Areas 2<br /> Metadata Sequence No 10<br /> VG Access read/write<br /> VG Status resizable<br /> MAX LV 0<br /> Cur LV 4<br /> Open LV 4<br /> Max PV 0<br /> Cur PV 2<br /> Act PV 2<br /> VG Size 2.05 TiB<br /> PE Size 4.00 MiB<br /> Total PE 536424<br /> Alloc PE / Size 90213 / 352.39 GiB<br /> <span style="color: red;"> Free PE / Size 446211 / 1.70 TiB</span><br /> VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
<br />
[root@centos6 ~]# resize2fs /dev/vg_centos6/lvol0 /***論理ボリュームの容量を/varに反映させる***/<br />resize2fs 1.41.12 (17-May-2010)<br />Filesystem at /dev/vg_centos6/lvol0 is mounted on /var; on-line resizing required<br />old desc_blocks = 4, new_desc_blocks = 7<br />Performing an on-line resize of /dev/vg_centos6/lvol0 to 26214400 (4k) blocks.<br />The filesystem on /dev/vg_centos6/lvol0 is now 26214400 blocks long.<br />
<br /># df -h /***/varの空き容量が増えている***/<br />Filesystem Size Used Avail Use% Mounted on<br />/dev/mapper/vg_centos6-lv_root<br /> 69G 59G 6.4G 91% /<br />tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />/dev/sda1 477M 142M 310M 32% /boot<br />/dev/mapper/vg_centos6-lv_home<br /> 174G 61M 165G 1% /home<br /><span style="color: red;">/dev/mapper/vg_centos6-lvol0<br /> 99G 32G 62G 34% /var</span><br />#マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-64050985385690531302016-03-26T22:11:00.001+09:002016-03-26T22:11:25.184+09:00論理ボリュームを作成して/varの空き容量を増やす_centos6# vgdisplay /***空き容量があることとボリュームグループ名を確認***/<br /> --- Volume group ---<br /> <span style="color: red;">VG Name vg_centos6</span><br /> System ID<br /> Format lvm2<br /> Metadata Areas 2<br /> Metadata Sequence No 6<br /> VG Access read/write<br /> VG Status resizable<br /> MAX LV 0<br /> Cur LV 3<br /> Open LV 3<br /> Max PV 0<br /> Cur PV 2<br /> Act PV 2<br /> VG Size 2.05 TiB<br /> PE Size 4.00 MiB<br /> Total PE 536424<br /> Alloc PE / Size 62053 / 242.39 GiB<br /> <span style="color: red;">Free PE / Size 474371 / 1.81 TiB </span><br /> VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
# lvcreate -L 20G /dev/vg_centos6 /***論理ボリュームを作成。lvol0が新規作成される***/<br /> Logical volume "<span style="color: red;">lvol0</span>" created.<br /># lvdisplay /***論理ボリュームlvol0が作成されていることを確認***/<br /> --- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_root<br /> LV Name lv_root<br /> VG Name vg_centos6<br /> LV UUID 0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:27:49 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 60.00 GiB<br /> Current LE 15360<br /> Segments 2<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:0<br />
--- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_home<br /> LV Name lv_home<br /> VG Name vg_centos6<br /> LV UUID F6FT0Y-TKse-zeMy-dEwc-JBMW-66fG-x9GxGW<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:28:16 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 176.58 GiB<br /> Current LE 45205<br /> Segments 1<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:2<br />
--- Logical volume ---<br /> LV Path /dev/vg_centos6/lv_swap<br /> LV Name lv_swap<br /> VG Name vg_centos6<br /> LV UUID 9OSVwv-wmEa-CYcA-aYn0-q3Br-0CmH-tUliqW<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2015-12-05 22:29:42 +0900<br /> LV Status available<br /> # open 1<br /> LV Size 5.81 GiB<br /> Current LE 1488<br /> Segments 1<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:1<br />
--- Logical volume ---<br /> <span style="color: red;">LV Path /dev/vg_centos6/lvol0<br /> LV Name lvol0<br /> VG Name vg_centos6<br /> LV UUID aeIEuE-jj2a-pDTV-N2pL-BCSG-W8e5-NX3gw7<br /> LV Write Access read/write<br /> LV Creation host, time centos6, 2016-03-24 12:18:36 +0900<br /> LV Status available<br /> # open 0<br /> LV Size 20.00 GiB<br /> Current LE 5120<br /> Segments 1<br /> Allocation inherit<br /> Read ahead sectors auto<br /> - currently set to 256<br /> Block device 253:3</span><br />
# mkfs -t ext3 /dev/vg_centos6/lvol0 /***作成した論理ボリュームに対してファイルシステムを作成***/<br />mke2fs 1.41.12 (17-May-2010)<br />Filesystem label=<br />OS type: Linux<br />Block size=4096 (log=2)<br />Fragment size=4096 (log=2)<br />Stride=1 blocks, Stripe width=0 blocks<br />1310720 inodes, 5242880 blocks<br />262144 blocks (5.00%) reserved for the super user<br />First data block=0<br />Maximum filesystem blocks=4294967296<br />160 block groups<br />32768 blocks per group, 32768 fragments per group<br />8192 inodes per group<br />Superblock backups stored on blocks:<br /> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br /> 4096000<br />
Writing inode tables: done<br />Creating journal (32768 blocks): done<br />Writing superblocks and filesystem accounting information: dodone<br />
This filesystem will be automatically checked every 31 mounts or<br />180 days, whichever comes first. Use tune2fs -c or -i to override.<br /># mount /dev/vg_centos6/lvol0 /var /***論理ボリュームを/varにマウント***/<br /># df -h /***/varに空き容量があることを確認***/<br />Filesystem Size Used Avail Use% Mounted on<br />/dev/mapper/vg_centos6-lv_root<br /> 59G 59G 0 100% /<br />tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />/dev/sda1 477M 142M 310M 32% /boot<br />/dev/mapper/vg_centos6-lv_home<br /> 174G 61M 165G 1% /home<br /><span style="color: red;">/dev/mapper/vg_centos6-lvol0<br /> 20G 173M 19G 1% /var</span><br /># echo /dev/vg_centos6/lvol0 /var ext3 defaults 1 1 >> /etc/fstab /***再起動後もマウントされる状態にする***/<br />
<br />
<br />
参考:<a href="https://centossrv.com/lvm-create.shtml" target="_blank">論理ボリューム追加</a><br />
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-31745908552097203322016-03-22T06:11:00.000+09:002016-03-22T06:11:08.728+09:00virt-cloneコマンド実行後、空き領域が足りないエラーが出たのでディスク増設実施ゲストOSのクローン作成をするも空き領域が足りない。<br />
# virt-clone -o www -n www2 -f /var/kvm/images/www2.img<br />
<br />
ERROR ディスクを作成するための十分な空き領域がありません。 30720 MBの要求 > 13898 MBの空き<br />
<br />
サーバーシャットダウン後、物理ディスク(2TB)を追加して起動。<br />
以下のサイトを参考にして/extdisk1に1.7T追加されるようになった。<br />
<a href="http://kajuhome.com/disk_extension.shtml">http://kajuhome.com/disk_extension.shtml</a><br />
<br />
# df -h<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/mapper/vg_centos6-lv_root<br />
50G 43G 4.3G 91% /<br />
tmpfs 2.9G 84K 2.9G 1% /dev/shm<br />
/dev/sda1 477M 142M 310M 32% /boot<br />
/dev/mapper/vg_centos6-lv_home<br />
174G 61M 165G 1% /home<br />
/dev/sdb1 1.8T 196M 1.7T 1% /extdisk1 /***/extdisk1を作成してmountコマンド実施済***/<br />
<br />
その後virt-clone を実行するも変わらず。<br />
たぶん<br />
/dev/mapper/vg_centos6-lv_root<br />
の領域を増やす必要があると予測。<br />
<a href="http://j-caw.co.jp/blog/?p=991">http://j-caw.co.jp/blog/?p=991</a><br />
を参考に<br />
/dev/mapper/vg_centos6-lv_root<br />
の領域をふやしてみた。<br />
以下実行手順<br />
<br />
# umount /dev/sdb1 ***df -hで/dev/sdb1を/extdisk1からはずす**/<br />
<br />
# df -h /***/dev/sdb1が表示されないことを確認***/<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/mapper/vg_centos6-lv_root<br />
50G 43G 4.3G 91% /<br />
tmpfs 2.9G 84K 2.9G 1% /dev/shm<br />
/dev/sda1 477M 142M 310M 32% /boot<br />
/dev/mapper/vg_centos6-lv_home<br />
174G 61M 165G 1% /home<br />
# pvcreate /dev/sdb1 /***物理ディスク作成***/<br />
Physical volume "/dev/sdb1" successfully created<br />
<br />
# pvdisplay<br />
--- Physical volume ---<br />
PV Name /dev/sda2<br />
VG Name vg_centos6<br />
PV Size 232.40 GiB / not usable 2.00 MiB<br />
Allocatable yes (but full)<br />
PE Size 4.00 MiB<br />
Total PE 59493<br />
Free PE 0<br />
Allocated PE 59493<br />
PV UUID 4y7MhE-FqgU-sNBF-fRca-E2cR-mm72-jpkc4Q<br />
"/dev/sdb1" is a new physical volume of "1.82 TiB"<br />
<span style="color: red;"> --- NEW Physical volume ---</span><br />
<span style="color: red;"> PV Name /dev/sdb1</span><br />
<span style="color: red;"> VG Name</span><br />
<span style="color: red;"> PV Size 1.82 TiB</span><br />
<span style="color: red;"> Allocatable NO</span><br />
<span style="color: red;"> PE Size 0</span><br />
<span style="color: red;"> Total PE 0</span><br />
<span style="color: red;"> Free PE 0</span><br />
<span style="color: red;"> Allocated PE 0</span><br />
<span style="color: red;"> PV UUID SdhrPT-uhoB-scAS-0vdG-BOnD-S27d-AibzTf</span><br />
# vgdisplay<br />
--- Volume group ---<br />
VG Name vg_centos6<br />
System ID<br />
Format lvm2<br />
Metadata Areas 1<br />
Metadata Sequence No 4<br />
VG Access read/write<br />
VG Status resizable<br />
MAX LV 0<br />
Cur LV 3<br />
Open LV 3<br />
Max PV 0<br />
Cur PV 1<br />
Act PV 1<br />
VG Size 232.39 GiB<br />
PE Size 4.00 MiB<br />
Total PE 59493<br />
Alloc PE / Size 59493 / 232.39 GiB<br />
Free PE / Size 0 / 0<br />
VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
# lvdisplay /dev/mapper/vg_centos6-lv_root /***LV Sizeは50GB***/<br />
--- Logical volume ---<br />
LV Path /dev/vg_centos6/lv_root<br />
LV Name lv_root<br />
VG Name vg_centos6<br />
LV UUID 0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG<br />
LV Write Access read/write<br />
LV Creation host, time centos6, 2015-12-05 22:27:49 +0900<br />
LV Status available<br />
# open 1<br />
<span style="color: red;"> LV Size 50.00 GiB</span><br />
Current LE 12800<br />
Segments 1<br />
Allocation inherit<br />
Read ahead sectors auto<br />
- currently set to 256<br />
Block device 253:0<br />
<br />
# vgdisplay<br />
--- Volume group ---<br />
VG Name vg_centos6<br />
System ID<br />
Format lvm2<br />
Metadata Areas 1<br />
Metadata Sequence No 4<br />
VG Access read/write<br />
VG Status resizable<br />
MAX LV 0<br />
Cur LV 3<br />
Open LV 3<br />
Max PV 0<br />
Cur PV 1<br />
Act PV 1<br />
VG Size 232.39 GiB<br />
PE Size 4.00 MiB<br />
Total PE 59493<br />
Alloc PE / Size 59493 / 232.39 GiB<br />
<span style="color: red;"> Free PE / Size 0 / 0</span><br />
VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
<br />
# pvdisplay /***既存のVG Nameと新規作成のPV Nameを確認***/<br />
--- Physical volume ---<br />
PV Name /dev/sda2<br />
<span style="color: red;"> VG Name vg_centos6</span><br />
PV Size 232.40 GiB / not usable 2.00 MiB<br />
Allocatable yes (but full)<br />
PE Size 4.00 MiB<br />
Total PE 59493<br />
Free PE 0<br />
Allocated PE 59493<br />
PV UUID 4y7MhE-FqgU-sNBF-fRca-E2cR-mm72-jpkc4Q<br />
"/dev/sdb1" is a new physical volume of "1.82 TiB"<br />
--- NEW Physical volume ---<br />
<span style="color: red;"> PV Name /dev/sdb1</span><br />
VG Name<br />
PV Size 1.82 TiB<br />
Allocatable NO<br />
PE Size 0<br />
Total PE 0<br />
Free PE 0<br />
Allocated PE 0<br />
PV UUID SdhrPT-uhoB-scAS-0vdG-BOnD-S27d-AibzTf<br />
# vgextend vg_centos6 /dev/sdb1 /***ボリュームグループを拡張***/<br />
Volume group "vg_centos6" successfully extended<br />
# vgdisplay /***Free PE / Sizeが増えている***/<br />
--- Volume group ---<br />
VG Name vg_centos6<br />
System ID<br />
Format lvm2<br />
Metadata Areas 2<br />
Metadata Sequence No 5<br />
VG Access read/write<br />
VG Status resizable<br />
MAX LV 0<br />
Cur LV 3<br />
Open LV 3<br />
Max PV 0<br />
Cur PV 2<br />
Act PV 2<br />
VG Size 2.05 TiB<br />
PE Size 4.00 MiB<br />
Total PE 536424<br />
Alloc PE / Size 59493 / 232.39 GiB<br />
<span style="color: red;"> Free PE / Size 476931 / 1.82 TiB</span><br />
VG UUID l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q<br />
# lvextend -L+10G /dev/mapper/vg_centos6-lv_root /***10G拡張する***/<br />
(参考 <a href="https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lv_extend.html">https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lv_extend.html</a>)<br />
Size of logical volume vg_centos6/lv_root changed from 50.00 GiB (12800 extents) to 60.00 GiB (15360 extents).<br />
Logical volume lv_root successfully resized<br />
# lvdisplay /***LV Sizeが10G増えて60となっている***/<br />
--- Logical volume ---<br />
LV Path /dev/vg_centos6/lv_root<br />
LV Name lv_root<br />
VG Name vg_centos6<br />
LV UUID 0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG<br />
LV Write Access read/write<br />
LV Creation host, time centos6, 2015-12-05 22:27:49 +0900<br />
LV Status available<br />
# open 1<br />
<span style="color: red;"> LV Size 60.00 GiB</span><br />
Current LE 15360<br />
Segments 2<br />
Allocation inherit<br />
Read ahead sectors auto<br />
- currently set to 256<br />
Block device 253:0<br />
--- Logical volume ---<br />
LV Path /dev/vg_centos6/lv_home<br />
LV Name lv_home<br />
VG Name vg_centos6<br />
LV UUID F6FT0Y-TKse-zeMy-dEwc-JBMW-66fG-x9GxGW<br />
LV Write Access read/write<br />
LV Creation host, time centos6, 2015-12-05 22:28:16 +0900<br />
LV Status available<br />
# open 1<br />
LV Size 176.58 GiB<br />
Current LE 45205<br />
Segments 1<br />
Allocation inherit<br />
Read ahead sectors auto<br />
- currently set to 256<br />
Block device 253:2<br />
--- Logical volume ---<br />
LV Path /dev/vg_centos6/lv_swap<br />
LV Name lv_swap<br />
VG Name vg_centos6<br />
LV UUID 9OSVwv-wmEa-CYcA-aYn0-q3Br-0CmH-tUliqW<br />
LV Write Access read/write<br />
LV Creation host, time centos6, 2015-12-05 22:29:42 +0900<br />
LV Status available<br />
# open 1<br />
LV Size 5.81 GiB<br />
Current LE 1488<br />
Segments 1<br />
Allocation inherit<br />
Read ahead sectors auto<br />
- currently set to 256<br />
Block device 253:1<br />
# df -h /***/dev/mapper/vg_centos6-lv_rootは50Gのままで増えていない***/<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/mapper/vg_centos6-lv_root<br />
<span style="color: red;">50G</span> 43G 4.3G 91% /<br />
tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />
/dev/sda1 477M 142M 310M 32% /boot<br />
/dev/mapper/vg_centos6-lv_home<br />
174G 61M 165G 1% /home<br />
# resize2fs /dev/mapper/vg_centos6-lv_root<br />
resize2fs 1.41.12 (17-May-2010)<br />
Filesystem at /dev/mapper/vg_centos6-lv_root is mounted on /; on-line resizing required<br />
old desc_blocks = 4, new_desc_blocks = 4<br />
Performing an on-line resize of /dev/mapper/vg_centos6-lv_root to 15728640 (4k) blocks.<br />
The filesystem on /dev/mapper/vg_centos6-lv_root is now 15728640 blocks long.<br />
# df -h /***resize2fs実行後は/dev/mapper/vg_centos6-lv_rootは59Gと約10G増えている***/<br />
Filesystem Size Used Avail Use% Mounted on<br />
/dev/mapper/vg_centos6-lv_root<br />
<span style="color: red;"> 59G</span> 43G 14G 76% /<br />
tmpfs 2.9G 80K 2.9G 1% /dev/shm<br />
/dev/sda1 477M 142M 310M 32% /boot<br />
/dev/mapper/vg_centos6-lv_home<br />
174G 61M 165G 1% /home<br />
<br />
空き領域が増えたところで、再度virt-cloneを実行。<br />
でも、状況変わらず。<br />
# virt-clone -o www -n www2 -f /var/kvm/images/www2.img<br />
ERROR ディスクを作成するための十分な空き領域がありません。 30720 MBの要求 > 13898 MBの空き<br />
<br />
保存先の/var以下を明示的に容量を増やせば解決か??<br />
<br />
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-18518190263435615842016-03-22T03:15:00.001+09:002016-03-22T03:15:24.550+09:00kvm構築環境にてcentosを再起動後、ネットワーク接続ができない利用環境<br />
<br />
centos6(KVMでゲストOS1つあり。)-----windows 7<br />
windows7からteratermでcentos6に接続。<br />
KVMは下記を参照して作成済。<br />
<a href="http://www.server-world.info/query?os=CentOS_6&p=kvm&f=1" target="_blank">KVMインストール</a><br />
<br />
-----------------<br />
<br />
物理ディスク増設のため、一旦centosをシャットダウン。<br />
ディスクとりつけてからcentosへアクセスするも失敗。<br />
<br />
#ifconfig<br />
仮想NICのbr0が表示されない<br />
#ifconfig<br />
仮想NICのbr0は表示。<br />
ただし、ipアドレスが表示されない。<br />
本来はbr0のipアドレスをtetatermで指定すればアクセスできる環境だった。<br />
<br />
仮想NICの<br />
以下3つのコマンドを実施するも改善せず。<br />
#shotdown -r now<br />
#/etc/rc.d/init.d/network restart<br />
#service network restart<br />
<br />
以下の対処を実施して現象改善。<br />
参考<br />
<a href="http://blog.livedoor.jp/hide_system/archives/51888446.html">http://blog.livedoor.jp/hide_system/archives/51888446.html</a><br />
<br />
ホストOSに直接ログオンして実施。<br />
<br />
#ifconfig -a<br />
eth0 Link encap:Ethernet HWaddr xx:cc:bb:aa:ss:dd /***HWaddrの値をコピーしておく***/<br />
#vi /etc/sysconfig/network-scripts/ifcfg-eth0<br />
---<br />
~~~<br />HWADDR=xx:cc:bb:aa:ss:dd /***追加。HWaddrの値をペースト***/<br />
---<br />
#vi /etc/sysconfig/network-scripts/ifcfg-br0<br />
---<br />
~~~<br />#HWADDR=xx:cc:bb:aa:ss:dd /***#を追記してコメントアウト***/<br />~~~<br />
---<br />
<br />
#shutdown -h now /***シャットダウン***/<br />
<br />
起動後、ifconfigを実行するとbr0からipアドレスが表示されていることを確認。<br />
その後windows7からteratermでbr0に表示されたipアドレスでアクセスできることを確認。<br />
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-87551550865904234882015-12-13T20:30:00.000+09:002015-12-13T20:30:04.055+09:00dnsサーバー_bind起動に失敗_centos6<a href="http://kajuhome.com/bind.shtml#n09-01">http://kajuhome.com/bind.shtml#n09-01</a><br />を参考にcentos6環境で、DNSサーバーを構築<br />しかし、bind起動時にエラー<br />-----<br /># /etc/rc.d/init.d/named start<br />Generating /etc/rndc.key:[ OK ]<br />named を起動中:<br />Error in named configuration:<br />/etc/named.conf:35: unknown option 'error'<br />[失敗]<br />#<br />------<br />となりエラー<br />/etc/named.confの35,36行目に以下のパラメータを設定していたので削除。<br />削除後は起動成功<br />------<br /> error (unexpected RCODE SERVFAIL) resolving<br /> error (network unreachable) resolving<br />------マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-36708461282389050562015-12-12T21:49:00.000+09:002015-12-12T21:49:06.390+09:00DiceでIPアドレス自動検出ができない_centos6<a href="http://centossrv.com/domain-ieserver.shtml">http://centossrv.com/domain-ieserver.shtml</a><br />
を参考にDiCEの設定を実施<br />
<br />
-----<br />
# setarch `uname -m` /usr/local/bin/DiCE/diced<br />=-=-=- DiCE DynamicDNS Client -=-=-=<br />Version 0.19 for Japanese<br />Copyright(c) 2001 sarad<br />
:setup<br />IPアドレスの検出方法を指定してください<br />(0) 自動検出<br />(1) ローカルのネットワークアダプタから検出<br />(2) 外部のスクリプトから検出<br /><現在:0><br />(N)変更しない (P)戻る<br />>n<br />-------------------------------------------------<br />プライベートIPアドレスも検出対象ですか? (Y/N)<br /><現在:いいえ><br />(P)戻る<br />>n<br />-------------------------------------------------<br />IPアドレスの検出をテストしますか? (Y/N)<br />(P)戻る<br />>y<br />
<br />
-----<br />
1時間以上、画面がすすまないためCtrl+Cでキャンセル。<br />
対策を探すと以下のサイトを発見<br />
<br />
<a href="http://blog.aburami.net/archives/53915071.html">http://blog.aburami.net/archives/53915071.html</a><br />
<br />
以下のオペレーションで現象改善。<br />
------<br />
# cat /usr/local/bin/DiCE/ipcheck.dat<br /><a href="http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/ip_chk.cgi">http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/ip_chk.cgi</a><br /><a href="http://hpcgi3.nifty.com/sarad/ip_check.cgi">http://hpcgi3.nifty.com/sarad/ip_check.cgi</a><br /><a href="http://checkip.dyndns.org/">http://checkip.dyndns.org/</a><br /># GET <a href="http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/ip_chk.cgi">http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/ip_chk.cgi</a><br />Error!!#<br /># GET <a href="http://hpcgi3.nifty.com/sarad/ip_check.cgi">http://hpcgi3.nifty.com/sarad/ip_check.cgi</a><br />Error!!#<br /># GET <a href="http://checkip.dyndns.org/">http://checkip.dyndns.org/</a><br /><html><head><title>Current IP Check</title></head><body>Current IP Address: 1</body></html><br />
xxx.xxx.xxx.xxx<br />
/***唯一IPアドレスが表示***/<br /># setarch `uname -m` /usr/local/bin/DiCE/diced<br />=-=-=- DiCE DynamicDNS Client -=-=-=<br />Version 0.19 for Japanese<br />Copyright(c) 2001 sarad:setup<br />IPアドレスの検出方法を指定してください<br />(0) 自動検出<br />(1) ローカルのネットワークアダプタから検出<br />(2) 外部のスクリプトから検出<br /><現在:0><br />(N)変更しない (P)戻る<br />>2 /***0ではなく、2を設定***/<br />-------------------------------------------------<br />スクリプトのURLを入力してください<br /><現在:><br />(N)変更しない (P)戻る<br />>http://checkip.dyndns.org/ /***IPアドレスが表示されたcheckipのアドレスを設定する***/<br />-------------------------------------------------<br />プライベートIPアドレスも検出対象ですか? (Y/N)<br /><現在:いいえ><br />(P)戻る<br />>n<br />-------------------------------------------------<br />IPアドレスの検出をテストしますか? (Y/N)<br />(P)戻る<br />>y<br />検出IPアドレス>xxx.xxx.xxx.xxx /***IPアドレスが表示****<br />
-----<br />
その後の設定は<br />
<a href="http://centossrv.com/domain-ieserver.shtml">http://centossrv.com/domain-ieserver.shtml</a><br />
の内容と同様。<br />
<br />
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-21964747782649837762015-12-12T20:07:00.001+09:002015-12-12T20:07:10.625+09:00centos6環境で、DiCEのダウンロードしたファイルの解凍失敗<a href="http://centossrv.com/domain-ieserver.shtml">http://centossrv.com/domain-ieserver.shtml</a><br />
を参考にDiceをダウンロード<br />
しかし、ファイル名が<br />
download.cgi?p=diced019<br />
となり、gzファイルの形式ではない。<br />
------<br />
#cd /usr/local/bin/<br /># wget <a href="http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/download.cgi?p=diced019">http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/download.cgi?p=diced019</a><br />--2015-12-12 19:42:03-- <a href="http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/download.cgi?p=diced019">http://www.hi-ho.ne.jp/cgi-bin/user/yoshihiro_e/download.cgi?p=diced019</a><br /><a href="http://www.hi-ho.ne.jp/">www.hi-ho.ne.jp</a> をDNSに問いあわせています... 202.224.157.11<br /><a href="http://www.hi-ho.ne.jp%7c202.224.157.11%7c/">www.hi-ho.ne.jp|202.224.157.11|:80</a> に接続しています... 接続しました。<br />HTTP による接続要求を送信しました、応答を待っています... 302 Found<br />場所: <a href="http://homepage3.nifty.com/sarad/diced01914.tar.gz">http://homepage3.nifty.com/sarad/diced01914.tar.gz</a> [続く]<br />--2015-12-12 19:42:03-- <a href="http://homepage3.nifty.com/sarad/diced01914.tar.gz">http://homepage3.nifty.com/sarad/diced01914.tar.gz</a><br />homepage3.nifty.com をDNSに問いあわせています... 2001:258:8600:100:202:248:88:144, 202.248.88.142<br />homepage3.nifty.com|2001:258:8600:100:202:248:88:144|:80 に接続しています... 接 続しました。<br />HTTP による接続要求を送信しました、応答を待っています... 200 OK<br />長さ: 1094082 (1.0M) [application/x-gzip]<br />`download.cgi?p=diced019' に保存中<br />
100%[======================================>] 1,094,082 1.05M/s 時間 1.0s<br />
2015-12-12 19:42:04 (1.05 MB/s) - `download.cgi?p=diced019' へ保存完了 [1094082/1094082]<br />
# ls<br />download.cgi?p=diced019<br />
------<br />
<br />
以下のサイトでwgetコマンドを実施することで、解凍成功<br />
------<br />
# wget <a href="http://homepage3.nifty.com/sarad/diced01914.tar.gz">http://homepage3.nifty.com/sarad/diced01914.tar.gz</a><br />--2015-12-12 19:49:09-- <a href="http://homepage3.nifty.com/sarad/diced01914.tar.gz">http://homepage3.nifty.com/sarad/diced01914.tar.gz</a><br />homepage3.nifty.com をDNSに問いあわせています... 2001:258:8600:100:202:248:88:144, 202.248.88.142<br />homepage3.nifty.com|2001:258:8600:100:202:248:88:144|:80 に接続しています... 接 続しました。<br />HTTP による接続要求を送信しました、応答を待っています... 200 OK<br />長さ: 1094082 (1.0M) [application/x-gzip]<br />`diced01914.tar.gz' に保存中<br />
100%[======================================>] 1,094,082 1.04M/s 時間 1.0s<br />
2015-12-12 19:49:10 (1.04 MB/s) - `diced01914.tar.gz' へ保存完了 [1094082/1094082]<br />
# ls<br />diced01914.tar.gz download.cgi?p=diced019 download.cgi?p=diced019.1<br />
------<br />
<br />
参考<br />
<a href="http://centossrv.com/patio/centossrv.cgi?read=2852&ukey=0">http://centossrv.com/patio/centossrv.cgi?read=2852&ukey=0</a>マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-63251411205233374122015-12-07T20:59:00.003+09:002015-12-07T20:59:47.601+09:00centos6環境にkvmをインストール構成<br />
windows7+teraterm------>centos6<br />へリモートから操作<br />
<a href="http://www.server-world.info/query?os=CentOS_6&p=kvm&f=1">http://www.server-world.info/query?os=CentOS_6&p=kvm&f=1</a><br />を参考にインストール<br />
<br />
# yum -y install qemu-kvm libvirt python-virtinst bridge-utils <br />
# モジュールが読み込まれているか確認<br /># lsmod | grep kvm <br />
kvm_intel 46589 0<br /> kvm 292815 1 kvm_intel <br /># /etc/rc.d/init.d/libvirtd start <br />
Starting libvirtd daemon: [ OK ]<br /># /etc/rc.d/init.d/messagebus start <br />
Starting system message bus: [ OK ]<br /># chkconfig libvirtd on <br /># chkconfig messagebus on <br />
<br />
<strong>#####ここまでは上記のリンクのとおり####</strong><br /># 続いてブリッジネットワークbr0を作成<br /># mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-br0<br /># vi /etc/sysconfig/network-scripts/ifcfg-br0<br />DEVICE=br0<br />TYPE=Bridge<br /><strong>####ここでリモートアクセスができなくなる####</strong><br /><strong>####centos6に直接ログオンして、eth0を再構築する####</strong><br /># vi /etc/sysconfig/network-scripts/ifcfg-eth0 <br /># 新規作成<br />
DEVICE=eth0<br /> TYPE=Ethernet<br /> ONBOOT=yes<br /> BRIDGE=br0 <br />
# /etc/rc.d/init.d/network restart<br />####ここで再度リモートからアクセスが可能。マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-38688270841727171762015-12-07T20:44:00.003+09:002015-12-07T20:44:42.712+09:00インターフェース br0 を活性化中: エラー: 接続のアクティベーションに失敗_kvmインストール中centos6環境でKVMインストール時実施。<br />
http://www.server-world.info/query?os=CentOS_6&p=kvm<br />
を参考に構成実施。<br />
<br />
構成中に<br />
接続のアクティベーションに失敗<br />
エラー発生。<br />
<br />
結果として、以下のコマンドでNetworkManagerをオフにしたら現象改善。<br />
chkconfig networkManager off<br />
/etc/rc.d/init.d/network restart<br />
------<br />
[root@centos6 ~]# /etc/rc.d/init.d/network restart<br />インターフェース eth0 を終了中: [ OK ]<br />インターフェース eth1 を終了中: [ OK ]<br />ループバックインターフェースを終了中 [ OK ]<br />ループバックインターフェイスを呼び込み中 [ OK ]<br />インターフェース eth0 を活性化中: device eth0 is already a member of a bridge; can't enslave it to bridge br0.<br /> [ OK ]<br />インターフェース br0 を活性化中: エラー: 接続のアクティベーションに失敗: Failed to determine connection's virtual interface name<br /> [失敗]<br />[root@centos6 ~]# service NetworkManager stop<br />NetworkManager デーモンを停止中: [ OK ]<br />[root@centos6 ~]# chkconfig networkManager off<br />サービス networkManager に関する情報の読み込み中にエラーが発生しました: そのようなファイルやディレクトリはありません<br />[root@centos6 ~]# chkconfig NetworkManager off<br />[root@centos6 ~]# /etc/rc.d/init.d/network restart<br />ループバックインターフェースを終了中 [ OK ]<br />ループバックインターフェイスを呼び込み中 [ OK ]<br />インターフェース eth0 を活性化中: device eth0 is already a member of a bridge; can't enslave it to bridge br0.<br /> [ OK ]<br />インターフェース br0 を活性化中: Determining if ip address 192.168.0.5 is already in use for device br0...<br /> [ OK ]<br /><br />
------マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-39878399221410106652015-10-13T23:00:00.000+09:002015-10-19T19:15:18.482+09:00サーバー起動時CLIENT MAC ADDRのメッセージ表示ESXi導入環境のサーバーの電源を入れてしばらくすると<br />
<br />
CLIENT MAC ADDR<br />
DHCP・・・・・<br />
というメッセージをずっと繰り返したままになる。<br />
<br />
<br />
BIOSでブートはHDDを最優先にしていて状況は変わらず。<br />
<br />
<br />
似たような事例を探すと以下のリンクをみつけた。<br />
<br />
<br />
<a href="http://kspc-web.com/index.php/explanations/pc-it/79-trouble-and-security/352-client-mac-addrdhcp" target="_blank">CLIENT MAC ADDR・・・DHCP というエラー表示 </a><br />
<br />
対処方法としては<br />
<span style="line-height: 18px;">物理的に、ハードディスクに繋がっているコネクタケーブルが外れているとか、断線している</span><br />
<li><span style="line-height: 18px;">そもそもハードディスクが壊れている(回転しないとか、認識できないほどディスクが破損しているとか)</span></li>
<li><span style="line-height: 18px;">ハードディスクからつながっているマザーボード自体に、何らかのエラーがある</span></li>
<span style="line-height: 18px;">だそうだ。</span><br />
<span style="line-height: 18px;"></span><br />
<span style="line-height: 18px;">これから切り分け予定だが、下手するとHDDの再購入が必要かも。</span><br />
<span style="line-height: 18px;"></span><br />
予定<br />
サーバーをあけて様子を見る。HDDの再接続後、電源ONして動作確認。マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0tag:blogger.com,1999:blog-4544021855858494328.post-78211990584213435672015-10-03T05:47:00.001+09:002015-10-03T05:47:17.704+09:00mkfs.ext4コマンド実行時に、"読み込み専用ファイルシステムです"エラー _HAクラスタ検証中参考URL<br />
<a href="http://enakai00.hatenablog.com/entry/20110804/1312437111">http://enakai00.hatenablog.com/entry/20110804/1312437111</a><br />
を参考<br />
host#virsh console guest1<br />
<br />
guest1#mkfs.ext4 /dev/sdb<br />mke2fs 1.41.12 (17-May-2010)<br />/dev/sdb is entire device, not just one partition!<br />Proceed anyway? (y,n) y<br />/dev/sdb: 読み込み専用ファイルシステムです while setting up superblock<br />
<br />
<br />
/***dmesgの結果を調べる***/<br />
# dmesg | grep sdb<br />sd 2:0:0:2: [sdb] 2048000 512-byte logical blocks: (1.04 GB/1000 MiB)<br />sd 2:0:0:2: [sdb] Write Protect is on<br />sd 2:0:0:2: [sdb] Mode Sense: 49 00 80 08<br />sd 2:0:0:2: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA<br /> sdb: unknown partition table<br />sd 2:0:0:2: [sdb] Attached SCSI disk<br />
<br />
# dmesg | grep error<br /># dmesg | grep readonly<br />EXT4-fs (dm-0): INFO: recovery required on readonly filesystem<br />EXT4-fs (dm-0): orphan cleanup on readonly fs<br /># dmesg | grep read-only<br />Write protecting the kernel read-only data: 10240k<br />
<br />
/***fdiskでは認識されている***/<br />
<br />
# fdisk -l /dev/sda /dev/sdb<br />
ディスク /dev/sda: 104 MB, 104857600 バイト<br />ヘッド 4, セクタ 50, シリンダ 1024<br />Units = シリンダ数 of 200 * 512 = 102400 バイト<br />セクタサイズ (論理 / 物理): 512 バイト / 512 バイト<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />ディスク識別子: 0x00000000<br />
<br />ディスク /dev/sdb: 1048 MB, 1048576000 バイト<br />ヘッド 33, セクタ 61, シリンダ 1017<br />Units = シリンダ数 of 2013 * 512 = 1030656 バイト<br />セクタサイズ (論理 / 物理): 512 バイト / 512 バイト<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />ディスク識別子: 0x00000000<br />
<br />
/***fsckコマンドの失敗***/<br />
# fsck /dev/sdb<br />fsck from util-linux-ng 2.17.2<br />e2fsck 1.41.12 (17-May-2010)<br />fsck.ext2: 読み込み専用ファイルシステムです while trying to open /dev/sdb<br />Disk write-protected; use the -n option to do a read-only<br />check of the device.<br />
<br />
<br />
今後の予定<br />
もう少しエラーを回避する手段を調べる。<br />
マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com1tag:blogger.com,1999:blog-4544021855858494328.post-62108151406945526172015-08-08T22:39:00.001+09:002015-08-08T22:39:04.632+09:00centos7環境にKVM導入中virshコマンドで"インターフェース 'eth0' を取得できませんでした"エラーKVMの導入にチャレンジ<br />
構成<br />
ホストOS centos7<br />
ゲストOS centos6<br />
<br />
以下のページを参照して導入実行<br />
<a href="http://centossrv.com/kvm.shtml">http://centossrv.com/kvm.shtml</a><br />
<br />
ただしvirshコマンドでエラー発生<br />
[root@centos7 ~]# virsh iface-bridge eth0 br0<br />
エラー: インターフェース 'eth0' を取得できませんでした<br />
エラー: インターフェースが見つかりません: 'eth0' という名前のインターフェースを見つけられませんでした<br />
ifconfigでデバイスを確認<br />
[root@centos7 ~]# ifconfig<br />
eno1: flags=4163<up> mtu 1500<br /> inet 192.168.0.24 netmask 255.255.255.0 broadcast 192.168.0.255<br /> inet6 fe80::29c:2ff:fe9d:fe8d prefixlen 64 scopeid 0x20<link></link><br /> inet6 240f:a:1b03:1:29c:2ff:fe9d:fe8d prefixlen 64 scopeid 0x0<global><br /> ether 00:9c:02:9d:fe:8d txqueuelen 1000 (Ethernet)<br /> RX packets 21172 bytes 27236891 (25.9 MiB)<br /> RX errors 0 dropped 0 overruns 0 frame 0<br /> TX packets 15385 bytes 1662502 (1.5 MiB)<br /> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br /> device interrupt 17 memory 0xfbfe0000-fc000000 <br /><br />lo: flags=73<up> mtu 65536<br /> inet 127.0.0.1 netmask 255.0.0.0<br /> inet6 ::1 prefixlen 128 scopeid 0x10<host><br /> loop txqueuelen 0 (Local Loopback)<br /> RX packets 0 bytes 0 (0.0 B)<br /> RX errors 0 dropped 0 overruns 0 frame 0<br /> TX packets 0 bytes 0 (0.0 B)<br /> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br /><br />virbr0: flags=4099<up> mtu 1500<br /> inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255<br /> ether 52:54:00:61:6d:97 txqueuelen 0 (Ethernet)<br /> RX packets 0 bytes 0 (0.0 B)<br /> RX errors 0 dropped 0 overruns 0 frame 0<br /> TX packets 0 bytes 0 (0.0 B)<br /> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</up></host></up></global></up><br />
<br />
eth0がないからeno1と置き換えてコマンドを実行する必要がある。<br />
<a href="http://centossrv.com/kvm.shtml">http://centossrv.com/kvm.shtml</a><br />
にあるeth0の部分をeno1とおきかえてると以下のエラーが発生<br />
[root@centos7 ~]# virsh iface-bridge eno1 br0<br />
エラー: ネットワークデバイス br0 がすでに存在します<br />
<br />
なぜかbr0は作られている・・・。<br />
任意の名前br1を設定することでコマンド成功<br />
[root@centos7 n~]# virsh iface-bridge eno1 br1<br />
ブリッジ br1 を作成して、デバイス eno1 に接続しました<br />
ブリッジインターフェース br1 が起動しました<br />
<br />マスタhttp://www.blogger.com/profile/15151536071153141069noreply@blogger.com0