среда, 2 октября 2013 г.

BLACKTRACK


Допиливание BackTrack 5

1 1. Устанавливаем "Полная инсталляция" - либо на флешку; - либо на хард. (этот этап я пропускаю, тут все понятно)
-----------------------------------------------------------------------------------------------------------------------------
2. Первая загрузка рабочего стола login: root pass: toor Запуск иксов: startx Первым делом избавляемся от утомительного ввода: логина, пароля, запуска иксов:

 Вариант 1 - оставляя root
1. Открываем терминал;
2. apt-get update
3. aptitude install rungetty
4. gedit /etc/init/tty1.conf
5. заменяем строчку: #exec /sbin/getty -8 38400 tty1 на exec /sbin/rungetty tty1 --autologin root
6. сохраняем результат
7. далее: gedit /root/.bash_profile вписываем startx
8. сохраняем. [свернуть]

Вариант 2 - Создавая нового пользователя Копирую дословно (сам не пробывал). Automatically Start X with GDM in BackTrack 5 I've heard about BT5 a while ago, but since it's also a Debian-based distro and I've been using Debian-based Linux distributions for like one-third of my life, I was reluctant. Until a couple of weeks ago, after a friend told me that it comes out-of-the-box with tons of InfoSec tools I've decided to give it a try just to see what it really can do. So I downloaded and install it in VirtualBox to give it a test-run. My first impression was it's like Arch Linux. By default, you'd be booted up on a Tty and you have to manually login as 'root,' with 'toor' as the default root password Then you have to run 'startx' so you can have a graphical interface – the BT5 way. It's pretty simple actually, but I don't think it's a very good idea for any smart Linux user to run it's entire system as root all the time. You might destroy your important system files before you know it. So in this tutorial let me share to you how I created a sudoer (regular user) account in a fresh installed BT5. And then we will try and install Gnome Desktop Manager (GDM) because Gnome is the default desktop environment pre-installed in BT5. OK, first we need to make a sudoer. It's actually very simple. Simply fire up your Terminal and then run the following command (assuming that you don't have a user account yet, so we're doing the entire process as root): For this example, we are going to use 'homer125' as our test username. # useradd -m -g users -G admin,video,disk,games,cdrom -s /bin/bash homer125 Then we need to add a password to your username: # passwd homer125 Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully After we have created a sudoer, we're going to install GDM, so we can boot up and login directly using the username (homer125) we've just created. To install GDM simply run this command in your Terminal: # apt-get install gdm Now we need to test GDM and see if it's working the way it should. To run GDM simply run this command: # gdm If GDM is working the way it should, you should see the good old Gnome login screen. Let me remind you , the default login screen is quite ugly so you gonna have to be patient about it, you can change it though if you want to. Now, try to login using your new username. If you see no problem, restart your computer and then login again as root in Tty. This time we're going to automate GDM so you won't have to login as root everytime you boot up before you can go the the graphical interface. To do just that, you have to edit /etc/init/gdm.conf using vim (or nano). I suggest you create a backup of your gdm.conf file first, just in case you run into trouble along the way. # cp /etc/init/gdm.conf /etc/init/gdm.conf.backup # cd vim /etc/init/gdm.conf By default this is what gdm.conf file in BT5 looks like: # gdm - GNOME Display Manager # # The display manager service manages the X servers running on the # system, providing login and auto-login services description "GNOME Display Manager" author "William Jon McCann " start on (filesystem and started dbus and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udevtrigger)) stop on runlevel [016] emits starting-dm env XORGCONFIG=/etc/X11/xorg.conf script if [ -n "$UPSTART_EVENTS" ] then [ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/gdm" ] || { stop; exit 0; } # Check kernel command-line for inhibitors for ARG in $(cat /proc/cmdline) do case "${ARG}" in text|-s|s|S|single) plymouth quit || : # We have the ball here exit 0 ;; esac done fi if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG LANGUAGE elif [ -r /etc/environment ]; then . /etc/environment export LANG LANGUAGE fi export XORGCONFIG exec gdm-binary $CONFIG_FILE end script Highlighted in orange are the codes that you need to remove for you to be able to automate GDM at bootup. Once you have trimmed the code, your gdm.conf file should now look exactly like this: # gdm - GNOME Display Manager # # The display manager service manages the X servers running on the # system, providing login and auto-login services description "GNOME Display Manager" author "William Jon McCann " start on (filesystem and started dbus and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udevtrigger)) stop on runlevel [016] emits starting-dm env XORGCONFIG=/etc/X11/xorg.conf script export XORGCONFIG exec gdm-binary $CONFIG_FILE end script Now, restart your computer. You should now be able to run X and login with your new username via GDM automatically. I've only used BT5 for like 2 days, but I think I'm going to like it. Happy BackTracking! Cheers  [свернуть]
------------------------------------------------------------------------------------------------------------------------------

3. Далее меняем xsplash (не знаю как вам, но тот красный, который по умолчанию стоит, меня раздражает) Ubuntu Lucid использует систему plymouth для отображения загрузочной заставки xsplash. Все темы хранятся в /lib/plymouth/themes, а по умолчанию в 10.04 используется тема ubuntu-logo. Настройки же хранятся в файле /lib/plymouth/themes/default.plymouth. У него вот такое содержание: [Plymouth Theme] Name=Ubuntu Logo Description=A theme that features a blank background with a logo. ModuleName=script[script] ImageDir=/lib/plymouth/themes/ubuntu-logo ScriptFile=/lib/plymouth/themes/ubuntu-logo/ubuntu-logo.script [свернуть] Как видно из файла настроек, plymouth использует скрипт ubuntu-logo.script, что позволяет очень гибко настроить свой splashscreen. Именно в этом файле можно ручками указать тему для xsplash. Но в это вникать пока не будем. Для начала устанавливаем дополнительные темы plymouth: - в "Центре приложений Ubuntu "набираем plymouth и выбираем нужную тему; - на http://gnome-look.org/ (обычно они называются plymouth-theme-*). Предварительно распоковав в папку: /lib/plymouth/themes/ и установив кимандой: update-alternatives --install /lib/plymouth/themes/default.plymouth default.plymouth /lib/plymouth/themes/новая тема/новая тема.plymouth 100 1. Открываем терминал; 2. sudo update-alternatives --config default.plymouth (На экран выведется список установленных тем. Выбираем нужную (вводим ее номер)); 3. Нажимаем Enter; 4. Далее вводим: sudo update-initramfs -u (это обновит образ initramfs); далее... ----------------------------------------------------------------------------------------------------------------------------------

4. На этом этапе, не вздумайте полностью обновляться !!!! Открываем терминал, и вводим sudo apt-get update [свернуть]
----------------------------------------------------------------------------------------------------------------------------------

5. Чистим систему путем создания нового текстового файла "Create Document" - "Empty File" делаем BASH скрипт #!/bin/bash OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}') CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g') LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)" METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)" OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL) YELLOW="\033[1;33m" RED="\033[0;31m" ENDCOLOR="\033[0m" if [ $USER != root ]; then echo -e $RED"Ошибка: вы должны быть root" echo -e $YELLOW"Выходим..."$ENDCOLOR exit 0 fi echo -e $YELLOW"Очищаем кэш apt..."$ENDCOLOR sudo aptitude clean sudo aptitude autoclean sudo apt-get autoremove echo -e $YELLOW"Удаляем старые конфиги..."$ENDCOLOR sudo aptitude purge $OLDCONF echo -e $YELLOW"Удаляем старые ядра..."$ENDCOLOR sudo aptitude purge $OLDKERNELS sudo dpkg -P $OLDCONF” echo -e $YELLOW"Опусташаем все корзины..."$ENDCOLOR rm -rf /home/*/.local/share/Trash/*/** &> /dev/null rm -rf /root/.local/share/Trash/*/** &> /dev/null echo -e $YELLOW"........................."$ENDCOLOR sudo apt-get update sudo apt-get gconf-cleaner sudo apt-get thumbcheck sudo apt-get cleaner.sh sudo rm -f /var/cache/apt/*.deb sudo apt-get -f install [свернуть] - Сохраняем на рабочий стол; - Кликаем в свойство файла, и делаем его "Read and write"; - Ставим галочку на "Allow executing file as program"; - Кликаем по файлу, запускаем в терминале; - Чистка началась.
 ---------------------------------------------------------------------------------------------------------------------------------

6. Русифицируем Для проверки всех доступных локализаций для программ, достаточно просто набрать команду:
aptitude search ~n-ru$ ~n-ru-base

1. Перед татальной русификацией устанавливаем Open Office.org (после русификации, установка данного пакета, будет невозможна)

Bash скрипт (Open Office.org)
 #!/bin/bash sudo apt-get update sudo apt-get install -y --force-yes openoffice.org sudo apt-get install -y --force-yes openoffice.org-l10n-ru sudo apt-get install -y --force-yes openoffice.org-help-ru sudo apt-get install -y --force-yes openoffice.org-hyphenation-ru sudo apt-get install -y --force-yes openoffice.org-thesaurus-ru sudo apt-get install -y --force-yes openoffice.org-spellcheck-ru sudo apt-get install -y --force-yes sword-language-pack-ru sudo apt-get install -y --force-yes myspell sudo apt-get install -y --force-yes myspell-ru sudo apt-get install -y --force-yes myspell-dictionary-ru [свернуть]

Bash скрипт (татальная руссификация)

 #!/bin/bash sudo apt-get update sudo apt-get install -y --force-yes language-selector sudo apt-get install -y --force-yes language-selector-qt sudo apt-get install -y --force-yes language-pack-ru sudo apt-get install -y --force-yes language-pack-ru-base sudo apt-get install -y --force-yes language-pack-gnome-ru sudo apt-get install -y --force-yes language-pack-gnome-ru-base sudo apt-get install -y --force-yes gnome-user-guide-ru sudo apt-get install -y --force-yes language-support-ru sudo apt-get install -y --force-yes language-support-writing-ru sudo apt-get install -y --force-yes language-support-translations-ru sudo apt-get install -y --force-yes language-support-extra-ru sudo apt-get install -y --force-yes language-support-input-ru sudo apt-get install -y --force-yes kde-l10n-ru sudo apt-get install -y --force-yes kdevelop-l10n-ru sudo apt-get install -y --force-yes language-pack-kde-ru sudo apt-get install -y --force-yes console-cyrillic sudo apt-get install -y --force-yes ttf-arhangai sudo apt-get install -y --force-yes xfonts-cronyx-koi8r-misc sudo apt-get install -y --force-yes xfonts-cronyx-isocyr-misc sudo apt-get install -y --force-yes xfonts-cronyx-misc [свернуть] Поле заходим: - Теперь надо добавить раскладку: Settings - System settings - Input devices - Keyboard - Layouts - Add layout - System - Administration - Longuage Support - Выбираем Русский как основной. Проверка установленных локализаций: ru_RU.cp1251 ru_RU.koi8r ru_RU.utf8

1. Открываем терминал:
2. далее: sudo locale-gen
3. далее: sudo locale
4. далее: sudo locale -a (локаль прописанна не везде, доделаем позже .... )
 ---------------------------------------------------------------------------------------------------------------------------------

 7. Устанавливаем "Твикеры, и дополнительный софт" Ailurus, Ubuntu-Tweak, Software-Center -
BASH скрипт
 - #!/bin/bash sudo apt-get install -y --force-yes software-center echo "deb http://ppa.launchpad.net/ailurus/ppa/ubuntu `lsb_release -cs` main" | sudo tee -a /etc/apt/sources.list sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 5A16033A9A6FE242 sudo apt-get update sudo apt-get install -y --force-yes ailurus sudo add-apt-repository ppa:tualatrix/ppa sudo apt-get update sudo apt-get install -y --force-yes ubuntu-tweak sudo apt-get install update-manager-core [свернуть]

Устанавливаем Google Chromium

1. apt-get install chromium-browser 
2. cd /usr/lib/chromium-browser 
3. hexedit chromium-browser 
4. жмем TAB наш курсор передвигается в правую колонку в столбике
5. ctrl+s в строку поиска вбиваем geteuid
6. меняем на getppid и жмем ctrl+x
7. пользуемся [свернуть]

Устанавливаем Google Chrome

1. Устанавливаем браузер
 2. gedit /opt/google/chrome/google-chrome 
3. спускаемся в самый низ и меняем строчку exec -a "$0" "$HERE/chrome" "$@" на exec -a "$0" "$HERE/chrome" "$@" --user-data-dir 
4. сохраняемся
5. пользуемся [свернуть]

Устанавливаем VLC Player - после всех установок чистим нашим скриптом
----------------------------------------------------------------------------------------------------------------------------------
9. Теперь можно обновиться целиком Открываем терминал, и вводим
  apt-get update apt-get upgrade apt-get dist-upgrade aptitude update aptitude safe-upgrade aptitude full-upgrade sudo do-release-upgrade - После "Чистим скриптом"
 -----------------------------------------------------------------

Выкачиваем из репозиториев Backtrack софт

Добавьте в /etc/apt/sources.list строки: deb http://all.repository.backtrack-linux.org revolution main microverse non-free testing deb http://32.repository.backtrack-linux.org revolution main microverse non-free testing deb http://source.repository.backtrack-linux.org revolution main microverse non-free testing GPG ключ находится тут http://all.repository.backtrack-linux.org/backtrack.gpg .
Для его активации выполните с правами root: $apt-key add /путь_к_файлу/backtrack.gpg Потом синхронизируйте списки пакетов: $aptitude update Если у вас вышло сообщение «aptitude: command not found», сделайте $apt-get install aptitude
Всё, можно ставить софт.
Очень интересной платформой является Metasploit. Установка Metasploit: $su - $aptitude install metasploit ruby libruby rdoc libyaml-ruby libzlib-ruby libopenssl-ruby libdl-ruby libreadline-ruby libiconv-ruby rubygems subversion libsqlite3-ruby sqlite3 libsqlite3-dev Установился метасплоит у нас в /opt/metasploit. У него есть три режима: Консольный: $msfconsole GUI-интерфейс $msfgui И веб-шкура (после запуска доступен по http://127.0.0.1:55555)
Источник: http://suli-company.org.ua/it/unix/193-ustanovka-i-dopilivanie-backtrack-5.html © SULI COMPANY

Комментариев нет:

Отправить комментарий