Edit windows registry from linux

Редактирование реестра Windows из Ubuntu

Тем, кто занимается администрированием Windows, Ubuntu тоже может послужить хорошую службу в качестве «спасательной» рабочей среды, которую можно запустить с диска или USB-флэшки, например, на зараженном вирусом компьютере, чтобы провести «оперативное лечение». Тут можно и проверить файловые системы на ошибки, и отредактировать разделы жесткого диска, и внести правки в файлы, и даже сбросить пароль Windows! А сегодня хочу рассказать еще об одной интересной возможности — редактировании реестра Windows из Ubuntu.

http://vvc23.ru анализ сайта pinupbet.

Для чего может понадобиться редактировать реестр из Ubuntu? Элементарный пример: вирус заблокировал Windows — в систему войти невозможно. Необходимо найти и удалить блокиратор из автозагрузки Windows, но сделать это в самой Windows — невозможно. Что же остается делать?

1. Загружаемся с диска Ubuntu, USB-флэшки Ubuntu или устанавливаем Ubuntu второй системой.

2. Открываем терминал (CTRL+ALT+T). Устанавливаем пакет chntpw:

sudo apt-get install chntpw

3. Теперь нам необходимо подключить диск с Windows к системе. Для начала, определимся где он и как называется:

ищем раздел NTFS с нужным размеров (вы ведь знаете, какого размера у вас диск C: ?). Смотрим как он называется (будет что-то вроде: /dev/sda2) и далее выполняем:

sudo mkdir /media/windows
sudo mount /dev/sda2 /media/windows

где заменяем /dev/sda2 на свой вариант.

4. Запускаем утилиту для редактирования реестра Windows:

chntpw -l /media/windows/Windows/system32/config/software

Редактирование осуществляется перемещением по веткам реестра, по аналогии с папками — командой cd, например:

cd Microsoft/Windows NT/CurrentVersion/Winlogon

просмотр ключей в текущей ветке — команда dir. ключи редактируются командой ed, например:

Существуют ли программы под Linux для редактирования системного реестра Windows?

В общем, есть ли такое вообще?

Унесено в talks, ибо проект исчез с гитхаба.

И где его теперь искать?

Исчез проект файловой системы HIVEXFS, использующей HIVEX. Сам HIVEX никуда не исчез, всё так же в составе libguestfs.

app-crypt chntpw 110511 Offline Windows NT Password & Registry Editor

app-misc hivex 1.3.7 Library for reading and writing Windows Registry ‘hive’ binary files

Установил. Оно без графического интерфейса что-ли?

а с GUI ничего не существует?

дык regedit идет в комплекте с wine и отлично работает.

он не открывает файлы реестра Windows 7 почему-то

потому, что реестр не нужен

Помню в сборке с касперским что-то такое было.

Видел на DrWeb Live, но не пользовался — ненужно.

существуют, но не нужны.

сказал бы хоть названия что-ли

Текстовый редактор. Я серьезно.

я пользовал KAV 2012 Rescue CD, там в составе была тулза для копания в реестре винды.. помоему это какой-то их самописный проджект.

а отдельно его нет? Лайвсиди я могу и виндовый использовать, но хочется чинить винду из-под загруженной Убунты.

Читайте также:  What is windows firewall service name

не знаю, зайди к ним на сайт, может они распространяют эту штуку отдельно

Нет конечно, ибо им смысла нет.

Редкктировать текстовым редактором бинарные файлы? Ну-ну… Может HEX редактор всё таки?

Может хватит гнать-то? Вот эти «Ну-ну» или от снобизма, или от обскурантизма. Если ты реестор не знаешь и формат бинаря — тебе HEX не поможет. Если знаешь сам реестр, можешь написать .reg (на край бэкап из .sav нужного улья можно на другой винде открыть и сдампить — отличаться он будет несильно, и как правило в лучшую сторону) и отредактировать как тебе надо, а потом так же к реестру результат применить.

The Linux Girl

Friday, January 9, 2009

Editing Windows Registry Through Linux

There are many Windows/Linux dual booters out there that manage to somehow mess up the registry on their Windows partition (usually the case causing them to not be able to boot.) When this happens most users do not know where to turn other than to a Windows disc. BUT, there is a solution.

Windows stores registry files in the «C:\Windows\System32\config» directory. While there do not seem to be any Linux utilities to open/edit these hives, there is still a solution. Of course — using 3rd party Windows registry viewers/editors through WINE. There are many 3rd party programs that work similar to regedit, usually only allowing you to view registry hives and export them to REGEDIT4 format (.reg files used to modify the registry.) An example of one of these would be Regworks. These programs can be used very easily to do many tasks.

For an example, you could use these programs to extract registry trees related to certain Windows programs that do not work quite correctly through WINE. For instance, Adobe Photoshop. At the moment WINE does not fully install this program, so in order to get it to work, you just need to export the HKLM\Software\Adobe tree into a .reg file and run it through WINE’s regedit. As compared to guides out there about how to install Adobe Photoshop, this keeps you from needing to log onto Windows and extract it, then switch back to run. And no one’s perfect. It’s easy to mess that up or forget something and need to make multiple annoying trips back and forth.

There are many reasons why someone could need to edit their Windows registry from a Linux machine, and I hope this little trick will help someone out there solve a problem.

9 comments:

Yeah, thanks!
I completely messed up my Windows by trying to change the device letter, I want to change it back to how it was. I used the registry editor.

I screwed up my sister’s LogonUI. and the hard drive was locked in Linux due to a forced shutdown of XP (. had to force the Linux mount). and after those obstacles, I thought I was going to be cut short by the one step that shouldn’t even be a problem.

Читайте также:  Как убрать зарезервированную оперативную память windows 10 64 bit

Pretty cool, I’m going to try that to get rid of a locked key leftover from malware. Glad I carry my linux on a flash drive at work.

How to Edit Windows Registry Using Ubuntu?

Once you hit by any computer virus, there is a possibility for a corrupted Windows registry or modified by the virus. You will be stuck with that point, and you won’t be able to boot to Windows or edit the registry from Windows. Most of the time, it won’t allow you to execute Regedit command from your affected PC. One of the best solutions is to use a Linux thumb drive to temporary boot on your PC, access your Windows registry and modify it.

Let us see how to modify the Windows Registry using Ubuntu from an external USB without harming the Windows OS installation.

Editor’s Note: If you don’t have a bootable Linux USB, please scroll down for the guide to create a Live Ubuntu Thumb Drive.

How to Edit Windows Registry Using Ubuntu from a Live USB

Linux is offering a fantastic utility named chntpw , which was originally designed to reset passwords, and then acquired the registry editing ability. You can use chntpw to edit your Windows registry, and it is coming with free Ubuntu OS.

Here are the steps to reset the password using the Ubuntu OS CD.

  1. Boot from a LiveCD (you can create from downloading ISO files from Ubuntu website) one or install a second system Ubuntu.
  2. Install chntpw utility:
    sudo apt-get install chntpw
  3. Find the Windows partition:
    sudo fdisk-l
  4. Assume it is on /dev/sda2. Next step is mounting of the partition:
    sudo mkdir /media/windows
    sudo mount /dev/sda2 /media/windows
  5. Edit Windows registry now
    chntpw -l /media/windows/Windows/system32/config/software
  6. Move to registry branch you need, for example:
    cd Microsoft\Windows NT\CurrentVersion\Winlogon
  7. And edit a key, for example:
    ed Shell

Just cite the places in the registry where they can hide a record of running viruses:

HKCU\Software\Microsoft\Windows\CurrentVersionRun
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersionRun
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersionWinlogonShell
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersionWinlogonNotify HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersionWinlogonUserinit HKLM\SOFTWARE\Microsoft\Windows\CurrentVersionExplorerSharedTaskScheduler HKLM\SOFTWARE\Microsoft\WindowsCurrentVersionShellServiceObjectDelayLoad

The default values in Regedit:

[HKLM\Software\Microsoft\Windows NT\CurrentVersionWinlogon]
«Shell» = «Explorer.exe»
«Userinit» = «C:WINDOWSsystem32userinit.exe»

Check Explorer.exe file for the double presence, the right place for the file in Windows but not Windows > System32.

Turn off your Ubuntu, after this procedure and remove the USB drive from Windows Machine. Now restart Windows and make sure the Windows is loading properly without any issues. Good Luck!

Create a Live Ubuntu Thumb Drive

Now, your Windows PC is obviously not booting so you can’t use it to create a live Ubuntu USB. You may have to borrow a friend’s or use another PC you may have around.

  1. Download any version of Ubuntu (preferably the latest) from their official website.
  2. Download Rufus. Rufus is a utility that helps create bootable USB flash drives, such as USB keys/pen drives, memory sticks, etc.
  3. Insert a USB drive into the PC with 4GB or more capacity. This should be the USB drive you will use to boot Ubuntu and edit Windows registry.
  4. Launch Rufus.
  5. Select your USB drive from the Device drop-down menu.
  6. Next, click SELECT then navigate to and select the downloaded Ubuntu image file.
  7. Make sure all the other options are as shown in the screenshot above.
  8. Click START.
  9. You may be asked to download additional Syslinux files, choose Yes.
  10. Then you’ll see a ISOHybrid image detected warning. Choose to Write in ISO Image mode (Recommended) and click OK.
Читайте также:  Редакции windows 10 по порядку

Rufus will take some time to copy all the necessary image files to the USB drive. You can track the progress from the progress bar. When it’s complete, click CLOSE and remove the USB. Now you have a bootable Linux OS in your USB drive.

Repair Windows Registry with Linux Live USB

You did the Windows registry fix from Linux OS. Now you can boot back to Windows, and make sure Windows is loading. Before you start using the Windows, you have to run all possible scan to makes sure that you completely removed the malware or virus affected in your system. Please use some virus scanner and antimalware tools to clean up the Windows System.

Modifying Windows registry from within Linux

I have a windows dd image that I have locally mounted.

I need to apply a series of registry tweaks from a known .reg file, within this Linux environment. I can’t seem to find any tool that satisfies this.

I have found regpatch and hivexsh but they don’t seem to do what I need, or I’m using them terribly wrong. Are there any working examples of performing such a task?

3 Answers 3

I think what you are looking for is chntpw (it’s the same as mentioned in Ben’s question, btw). It comes as package (Ubuntu sudo apt-get install chntpw ) with modern distros and allows listing or editing the registry, given the hive file of a Windows installation. Hive files are ntuser.dat in the profile directories of user as well as the files under %SystemRoot%\system32\config such as software .

From the man chntpw page:

Caution: keep in mind that the format isn’t officially documented by Microsoft and therefore any third-party editing tools could potentially damage the hives they load and manipulate. Take a backup!

As for applying a .reg file I don’t think you’ll get around parsing it yourself. It is basically just an INI/INF file with a special first line and sections named after the keys and values that have been escaped according to the type of the value. @ is a special value name for the default key. The rest is self-evident from looking at the file.

Python comes with built-in capabilities to parse INI files, so it provides a good starting point.

Оцените статью