<html> <title>総復習ノート</title> <body> <pre> マルウェアに感染させる ターゲットを決めてメールで飛びつきそうなリンクをあたえて 情報を流出させるまたはマルウェアなどのプログラミングをインストールさせる 昔ながらの投網式ではなく ターゲットをしぼるのでスピアー攻撃と呼ばれている アフェリエイト リレーチャット C&Cサーバー ISPもボットに特徴のある通信をわかってきてる カスペルスキー ウイルス対策ソフトかなり細かい ユーザーの管理 useradd ユーザーを作成する userdel ユーザーを削除する usermod ユーザーの設定を変える ユーザーのデーターベース /etc/passwd ファイル ユーザー名:x:UID:GID:コメント:ホームディレクトリのパス:ログインシェル ↑元のパスワード情報 UID ユーザーIDのこと ROOTのホームディレクトリは/root 他のは基本は/home/ユーザー名 ~(チルド)ユーザー名ならガチでホームディレクトリ cd ~ /etc/shadow ファイル(スーパーユーザーのみ読み取り可) ユーザー名:暗号化されたパスワード:1970年1月1日からの最終更新日:パスワードを変更しなければならない日までの日数: VIPW /etc/passwdを直接編集するコマンド VIGR /etc/groupを直接編集 グループの管理 グループのデーターベース /etc/groupファイル グループ名:x:GID:メンバーのリスト ↑元はパスワードの情報 /etc/gshadow ファイル グループ名:パスワードの情報:グループ管理者のリスト:メンバーのリスト グループのパスワードは設定すべきではない 理由:同一を複数の人間が知っていればパスワードはバレるときゃバレる パーミッション ファイル OR ディレクトリ 所有者(オーナー)と所有グループ ls -lコマンドの出力 -rw-r--r-- ○ オーナー名 所有グループ名 サイズ タイムスタンプ ファイルの名前 ↑ここがパーミッションの設定 ーならファイル d ならディレクトリ l ならリンク オーナーの権限、所有グループの権限、その他の人の権限と設定がみれる r:読み取り権 w:書込み権 x:実行権(通過権) rwx = 7 rw- = 6 r-x = 5 r-- = 4 ひとつひとう設定するニーモニックというのもあるよ uファイル所有者 gグループ oそのほか a全部 利用例 chmod a+x file 全ての人に実行権をあたえる chgrp グループを変更できる umask ファイル OR ディレクトリ 作成次のパーミッションを決定するパラメータ ex ファイル作成のデフォルトパーミッション 666 この時、umask=022なら 644 lrwxrwxrwx 1 root root 4 Feb 28 09:15 /dev/cdrom -> scd0 brw------- 1 sugaya disk 11, 0 Feb 28 09:15 /dev/scd0 ブロックデバイスファイル crw-rw-rw- 1 root tty 5, 0 Feb 28 09:15 /dev/tty キャラクターデバイス 実は画面?! ls /mnt umount /dev/sdb プロセス psで自分が実行しているプロセスが見れる いままで実行したpsコマンドを並べてみると 92 ps ax|frep sendmail 93 ps ax|grep sendmail 623 ps ax | grep syslog 626 ps ax | grep syslog 692 ps 693 ps -e 694 ps -e|grep named 696 ps -e|grep named ********* simple selection ********* ********* selection by list ********* -A all processes -C by command name -N negate selection -G by real group ID (supports names) -a all w/ tty except session leaders -U by real user ID (supports names) -d all except session leaders -g by session OR by effective group name -e all processes -p by process ID T all processes on this terminal -s processes in the sessions given a all w/ tty, including other users -t by tty g OBSOLETE -- DO NOT USE -u by effective user ID (supports names) r only running processes U processes for specified users x processes w/o controlling ttys t by tty ps -afw ps -ax cat &(バックグラウンド実行) 権限さえあれば誰のでも終了できる kill プロセス番号 自分のbashで管理されているものの場合 kill %ジョブ番号 ↑二つは無理矢理停めてるわけではないのでゾンビプロセスが生まれないで済む きつい割り込み これをやったら大概のものは止まる kill -9(sigkill) プロセス番号 標準入出力、エラー出力 標準入力→プロセス→標準出力 ↓→標準エラー出力 ex. catコマンド 標準入力=キーボードまたはファイル 標準出力=コンソール画面 標準エラー出力=コンソール画面 入力リダイレクト コマンド<入力先 入力元→コマンド 出力リダイレクト コマンド>出力先 コマンド→出力先 エラー出力リダイレクト 2> コマンド 2>出力先 コマンド→出力先 追記 >> コマンド>>出力先 コマンド→出力先のファイルに追記 パイプ コマンド間の標準出力と標準入力結合 コマンド1|コマンド2 コマンド1→コマンド2 標準出力と標準エラー出力の結合 コマンド>&出力先 ネットワークの設定 /etc/sysconfig/network-scripts/ifcfg-インターフェイス名 ex.ifcfg-eth0 # Intel Corporation 82562V 10/100 Network Connection DEVICE=eth0(ファイル名よりこっちの名前が優先される) #BOOTPROTO=dhcp HWADDR=00:19:D1:63:9E:35 ONBOOT=yes(システムがブートアップするときにこのインターフェースを有効にする) BOOTPROTO=none(ブートアップするプロトコルを指定。DHCPかnoneしかない?!) ここから下はDHCPを使わない場合の設定 (HWADDR=MACアドレス これは必ずしも必要ではない) IPADDR=192.168.128.212(IPV4のアドレス) NETMASK=255.255.255.208(サブネットマスク) GATEWAY=192.168.128.209(デフォルトルーターのアドレス) IPV6INIT=yes(IPV6を起動する) IPV6ADDR=fd00:0:0:0::212(本来は固定アドレスは必要ない。必要なのは鯖のみ IPV6/プレフィックス長) TYPE=Ethernet PEERDNS=yes USERCTL=no #IPV6_DEFAULTGW=fe80::260:67ff:fe07:4c98 #IPV6_DEFAULTDEV=eth0 /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=ホスト名 (GATEWAY=デフォルトゲートウェイのアドレス) loはループバックインターフェースなのでかかんでもわかってくれる /etc/hostsファイル # Do not remove the following line, or various programs # that require network functionality will fail. ::1 localhost.localdomain localhost 127.0.0.1 localhost.localdomain localhost ここに自己解決したいアドレスをしていするとDNSを頼らなくてもおk /etc/resolv.confファイル #nameserver 211.129.14.134 #nameserver 211.129.12.43 #nameserver 192.168.128.213 #nameserver 192.168.128.242 nameserver 192.168.128.212 nameserver 192.168.128.211 nameserver fd00:0:0:0::212 #nameserver fd00:0:0:0::211 nameserver 192.168.128.213 #nameserver 192.168.128.214 #nameserver fd00:0:0:0::213 #nameserver fd00:0:0:0::214 nameserver ネームサーバー domainname 自分の存在しているドメイン .で終わってない場合 serch 補完ドメインリスト /etc/protocol プロトコル番号集 /etc/services ポート番号 ifconfig ネットワークの確認 route ルーティング情報を確認 netstat ーA アクティブになっているポートを全て表示 ping(ping6) これが通って確認できるのはIPレイヤーが動いてるか通信できるかどうかしか確認できん dig DNSがちゃんと動いているか確認する traceroute IPヘッダの中にあるTTL(ひとつルーターを中継すると寿命がひとつ経る)が消えたときルータが返事を返す もしsugaya.webというドメインを解決できるようにしたいなら zone "web" サービスの管理 service コマンド service サービス名 サービスにあたえるコマンド (start,stop,restart,status) chkconfig 起動時にサービスを起動するかどうか設定する chkconfig --list servicename chkconfig --level [service-run-level] servicename ON/OFF Linuxのランレベル 3:テキストモード、マルチユーザー 5:X マルチユーザー 起動時のランレベル設定 /etc/inittab ファイル id:3:initdefalt DHCPサーバー /etc/dhcpd.confファイル # # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample ddns-update-style none; ignore client-updates; subnet 192.168.128.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.128.1; option subnet-mask 255.255.255.0; # option nis-domain "domain.org"; # option domain-name "domain.org"; option domain-name-servers 211.129.14.134,211.129.12.43; # option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2; range dynamic-bootp 192.168.128.136 192.168.128.139; default-lease-time 21600; max-lease-time 43200; # we want the nameserver to appear at a fixed address # host ns { # next-server marvin.redhat.com; # hardware ethernet 12:34:56:78:AB:CD; # fixed-address 207.175.42.254; # } } subnet x.x.x.x netmask m.m.m.m { option routers R.R.R.R; option domain-name-server s.s.s.s; range dynamic-bootp Y.Y.Y.Y z.z.z.z; } </pre> </body> </html>
このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー と 利用規約 が適用されます。
1文字以上入力してください
本文は少なくとも1文字以上必要です。
1文字以上入力してください。
下から選んでください: