0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ext2形式のフロッピーディスクのイメージファイルをもらった備忘録

Posted at

課題
与えられたイメージファイルをvmware内のubuntuにてマウントして中身を見る。
マウントしないと中身のファイルたちの権限が変更できないので以下の手順で行った。これは、マウント先の権限とユーザー権限のマウントは実際にはエミュレートしてるだけだかららしい。
まずはrootになる。

$ sudo su-

新しいディレクトリ作ってそこにマウントした。

$ mount -t ext2 ファイル名フルパス マウントしたい場所

中身のファイルの権限を変更した。

$ chmod 644

読めるようになったと思ったが中身が変だったのでfileコマンドで調べる

$ file Q3.txt

ただのテキストファイルだったのでデコードを色々試す
使ったツールはCyberChef
https://gchq.github.io/CyberChef/
jisコードかな?となったので、iconvコマンド(文字コードを変換するコマンド)を用いる。オプションは次の通り

-f 入力のエンコーディング -t 出力のエンコーディング

$ iconv -f iso2022jp -t utf8

読めるようになったので中の問題を解く
iconvコマンドについて

短縮オプション 長いオプション 意味
-f --from-code=コード 入力のエンコーディング
-t --to-code=コード 出力のエンコーディング
-c 変換できなかった文字を出力しない
-s --silent 変換できなかった場合にエラーメッセージ表示しない
--verbose 処理中のメッセージを表示する
-o --output=ファイル 保存先のファイル
-l --list 対応しているコードを表示する
参考にしたのは以下
https://atmarkit.itmedia.co.jp/ait/articles/1609/12/news019.html
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?