パスワードクラッキング　メモ

メモ程度の雑な書き方です。ChatGPT使いAIでやってみました。　
誤字が多いですが、記念にそのままでいます。



ジョンチャリッパーとは正式名称をジョンTHEリッパーパスワードクラッカーといって代表的なパスワードクラックツールの一つです。
UNIXやLINUXのユーザーパスワードの暗号化に使われるDESMDFIVEWINDOWSログオンに使われるNTFSなど、幅広い暗号化アルゴリズムに対応
しています。
ここでは、Metasploit２のパスワードを解析してみます。
まず、kaliLINUXおよびメタスプリンタープルツーのふたつの仮想マシンを立ち上げて、それぞれのIPアドレスを確認してください。
デラックスでのアカウント情報はエトス、パスワードとしてシャドウの2つのファイルで通常管理されています。
パスワードファイルはユーザーの属性が記載されたファイルで、ユーザー名やグループ、ID、ホームディレクトリー、パスシェルなどが記載されてい
ます。
SHADOWファイルは、ユーザー名とそれに対するパスワードハッシュなどが記載されています。
通常、ROOT権限でないと閲覧することはできません。
それでは、カリーLINUXで端末ウインドウをもう一つ開いて、SSHでMetasplotable２に接続します。

![B1.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/40b75dfe-7a95-c270-6e49-a1ddc57534e1.png)

メタスポイトはに接続できました。
さらに、ROOT権限を取得します。
ROOT権限を取得しました。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/6e85ee04-b337-b8bc-fc7a-ea2d09ff3c59.png)


突然、配下のパスワードファイルを表示してみます。
![B3.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/03103ffe-ac28-f00e-4e92-749769d86f86.png)


パスワードファイルの中身をハイライトして。
クリップボードにコピーします。
![B4.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/332cf023-8f7f-cf55-c9ea-1d24b9701b51.png)



もう一つのターミナルから。
新しい
ファイルを生成して、その中にクリップボードにコピーしたパスワードファイルの中身を張り付けます。
![B5.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e383908a-05aa-94da-064e-640c0c5a916b.png)


次に、catコマンドでSHADOWファイルを表示してみます。
![B6.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/9297c31b-5014-0447-9435-03be3d2df85b.png)



表示したSHADOWファイルの中身を。
ハイライトしてクリップボードにコピーします。
![B7.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ec200a45-9333-c781-5bf1-e7873ee9ec1c.png)



仮にLINUX上で新規に。ファイルを生成して
![B8.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ad7e8431-eb28-edc4-6bab-48b02ee5371a.png)


その中にクリップボードにコピーしてある作動ファイルの中身を貼り付けます。
ファイルをセーブします。
![B9.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/790de786-0599-1672-fba6-032ec9716867.png)



Metasplotable２のパスワードとシャドーファイルをコピーした2つのファイルからJohn the Ripperで解析可能な形式に変換したファイルを生成します。
ANSHADOWコマンドを使用して、パスワードファイルとおSHADOWファイルを一つにまとめてパスワードドットDBファイルを作成します。
![B10.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/a99a4a37-e749-d388-7b1c-76b994e1e2d8.png)



生成されたパスワードを、DBファイルからJohn the Ripperを実行します。
![B11.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/8fa956ae-c032-df83-f5d2-faa88b220745.png)

![B12.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/a078032e-41c7-d30f-dee7-ef0a23caf007.png)

それでは解読されたユーザーIDとパスワードを使用して、メタスポイトタブにSSH接続ができるかどうか確認します。
![B13.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/039c8aad-654d-960f-71e1-a84bf625dc2c.png)


ジョーンズリッパーで解析したパスワードを使用してメタスペリータブに接続できることが確認できました。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/0aa828ee-7ffd-0d1f-caf2-0a5eb2bae51a.png)




次はHydraをAIでやってみました




Hydraというパスワードクラッカーを使用してブルートフォースアタックの検証を行います。


まず、kaliLINUXおよびMetasplotable２の2つの仮想マシンを立ち上げて、それぞれのIPアドレスを確認してください。
それでは、ヘルプコマンドの使用方法を確認します。
生地サンプルを見ると、昼ドララージエルユーザーリストはIPHONEラージPIIパスワードリスト。
ターゲット。
IPアドレス通信プロトコルのように記述することが分かります
![B15.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/38faad78-1ccb-db01-a67f-7714c7e996c6.png)


。
まず、彼LINUXに用意されているワードリストから使用するユーザIDとパスワードの辞書を用意します。
![B16.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/72257f03-357c-4ad5-1335-ae5ed3056047.png)


lsコマンドを使い多くの辞書が用意されていますが、
![B17.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ce1a75e3-5b0e-f71c-e13a-9be911ddf9c5.png)

ここでは。
この辞書をベースに、ユーザーリストとパスワードリストの作成を行います。
![B18.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/596de956-d0db-dc53-5d9a-2686b381f408.png)


この辞書はいう。
一行にユーザーIDとパスワードの2つ入ってますので。
これをユーザーだけとパスワードだけに分解します。
![B19.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/22aa331b-7f09-0bfe-11a5-f7e85e5da53f.png)

まずカットコマンドで。
ユーザーリストだけを取り出してそれを。
ホームディレクトリー配下のでをlogins.txtというファイルに書き出します。
![B20.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/8c61b29a-8015-b180-abb7-c39f9aa140c2.png)

パスワードも同様に。
フィールドに取り出したものをpwst.txtというファイルに書き出してます。
![B21.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/d3d661fe-e485-0d13-54c6-f6da11896016.png)


ホームディレクトリーに戻り、正常に書き出しが終了しているかどうか確認します。
正常に作成されてるようです。
![B22.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7481d8eb-3985-91f9-65c5-e3a09a9529a2.png)



これでHydraとで使用する辞書を用意することができました。
Hydraとを実行します。
ターゲットIPアドレスを記入します。
通信プロトコルは仮にここではFTPにします。
![B23.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/3be83f55-a157-5ce7-54d4-22a15cc3b000.png)


解読にに成功すると以下の表示が出ます
![B24.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7891c854-5fa3-8dbb-09d9-1ef33846311e.png)


それでは、実際にメタスプレーと普通に接続できるかどうか確認します。
FTPというコマンドが実装されてないようですので、ここではSSHでメタスプレートラブルツーに接続してみます。
![B25.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/4f2c1e70-1dbd-9f52-1583-401eb459c8b4.png)


![B26.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/61f7d061-818a-cc53-ffa3-6bf73e8e5a8e.png)

メタスプレータブーに接続できたことが確認できました。
![B27.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/12eeb46c-a9a3-a975-7df2-30044d8aa421.png)


AIでそれなりの事でできました！「おー」って感じです！
ウェブサイトのログインフォームのブルートフォース攻撃を実行したいです。
お疲れ様でした

参考：【サイバーセキュリティ完全攻略】


追加メモ
先にHydoraでパスワードを解ってからジョンザリッパーを

辞書テキスト
burnett_top_500.txt			rservices_from_users.txt	
cms400net_default_userpass.txt			sap_common.txt	
common_roots.txt			sap_default.txt	
dangerzone_a.txt			sap_icm_paths.txt	
dangerzone_b.txt			scada_default_userpass.txt	
db2_default_pass.txt			sensitive_files.txt	
db2_default_user.txt			sensitive_files_win.txt	
db2_default_userpass.txt			http_owa_common.txt	
default_pass_for_services_unhash.txt			sid.txt	
default_userpass_for_services_unhash.txt			idrac_default_pass.txt	
default_users_for_services_unhash.txt			snmp_default_pass.txt	
dlink_telnet_backdoor_userpass.txt			idrac_default_user.txt	
hci_oracle_passwords.csv			tftp.txt	
http_default_pass.txt			ipmi_passwords.txt	
http_default_userpass.txt			ipmi_users.txt	
http_default_users.txt			joomla.txt	
oracle_default_userpass.txt			keyboard-patterns.txt	
password.lst			malicious_urls.txt	
piata_ssh_userpass.txt			mirai_pass.txt	
postgres_default_pass.txt			tomcat_mgr_default_pass.txt	
postgres_default_user.txt			tomcat_mgr_default_userpass.txt	
postgres_default_userpass.txt			tomcat_mgr_default_users.txt	
root_userpass.txt			unix_passwords.txt	
routers_userpass.txt			mirai_user.txt	
rpc_names.txt			mirai_user_pass.txt	
vnc_passwords.txt			unix_users.txt	
multi_vendor_cctv_dvr_pass.txt			vxworks_collide_20.txt	
			vxworks_common_20.txt	
				
	root@kali:/usr/share/wordlists/metasploit#			

Hydoraの解析内容
![B28PNG.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f50bfa8b-d125-59fa-8f79-b81d575ccdfc.png)

最後の接続確認
![B29PNG.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/b295a425-76a4-4e7d-4d7e-cbfbc0187c45.png)

Hydoraヘルプ
-h	more command line options (COMPLETE HELP)		
server	the target: DNS, IP or 192.168.0.0/24 (this OR the -M option)		
service	the service to crack (see below for supported protocols)		
OPT	some service modules support additional input (-U for module help)		
			
Supported services: adam6500 asterisk cisco cisco-enable cvs firebird ftp ftps http[s]--			
head | get|post} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc lda			
p2[s] ldap3[-{cram| digest}md5] [s] mssql mysql nntp oracle-listener oracle-sid pcanywhere			
pcnfs pop3[s] postgres radmin2 rdp redis rexec rlogin rpcap rsh rtsp s7-300 sip smb sm			
p[s] smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet[s] vmauthd vnc xmpp			
			
Hydra is a tool to guess/crack valid login/password pairs. Licensed under AGPL			
v3.0. The newest version is always available at http://www.thc.org/thc-hydra			
Don't use in military or secret service organizations, or for illegal purposes.			
These services were not compiled in: afp ncp oracle sapr3.			
			
Use HYDRA_PROXY_HTTP or HYDRA_PROXY environment variables for a proxy setup.			
E.g. % export HYDRA_PROXY=socks5://l:p@127.0.0.1:9150 (or: socks4: // connect://)			
% export HYDRA_PROXY-connect_and_socks_proxylist.txt (up to 64 entries)			
% export HYDRA_PROXY_HTTP=http://login: pass@proxy:8080			
% export HYDRA_PROXY_HTTP=proxylist.txt (up to 64 entries)			
			
Examples:			
hydra - user -P passlist.txt ftp://192.168.0.1			
hydra L userlist.txt -p defaultpw imap://192.168.0.1/PLAIN			
hydra C defaults.txt -6 pop3s://[2001: db8::1]: 143/TLS: DIGEST-MD5			
hydra - admin -p password ftp://[192.168.0.0/24]/			
hydra L logins.txt -P pws.txt -M targets.txt ssh [			


////////////////////////////////////////////////////////////////////////////////
１VirtualBoxのダウンロード
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/838c32d0-b22d-4574-bc0d-0dac7cb6111b.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/2f708052-71bf-e9a0-05c7-c1faee6573b1.png)


2ダウンロード先に行く
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e8da641c-b959-da6f-c6ba-50b4c5f106ae.png)

3アプリを開く
　コマンドを入力して展開する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e5a9a881-4e9a-dc7e-a1c2-e26f5d35f543.png)

4まとめ
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/2c742abd-374c-5ff4-e5ce-647d8a05b8f3.png)









1
Metasploit2からだうんろーどする
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1b0c6061-f67a-fd19-c771-f963b23287eb.png)

2
解凍する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/5a39511f-a678-6353-fc02-2a6940d79c9e.png)

3
ばーちゃるBOXの新規を押す

4
以下のように設定する　「次へ」
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e73f3dd7-835b-cf31-0206-804e6036f7ec.png)

Ⅴハードうぇらを以下のように設定する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ea5850a7-1d43-bbe8-cc54-84b6cfd85e25.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/5b93ab79-5095-1d72-c26f-f4b8c4c2c986.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1b64aee5-4c69-c8c4-ef14-fbd4a5d4b6c3.png)



VirtualBoxをKali Linuxにインストールする手順は以下の通りです。

ターミナルを開きます。Kali Linuxのデスクトップ上で右クリックし、"Open Terminal"（または同等のオプション）を選択します。

ターミナルで以下のコマンドを実行して、システムを最新の状態に更新します。

sql
Copy code
sudo apt update
sudo apt upgrade
VirtualBoxのパッケージをインストールするために、以下のコマンドを実行します。

Copy code
sudo apt install virtualbox
インストールが完了したら、以下のコマンドを実行してVirtualBoxを起動します。

Copy code
virtualbox
VirtualBoxが正常に起動すると、仮想マシンを作成して実行できるようになります。

これでKali Linux上でVirtualBoxをインストールすることができます。必要な仮想マシンを作成して、別のオペレーティングシステムを実行することができます。



メモ
https://seekt.hatenablog.com/entry/2022/05/22/085220


///////////////////////////////////////////////////////////////////////////
ssh -i "C:\Users\202101N034user\Desktop\#key-seq001.pem” kali@10. 10. 46. 35
deb http://kali. download/kali kali-rolling main contrib non-free non-free-firmware
Cannot initiate the connection to kali. download:80 (2606:4700::6812:6764). connect (101: Network is
unreachable) Cannot initiate the connection to kali. download:80 (2606:4700::6812:6664). - connect (101:
Network is unreachable) Could not connect to kali. download:80 (104. 18. 102. 100), connection timed out Could
not connect to kali. download:80 (104. 18. 103. 100), connection timed out
Reading package lists... Done
Building dependency tree... Done
4.10 Reading state information... Done

All packages are up to date.
W: Failed to fetch http://kali.download/kali/dists/kali-rolling/InRelease Cannot initiate the connection to
kali. download:80 (2606:4700::6812:6764). - connect (101: Network is unreachable) Cannot initiate the
connection to kali. download:80 (2606:4700::6812:6664). – connect (101: Network is unreachable) Could not
connect to kali. download:80 (104. 18. 102. 100), connection timed out Could not connect to kali. download:80
(104. 18. 103. 100), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead. |

deb http://kali. download/kali kali-rolling main contrib non-free non-free-firmware
Cannot initiate the connection to kali. download:80 (2606:4700::6812:6764). connect (101: Network is
unreachable) Cannot initiate the connection to kali. download:80 (2606:4700::6812:6664). - connect (101:
Network is unreachable) Could not connect to kali. download:80 (104. 18. 102. 100), connection timed out Could
not connect to kali. download:80 (104. 18. 103. 100), connection timed out
Reading package lists... Done
Building dependency tree... Done
4.10 Reading state information... Done

All packages are up to date.
W: Failed to fetch http://kali.download/kali/dists/kali-rolling/InRelease Cannot initiate the connection to
kali. download:80 (2606:4700::6812:6764). - connect (101: Network is unreachable) Cannot initiate the
connection to kali. download:80 (2606:4700::6812:6664). – connect (101: Network is unreachable) Could not
connect to kali. download:80 (104. 18. 102. 100), connection timed out Could not connect to kali. download:80
(104. 18. 103. 100), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead. |


のエラーメッセージは、Kali Linuxのパッケージリポジトリへの接続に問題があることを示しています。いくつかの対処法を試してみることができます。

ネットワーク接続の確認: まず、インターネット接続が正常かどうかを確認してください。他のウェブサイトにアクセスできるかどうかを確認し、必要に応じてネットワーク接続を修正してください。

ミラーサーバーの変更: Kali Linuxのパッケージリポジトリは、ミラーサーバーからパッケージをダウンロードします。接続できないミラーサーバーが問題の原因である場合、別のミラーサーバーを試すことができます。

Kali Linuxのソースリストを編集します。ターミナルで以下のコマンドを実行します（エディタはお好みのものを使用してください）：

bash
Copy code
sudo nano /etc/apt/sources.list
ソースリストファイルが開かれたら、"deb http://kali.download/kali kali-rolling main contrib non-free non-free-firmware" の行を探します。

この行の先頭に "#" を追加してコメントアウトし、以下の行を追加します（元の行はコメントアウトして残しておくことができます）：


deb http://http.kali.org/kali kali-rolling main contrib non-free
ファイルを保存して閉じます。

ソースリストを更新し、パッケージリポジトリを更新します：


sudo apt update
パッケージリポジトリが正常に更新されたかどうかを確認してください。

インターネット接続の問題を解決できない場合は、一時的にパッケージリポジトリを無効にすることも検討できます。

ソースリストファイルを編集します（先程と同様に実行します）：


sudo nano /etc/apt/sources.list
"deb http://kali.download/kali kali-rolling main contrib non-free non-free-firmware" の行をコメントアウトします（行の先頭に "#" を追加）。

ファイルを保存して閉じます。

パッケージリポジトリを無効にすると、Kali Linuxのパッケージをアップデートやインストールすることはできませんが、システムは以前にインストール

///////////////////////////////////////////////////////////////////////////
Kali LinuxでVirtualBoxをインストールする手順を以下に示します。Kali LinuxにはVirtualBoxのリポジトリがデフォルトで含まれているため、パッケージマネージャーを使用してインストールすることができます。

1 ターミナルを開きます。
2 アップデートとアップグレードを行うため、以下のコマンドを実行します。

sudo apt update
sudo apt upgrade

3 VirtualBoxをインストールするため、以下のコマンドを実行します。
sudo apt install virtualbox

5 インストールが開始されると、パッケージのダウンロードと依存関係の解決が行われます。確認プロンプトが表示された場合はYを入力し、Enterキーを押します。
6 インストールが完了すると、VirtualBoxがKali Linuxに正常にインストールされます。


これで、VirtualBoxがKali Linuxにインストールされました。インストールが完了したら、VirtualBoxを起動することができます。ターミナルでvirtualboxと入力し、Enterキーを押すか、アプリケーションメニューからVirtualBoxを起動します。

注意点: Kali Linuxにはすでに仮想化機能が組み込まれているため、VirtualBoxのインストールは必須ではありません。ただし、VirtualBoxを使用する場合は、上記の手順に従ってインストールすることができます。

///////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/69a7c470-073e-3641-7760-344ba9777d14.png)

追加
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f946fa11-eea1-1967-e5d9-ae7772c23453.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7dbb590d-4104-cdd8-7625-36a8d1184f53.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e92609fd-7c05-bcbe-7618-f26f4c9719dc.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/4fcd0598-5c6e-16b6-336d-42d7a91bdfc2.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/cef2e3ee-9900-4611-6dad-f461fe9068a8.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/2d44348f-230f-8080-e874-01ecc3f21943.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/5d0c346b-e713-de2f-cd35-3dae5fd3c797.png)


実施
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/3fe09929-46e0-6a74-b06d-aef058ae119b.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/59e0acfa-495a-b458-092d-296de8483c82.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/aa52d42b-987b-18c0-a9f1-5cf1673206c7.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1de3b497-9541-b087-4434-4a043dbb775c.png)


///////////////////////////////////////////////////////////////////
WebView XSS

Now let's see.

A client side injection vulnerability in secure store application.

This client side vulnerability is caused because of the use of webviews.

If you remember, our application's about US feature fetches some HTML page from a remote server.

Now let's quickly check how this page is being loaded.

I am trying to retrieve the page once again.

Look at that.

It is basically making a Http request.

Let me give a right click and click on do intercept response to this request and forward it.

Look at that.

We are getting some HTML response to this page.

Now what we can basically do is we can add some additional JavaScript here by saying script alert,

hagged

and forward this and let me show you what happened on the screen.

Look at that.

So basically, somebody who is able to do a man in the middle attack against this application in a coffee

shop can actually tamper the responses coming to this application and inject JavaScript that can be

executed by this app.

Now, instead of showing an alert box, it is possible to display a phishing page into which the victim

may enter the credentials leading to a phishing attack.

This is how client side attacks are also possible in iOS applications.

///////////////////////////////////////////////////////////////////
安全でないローカル データ ストレージの脆弱性 - ジェイルブレイクされていないデバイス

deploy the application

in debug mode.

As you can see, the application is now waiting for a connection.

Now let's open up another tab and type.

Objection, explore.

So basically we are going to use objection tool to explore the local data storage of the application.

Now, after running Objection Explorer, the application should be launched.

Now, this is the screen that we usually see when we launch the application.

Once again, we will have to configure the server.

So let's first configure the server using the IP address of the secure store server.

And let's quickly check if we are able to communicate with the server.

Yes, we are able to.

So now let's quickly log in using secure store account and let's tap on sign in.

There you go.

Now let's enter some local data into this application and let's type branch name and email ID.

Let's tap on save bank details and let's try to retrieve them as well.

Just to confirm that the app is functioning fine.

There you go.

Okay, Now, what we're interested in is we want to check the local data storage of this app on this

device.

Objection.

Supports both Android and iOS devices.

Now, we are only going to see the iOS specific features in this course.

Let's type env.

That's the first command that I always run when I do any iOS security assessments using.

Objection.

Look at that.

It is going to give us all the paths that we are interested in.

The first one is the bundle path.

So basically we can see the actual binary of this application inside this folder.

And this is the caches folder and this is the document directory and this is what we have explored earlier

and spotted a lot of sensitive data.

Now let's copy this and let's navigate to this directory by pasting it here.

Let's hit enter and let's type LS.

So if you look at the output, basically you are able to explore the file system of this app using objection

from this objection terminal.

We can actually run commands from the laptop.

To do that, we will just have to specify a bang or an exclamation mark and type the command.

Look at that.

Now let's type LS and this command will be executed on objections Shell.

So if you prefix the command with this, it will basically be executed on your laptop.

Now, what we are interested in is we want to take a look at the contents of these files.

So there are two options that we have within objection.

One, we can download the file onto the laptop and view the contents on the laptop, or you can also

view the file contents using the file command and using Cat and specify the name of the file.

As you can see, objection is already showing us with the list of files we have in this directory.

So what we are interested in is the user details dot p list.

Look at that.

Objection is able to read the file for us.

Nice.

Now the next one that I want to show is file download file.

And let's specify, download and look at that.

It is automatically showing us the list of files that are available for download.

Let's try to download this bank details dot db and look at that.

It is downloaded into the current directory.

This is the current directory on my local machine.

So let's quickly copy this and see if the file has been downloaded into this directory.

Look at that.

There is a file called Bank Details Dot DB.

Now we don't have to download these DB files onto the local machine because objection also comes with

a utility called SQLite.

So if you look at this SQLite connect bank details dot db.

Look at that.

We are able to connect to the bank details dot db file right from objection shell.

So now we can type dot tables.

Look at that.

This is much better in terms of the appearance.

So we can actually use objection itself instead of going back to the shell on the laptop.

Now this is the table that we have gotten.

Let's try to type select star from bank details and look at that.

That is very nice representation of this data.

Now, this is how we can explore local data storage using objection on Non-jailbroken devices.

//////////////////////////////////////////////////////////////////////
Download the vulnerable Apps from the link provided bellow (Minimum iOS version - iOS 12):

Bundle Identifiers: cst.securestorev1 and cst.securestorev2

https://drive.google.com/open?id=1gKeu6rZTu4OQPFUH3hF9_klREikGsovR

https://mega.nz/folder/dJ1FUaYZ#Qx5tDEUEAaikBom9BviiwA



Download the vulnerable Apps from the link provided bellow (Minimum iOS version - iOS 10):

Bundle Identifiers: cst.securestorev1.1 and cst.securestorev2.1

https://drive.google.com/file/d/1QTJlCZj0UIBTyZsZoTvrd4vcThvisRkq/view?usp=sharing

https://mega.nz/file/MANHjQJL#L8Cs1_lghkZ1zBrCdDTT5UvSQYC4m7cwgGRJmoD_Gyo



Download the vulnerable Apps from the link provided bellow (For iPhone SE 1st Generation):

Bundle Identifiers: cst.securestorev1.2 and cst.securestorev2.2

https://drive.google.com/file/d/1UxbKPvnfJDAiQA04EkpncxNfXkLx5w9D/view?usp=sharing

https://mega.nz/file/tEM3ESqJ#h3fNbB-GohxcevHgSrHp6bWkAjJq3t-OsebRYQqdA6A



Download backend server from the link provided below:

https://drive.google.com/open?id=1_yk2udm8bhTWGMV_srbLI7VDllJYXOt5



Usage: Import the ova file into virtual box and connect it in bridged network mode. So, this server will be reachable by the apps we are testing.

Credentials to login:

Username: securestore

password: securestore



Default user accounts available to login from the app (you can also register new account using signup feature):

+----+-----------------------+-

username | password

+----+-----------------------+-

securestore | securestore

attacker       | attacker

+----+-----------------------+-
///////////////////////////////////////////////////////////////////ジェイルブレイクされた iDevice を使用したラボのセットアップ

Now let's see how we can set up a lab using our jailbroken iPhone.

Obviously we need to have an iPhone which is jailbroken, to be able to follow the instructions in this

lab.

How to jailbreak an iPhone is out of scope for this course, but let me quickly show you how I have

jailbroken my device.

I am switching to a browser and as I mentioned earlier, the device that I have jailbroken is running

iOS 12.4.

So I have gone ahead and searched online for jailbreak exploits, which can be used to jailbreak my

device, which is iPhone six seconds running iOS 12.4.

And I found check rain.

And if you look at this, this is the latest release that I have used here.

And this relays basically fixes an issue in 12.4, which is exactly what I have in my hand.

It appears that this software was causing the device to panic and reboot on attempted shutdown.

I'm pretty lucky that I have a working exploit available when I wanted, so I have just gone ahead and

downloaded this for Mac OS and I have started this application and connected the device and the application

shows the step by step procedure to jailbreak the device.

So that's how I have jailbroken my device.

It is recommended to have a jailbroken device because the setup is going to be pretty easy if you have

a jailbroken device.

But if you don't have it, it's fine.

We are going to do everything even on a non jailbroken device as well.

All right.

So let me switch back to my slides.

And once after jailbreaking, the iPhone, you will see an application called Cydia.

Let me project the screen of my iPhone.

Okay.

So this is how the jailbroken iPhone looks like.

You can see there is an application called Cydia.

Cydia is something like app Store from where we can download tools that are useful for Pentesting.

Now I'm going to use Cydia to download Openssh.

This is the first tool that I usually download after jailbreaking any device.

So I'm going to search for Openssh and I'm going to click on that and I'm going to click install and

confirm.

And this should download Openssh for me.

All right.

So let me tap on return to Cydia, because Openssh is now installed.

Once that is done, let's go back to sources.

And click on edit.

And click on add.

And add another repo

build.frida.re

and tap on this add source button.

There you go.

So it is verifying the URL and this repo should be added into our CDR.

Okay, let's return to Syria.

And once that is done, we should see build .3.3 is there.

Let's tap on that and let's go to all packages.

And if you see, I have installed Frida for pre 812 devices.

If we install this, it is going to install Frida server onto the device and using Frida server.

As you can see from the description here, we can inject JavaScript to explore iOS applications over

USB.

We are going to see how we can do that later, but for now just install Frida server by choosing an

appropriate option here.

In my case my device is a pre 812 device.

You can actually check for your model and see which chip is being used in your device.

So depending on the chip that is used on your device, you need to install 812 plus or pre 812 or if

it is a 32 bit device, probably you should go for 32 bit version of Frida server.

Once this is done, we are pretty much done now since we have Frida server on the device.

We need to have Frida client on the laptop because it's a client server based setup.

We need to install a client on the local machine.

So let's switch to the terminal and install Frida.

But before that, I would like to make another point that we also need to install.

Objection.

Objection is another tool which is built on top of Frida and it can be used to perform runtime manipulation

of the applications.

It's not just runtime manipulation.

We can do much more than that, but I usually use objection for runtime manipulation in most of the

cases.

But in this course we are going to see other use cases of objection as well, such as exploring the

local data storage and stuff like that.

Now the reason why I have included objection here is that if we install objection on our local machine,

it will automatically install Frida for us.

So let's go ahead and install objection on the laptop.

In my case, I have already done that, but let me quickly show you how to install that on the GitHub

page.

And let's scroll down and if you see the installation is pretty simple, all you have to do is just

type pip3 install objection, right?

So once that is done you will have objection and Frida installed on the laptop.

In some cases the Frida and objection may not be in path.

That's what happened in my case.

My Frida and objection were installed, but when I tried to invoke them from the terminal, I get an

output of objection not found and Frida not found.

The reason is they are not added to the system path.

So if you face this problem you will have to manually add those binaries into your system path.

So once you are done with the installation of objection and Frida, we want to verify the setup that

we have done so far.

Number one, I want to verify my SSH connection.

Number two, I want to verify if Frida server is running fine.

Number three, I want to verify my objection.

Let's first begin with the SSH setup ssh route at 192.168.0.102.

We can check the IP address of the iPhone from the Wi-Fi settings.

This is how it looks like.

So in my case it is.

192.168.0.102 and I'm hitting enter.

And by default when you install open SSH from Cydia, the password is alpine.

So I have just entered alpine and I am able to log into the device.

So this is the spelling of Alpine and this is the password of open SSH by default when you install it

from Cydia.

Right.

So this confirms that my SSH setup is working fine.

Now let's go ahead and check if Frida is working fine or not to do a quick smoke test.

We can run.

Frida Dash.

Dash u dash u specifies that my device is connected over USB and Frida is going to make a connection

with the Frida server using the USB connection.

So let's type Frida Dash ps space dash UI so that we are going to get the list of bundle identifiers

that are installed on the device.

And let's probably grep for mail.

As you can see, the mail application is installed and my Frida client is able to list the bundle identifier

of this application.

Right?

Similarly, we can basically list out all the applications that are installed on the device.

You can also see this.

Application that I have shown you earlier and you can see application that is running on the device.

So essentially this Frida client is able to communicate with the Frida server and it is able to list

out all the apps that are installed on the device.

Now that's perfect.

So the Frida setup is working fine.

Now let me quickly check the objection setup as well.

As you can see, the objection is installed on my laptop.

Now, if we want to quickly check if objection is able to connect to the device, we can do that by

getting the bundle identifier of mail application once again.

And let's try to use this

objection dash dash gadget, and let's specify this bundle identifier and type explorer.

And I'm going to start the mail application on my device and let's hit enter.

As you can see, objection is able to hook into this mobile email application which is running on my

iPhone.

So this confirms that objection is working fine and we are good to go.

Let me go back to the slides.

I'm pretty much done with what I wanted to show in this video.

We have installed Openssh using Cydia.

We have installed Frida Server and we have installed objection on the laptop and we have also installed

Frida client on the laptop by installing objection.

And finally we have verified ssh Frida and objection setup.

So that brings us to the end of this video.

In the next video we are going to discuss how to install the vulnerable applications in the jailbroken

////////////////////////////////////////////////////////////////////

安全でないローカル データ ストレージの脆弱性
In this video.

Let's talk about insecure data storage.

Finding out insecure data storage vulnerabilities on an application requires you to have a jailbroken

device.

It is also possible for us to view the applications local storage on a non-jailbroken device using the

setup that we have.

So I'm going to demonstrate insecure data storage vulnerabilities both on a non-jailbroken device as

well as on a jailbroken device.

Okay, so now let's get started.

Mobile apps often store data on client side.

If you remember when we started the application for the first time, it was telling us that the server

is not configured.

How is it possible for the application to determine that the server is not yet configured?

It is making some client side check to see if a specific file exists.

If the server is already configured, the file exists and the app will not show us the message again.

Right.

So that means the app is storing something on the client side to do some tasks.

Similarly, some developers make a mistake of storing sensitive data on the client side.

While it is required for us to have jailbroken device to be able to access this data.

It is not a best practice to save sensitive data in clear text on the local storage.

Right?

So that's what exactly we are going to see in the vulnerable application in this video.

So these are the few ways that apps use to store local data.

Plist files NS user Defaults, SQLite databases, core data and keychain Plist file is something like

an XML file that can be used to store key value pairs and NS user defaults is also something similar

and SQLite databases are lightweight databases that can be used to store and retrieve data, and core

data is also something like SQLite databases and Keychain is Apple's recommended way of storing sensitive

data on the device.

In this course we are not going to go through every single type.

We will cover some of these based on the applications functionalities.

So the vulnerable application that we are going to use may store some sensitive data on the client side.

So let's go ahead and explore if it is storing any data on the client side using any of these techniques.

First we are going to do it on a jailbroken device and after that we are going to use a non jailbroken

device.

Okay.

So let's switch to a terminal and let me quickly find out the IP address of this device.

This is 102 SSH route at 192.168.0.102.

And let's enter the password.

And

now let's launch the application.

And let's first log in using secure store account.

And let's tap sign in.

Now let's tap on view profile once again just to make sure that we are browsing through the entire application.

Now let's enter some test data into this application.

This is like a secret vault application.

We can basically store some bank account numbers into this app, and when we want to view the information,

we can retrieve that.

So let's see how this app is storing all this data.

Bank name.

Let me enter test account number one, two, three, four, five, six, seven.

There are no restrictions on the client side, so you can basically enter anything.

But there are some basic validations.

Like if you don't enter every field, it is going to throw an error.

Similarly, if you try to retrieve something without entering an email ID, it will once again throw

an error.

Right.

The branch name test and email id test at test.com and let's tap on save bank details.

As you can see, your data has been saved successfully.

Now test@test.com

and let's tap on show bank details.

As you can see, it is retrieving whatever the data that we have entered, that's fine.

Now let's go ahead and explore the local file system of this app.

On the jailbroken device, as I mentioned earlier, the data directory is inside slash var.

Mobile.

Uppercase C containers.

Data application.

And inside this we will have some uuids.

Every time you install an application, it gets a new Uuid by the device.

Now we don't know the device Uuid yet, so let's just navigate to this directory first and we are going

to use some Linux foo to find out the directory of this application.

Let's type, find dash type and let's specify that it's a directory and let's specify the name of the

directory.

This has to be the bundle identifier of this app.

So it has to be CSD dot secure store.

We won.

So this is the bundle identifier of secure store v1 application.

So let's hit enter.

As you can see, it has identified the bundle identifier and this is the location of our application.

So let's navigate to this and let's type LS There are four different directories here, so let's navigate

to documents.

And there are some interesting files here.

One is bank details dot DB.

And another one is config dot plist.

First run dot p list and user details dot p list.

Since we don't need this mobile screen anymore, let me just expand it here.

Now.

What we are interested in is we are interested in all of them.

So let's go through one by one.

I will begin with this first run dot P list.

Let me copy this and type cat and paste the file name.

And if you look at this, it says is first run set to false.

So that means the app is already run.

Okay, so this file is not so interesting.

So let's go to the next one.

Let's go to config dot p list.

I'm going to open config dot playlist using cat.

And if you look at this, this p list file has the server IP address.

This is the server that we have configured.

So once again, not so interesting.

Anyway, we can see this IP address in Burpsuite.

Now let's go back and let's check out the next file which is user details dot P list.

Let's copy this and let's paste it and look at that.

It has an authentication token of a specific user and the username of that user is secure store and

it says he is logged in.

Now it is very common in bug bounty programs that if you find something like this on client side, they

will probably reject it.

Now what we have to do is we will have to turn this local storage vulnerability into something more

valuable.

So we are going to see how we can turn this into an authorization vulnerability later in this course.

But for now, remember, this is how you can explore the local data storage to find out sensitive data

that is stored by the app.

Now let's move on.

And there is one more file that is of our interest, which is bank details dot DB.

Let's check what kind of file it is by typing file space bank details dot db.

As you can see, this is a SQLite file, so we need to have a SQLite client like this.

Looks like we don't have any SQLite client on this device.

That's fine.

We can just pull this file out and we can explore it on the local machine.

So what I'm going to do is I'm going to desktop iOS Pentesting and here I'm going to make a new directory

called Local Storage.

And I'm navigating there and here I'm going to download that using Sftp 192 168.0.102 and let's enter

the password and let's provide the path of this particular file.

And let's type get slash bank details.

Dot db.

As you can see, the file has been pulled out.

Now let's quit.

And if you see the local storage folder, we do have a new file called Bank Details Dot DB.

Now let's once again run file command against it just to confirm that the file is intact.

Now let's use a SQLite command line client to connect to this.

And explore the database.

Okay.

We have connected to the database.

Now let's type dot tables.

There you go.

We can see the table names inside this.

We do have a table called Bank Details.

So let's run some basic SQL query to see if there is anything interesting in this table.

So select star from bank details.

Looks like there is something wrong here.

There is no from from is missing there.

And there you go.

This is what we have entered into the application.

This application is meant to be a secret vault.

It has to keep the secrets secret.

But it is exposing everything in clear text because the data that is entered into the app is being stored

on the disk in clear text.

Right.

So this is how we can identify local storage vulnerabilities in a jailbroken device.

In the next video, we are going to see how to explore local data storage using a non-jailbroken device.

//////////////////////////////////////////////////////////////////////
UI ペーストボード内の機密データ

Now let's see another commonly seen client side issue, which is storing sensitive data in the pasteboard.

So what it means is if you can copy something from your application, it will be stored in the device's

pasteboard.

So let's see how we can test for that.

Let's use objection to start the application.

As you can see, the application has been started.

In objection, we have an option where we can use iOS pasteboard and there is an option to monitor that.

So let's hit enter.

Now let's come back to the application and let's try to save something.

If you look at this, I have just saved something earlier.

It is just showing it here in the output.

Now, let me store something else.

Secure store and let me enter the password here.

And let me just quickly copy this and let me quickly sign in.

Okay.

Now look at that.

The password that I have just copied is pasted here.

So this is something that we can usually find in applications.

If the applications allow the users to copy something into the pasteboard, in this case, this secure

store application is allowing the users to copy the passwords into the pasteboard and we managed to

retrieve that content from the pasteboard using objection.

We can similarly do this on a non-jailbroken device by launching the application in debug mode and hooking

into that by using objection and then running this command iOS Space Pasteboard Space Monitor.

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1f11cf04-bdac-e84d-0c22-750feea54cd0.png)

//////////////////////////////////////////////////////////////////////////////////////////////////////
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/d41a5344-2c5a-a1eb-3ed3-ef589113ee71.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/203f10a4-7c7b-c68e-e96e-39e8926ba49c.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1f8ec8dc-077a-3a72-c8c8-a502a8c684f3.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/af6ce5ee-1fe0-f5e0-089e-e5cad78d592d.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/57f4cd5e-fff6-1f8f-d5bb-5fcae9214391.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f67a64a8-5e55-f9e7-7053-8831821a89e2.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f9e4e969-f1c4-fc7f-eb8c-8530ad5463de.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/69ec2680-4338-c063-7fce-4eabcfca6555.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f5cb481e-faa7-ce5f-da64-91c98e8014c2.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/90553acf-daf4-3dec-f2b3-dcaa27ac7b3c.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/21b61d9f-feb1-9745-1ae7-5e12356f77b4.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/d941c0bc-f8f9-89a2-c6f6-d11f7799dbee.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1bfa8aaf-a6ea-f584-d98e-9a22a6c1d4ef.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/287f78b4-d532-5b5f-33a7-507b5be67b0c.png)
//////////////////////////////////////////////////////////////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/3c25824a-8581-ad73-aa92-953e55b0c9ed.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/b916b140-3ea1-338f-2807-b9f7989bd944.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/234b971d-ea9b-4f91-38bf-06ebeeebd7fa.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1e6c3721-a55f-35ef-fae4-5a5b74f85a88.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/eb13c891-58f6-0d47-175f-58b895dd36c0.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ed01f44a-6433-2919-0ca0-04181cbbec5e.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/23e3d281-4d89-1602-5a5a-9651612df300.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e9ad622b-9057-60ae-ffc7-769d31ebc1ad.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/96eb6f77-d4b6-f9f1-0503-a5e85ac25be5.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/a6fae613-94be-0d3a-fc16-8c79c7e0a455.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/5b863c97-6f1b-127b-0a90-ca89b7225aa1.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/a60237f1-95bc-2f96-ef8e-7208fcce28d5.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/d18de0d7-6329-b9c4-bf43-b52621f94845.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/1dd5fde9-f1b2-cfd8-5629-b6792d4bc224.png)


・・・・・・・・・・・・・・・・///////////////////////////////////////////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/3ef1df55-d900-ba42-ab93-c877fd164770.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/9fce35f2-29f1-3090-6ebc-e3264fbb8d4a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/72ad38bf-f8b4-b024-054a-8f99e08c87e3.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7d3dbb18-86b2-c13a-5ad3-3b62605312e1.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/82dd494a-30f0-334e-839b-ad8680b9fb89.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/4a4240ce-dff0-ca19-32bf-96a2fb3eb09a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/51e749bc-6aa5-1f6f-1f40-552df3f6604b.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/c779edcb-f111-405c-2f49-0713901b4a5c.png)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/bfe09780-d032-5411-cd3e-b20f053a0e7c.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/4b0e5a24-3ae0-be48-4d04-a60ceaea6710.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/e145b777-72b2-8c2f-add8-8cfa42a0a29e.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7e6d5917-7de6-e1c8-6edd-8c9f8c332c1e.png)
X
///////////////////////////////////////////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/ace9075f-5e5a-eb01-49bd-db7d3785c4a2.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/0c9965d0-4826-4fd0-27b4-1246e029024a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/7d914bf0-6717-4409-de09-0dc3b2a88a98.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/2eb42d5d-4ef4-475a-ca92-adf7caf4a61c.png)
//////////////////////////////////////////////////////////////////////
１．ディレクトリを移動する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/94ee3223-f016-60de-d5ed-547a5e7de4b3.png)

２．ブランチの存在の確認
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/89b0c34e-7d15-4757-5992-a4a2dc9bc4c9.png)

アスタリスクが付いているのがメイン

３、切り替えをする
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/218a71c9-168c-3587-bbac-3b0806e56f96.png)

４，切り替え確認
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/87b4f4af-5f77-a9f7-6de7-137360e2af26.png)

５、間違えたらひとつ前に戻る方法
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/a18780f9-25e5-7b28-33c2-697b3e9c006d.png)
//////////////////////////////////////////////////////////////////////
redhat上手く登録できない
・https://qiita.com/Yuhkih/items/a976dde5f150aac1ff9a
・https://qiita.com/hiroyuki_onodera/items/a3c8e17c4bc01588ac5f


/////////////////////////////////////////////////////////////////////////

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/c9a81d3e-7588-bfd1-27ea-2d87b1dd1147.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/f23c1795-0b13-b6cb-224c-f3fd592c3b5e.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/46984294-f1d8-861e-b1e3-da04ceece0d1.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3477527/5c24757e-185b-2f03-ba55-f90ab9276f4d.png)

![uploading...0]()