<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacktopia &#187; Linux</title>
	<atom:link href="http://www.hacktopia.net/wp/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacktopia.net/wp</link>
	<description>The zen of hacking</description>
	<lastBuildDate>Tue, 15 Jun 2010 17:40:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Easiest way to relay mail through GMail using Postfix and Debian</title>
		<link>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/</link>
		<comments>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 21:41:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=188</guid>
		<description><![CDATA[There are times when you need need to send E-Mail from your Linux server.  The reason that I had to set up E-Mail was because I had a php script that E-Mailed me once some one filled out their information on the website.  The easiest way to get your server sending mail is using GMail [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you need need to send E-Mail from your Linux server.  The reason that I had to set up E-Mail was because I had a php script that E-Mailed me once some one filled out their information on the website.  The easiest way to get your server sending mail is using GMail to send the mail.  This tutorial will describe how to set it up on Ubuntu / Debian.</p>
<blockquote><p><code>sudo aptitude install postfix libsasl2 ca-certificate libsasl2-modules</code></p></blockquote>
<p>You want to add the fowling lines to your /etc/postfix/main.cf</p>
<blockquote><p><code>relayhost = [smtp.gmail.com]:587<br />
smtp_sasl_auth_enable = yes<br />
smtp_sasl_password_maps = hash:/etc/postfix/</code>gmail_passwd<br />
<code> smtp_sasl_security_options = noanonymous<br />
smtp_tls_CAfile = /etc/postfix/cacert.pem<br />
smtp_use_tls = yes</code></p></blockquote>
<p>You need to edit <code>/etc/postfix/</code>gmail_passwd and add the fowling information below, edit it to fit your needs.</p>
<blockquote><p>[smtp.gmail.com]:587    UserMame@gmail.com:PassWord</p></blockquote>
<p>Next you need to turn the gmai_passwd file into something that postfix can understand, you can use the command below to accomplish that.</p>
<blockquote><p><code>sudo chmod 400 /etc/postfix/sasl_passwd<br />
sudo postmap /etc/postfix/sasl_passwd</code></p></blockquote>
<p>Now you can restart postfix but it will complain about not being able to authenticate the certificate.  In order to fix the problem we will use the ca-certificate package we installed earlier to tell it where it can validate the certificate.</p>
<blockquote><p><code>cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem</code></p></blockquote>
<p>Now restart postfix for the final time.</p>
<blockquote><p>/etc/init.d/postfix</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix &#8211; Delete special charaters by inode</title>
		<link>http://www.hacktopia.net/wp/unix-delete-special-charaters-by-inode/</link>
		<comments>http://www.hacktopia.net/wp/unix-delete-special-charaters-by-inode/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 13:17:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=134</guid>
		<description><![CDATA[Here we see that we have a back slash created by mistake. user:/var/www/core# ls -l total 56 -rw-r&#8211;r&#8211; 1 root     root      213 2009-06-01 07:14 \ -rw-r&#8211;r&#8211; 1 user user 378 2009-05-21 09:14 ads.php We try to delete it but it is not possible because the back slash is a special charter. user:/var/www/core# rm \ &#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Here we see that we have a back slash created by mistake.</p>
<blockquote><p>user:/var/www/core# ls -l<br />
total 56<br />
-rw-r&#8211;r&#8211; 1 root     root      213 2009-06-01 07:14 \<br />
-rw-r&#8211;r&#8211; 1 user user 378 2009-05-21 09:14 ads.php</p></blockquote>
<p>We try to delete it but it is not possible because the back slash is a special charter.</p>
<blockquote><p>user:/var/www/core# rm \<br />
&gt;</p></blockquote>
<p>So we have to go and list out the inode numbers.  Those are the inode numbers in the first collum.</p>
<blockquote><p>user:/var/www/core# ls -li<br />
total 56<br />
458132 -rw-r&#8211;r&#8211; 1 root     root      213 2009-06-01 07:14 \<br />
457759 -rw-r&#8211;r&#8211; 1 user user 378 2009-05-21 09:14 ads.php</p></blockquote>
<p>So now we use find to delete the inode number which in turn deletes the file.</p>
<blockquote><p>user:/var/www/core# find . -inum 458132 -exec rm -i {} \;<br />
rm: remove regular file `./\\&#8217;? y<br />
user:/var/www/core# ls -l<br />
total 52<br />
-rw-r&#8211;r&#8211; 1 user user 378 2009-05-21 09:14 ads.php</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/unix-delete-special-charaters-by-inode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Through you cell Phone</title>
		<link>http://www.hacktopia.net/wp/internet-through-you-cell-phone/</link>
		<comments>http://www.hacktopia.net/wp/internet-through-you-cell-phone/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 03:51:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=12</guid>
		<description><![CDATA[When you go and ask the smiley commission paid sales agent what operating systems they support you are just setting your self for the line “no we only support Windows”. Let me start by explaining that all your phone is doing when it is connecting from your phone, what ever weird prosperity connector you have [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">
<p class="MsoNormal">When you go and ask the smiley commission paid sales agent what operating systems they support you are just setting your self for the line “no we only support Windows”.<span> </span>Let me start by explaining that all your phone is doing when it is connecting from your phone, what ever weird prosperity connector you have to your phone to the usb on your computer on.<span> </span>Even if you have to be one of the special few that has enough money to spend on a pcmcia EV-DO card.<span> </span>They use ppp through the USB interface standard.<span> </span>The reason that the companies who deployed these deices decided to use two of most widely known, understood and devolved on no matter what OS you are using, is because it was easy.<span> </span>It is as simple as that, the two standards where arlready out there and devoped so why not use them.<span> </span>That same reason the ppp and USB are used is the very reason that even though the silly sales person tells you that it is not supported does not mean that it will not work great.<span> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">Apple – I just wanted to start off with apple for the very fact that with OSX there is not additional software that needs to be installed.<span> </span>It is the easiest out of the operating systems out there to set you pone up to the internet.<span> </span>I wish I could include some screen shots but the only time I did use OSX for any sort of extended time was the company that I worked for let me take home one for their laptops.<span> </span>It was really a beautiful thing, it also easily integrated with the built in blue tooth where it could just leave my phone in my pocket while I rode on the train to and from work and the computer could dial the internet completely wirelessly.<span> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">Then there is Windows the only operating systems that is supported by Any of the cariers.<span> </span>One of the benefits that Verizon does offer when using Windows is that they offer a program the not only makes it very easy to connect to the Verizon Wireless ISP but they make it possible to download compressed data.<span> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">I have to admit that Verizon Wireles is the one that I am most fimilar with, I have done research into some of the competitors.<span> </span></p>
<p class="MsoNormal">Some of the other competitors to verizon are Sprint which also uses the cdma standard.<span> </span>But under the Sprint TOS (Term of Service) states they are not allowed to connect a computer to their phone.<span> </span>They are only suppose to use their phone to connect to the internet using the browser that is installed directly on their phone.<span> </span>Now you are saying tht a http request is a http request, and how is Sprint supose to tell the difference.<span> </span>Well the second that you start using any internet application Sprint knows that does not run on your phone such as IRC.  They would be within their rights to cut of your service, and or charge you for your internet usage.</p>
<p class="MsoNormal">
<p class="MsoNormal">Then there is Cingular / At &amp; T which is happy to let you your phone service to connect to the internet but just be ready to pay through the roof on per kb charges.<span> </span>Yes you heard that correctly Cingular charges per the kb unless you buy the unlimited plan which is in my opinion just too expensive.</p>
<p class="MsoNormal">
<p class="MsoNormal">Then there is the third cellular carier in the US Nextel which uses iDen.<span> </span>I am not fimilar with how well nextel works with their data plans.</p>
<p class="MsoNormal">
<p class="MsoNormal">You are already paying through the roof for you cell phone.<span> </span>Why not get the most of it that is possible.<span> </span></p>
<p class="MsoNormal">This is <span> </span>neat little trick that I have been using for a couple of year</p>
<p class="MsoNormal">
<p class="MsoNormal">Dial up codes</p>
<p class="MsoNormal">Verizon</p>
<p class="MsoNormal">Number to dial: #777</p>
<p class="MsoNormal">Username: phonenumber@vzw3g.com</p>
<p class="MsoNormal">Password: vzw</p>
<p class="MsoNormal">Sprint</p>
<p class="MsoNormal">Number to dial: #777</p>
<p class="MsoNormal">Username: username@sprint.com  (vision login)<br />
Password: Vision Password</p>
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/internet-through-you-cell-phone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set up PPTP VPN server on debian 4.0</title>
		<link>http://www.hacktopia.net/wp/set-up-pptp-vpn-server-on-debian-40/</link>
		<comments>http://www.hacktopia.net/wp/set-up-pptp-vpn-server-on-debian-40/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 03:33:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=67</guid>
		<description><![CDATA[While being the simplest of the VPN serveer to set up for linx it is also the least secure.  While it is the least secure it is still much better then using nothing.  A quick search for pptpd will give you PoPToP. PPTPD is good because is comes as part of the base install for [...]]]></description>
			<content:encoded><![CDATA[<p>While being the simplest of the VPN serveer to set up for linx it is also the least secure.  While it is the least secure it is still much better then using nothing.  A quick search for pptpd will give you PoPToP.</p>
<p>PPTPD is good because is comes as part of the base install for many common operation systems like Windows, OS X, and even the IPhone/Ipod.</p>
<p>In past versions of debian you had to to much more work to get pptp to encript your data like installing kernel modules.  Since kernel 2.6.15-rc1 everything is included by default so all you should do is install pptpd, but lets just run a quick check to make sure.  If you get a failure follow these instructions in order to get MPEE working<a href="http://pptpclient.sourceforge.net/howto-debian-build.phtml">Debian MPPE HOWTO</a>.</p>
<blockquote><p>server:/var/log# modprobe ppp-compress-18 &amp;&amp; echo success<br />
success</p></blockquote>
<blockquote><p>server:/# aptitude  search pptpd<br />
i   pptpd                                                              &#8211; PoPToP Point to Point Tunneling Server</p></blockquote>
<p>Start by installing it by simply isuing the fowling command.</p>
<blockquote><p>mini:/# aptitude  install pptpd</p></blockquote>
<p>The first file you will want to edit is /etc/<strong>pptpd.conf</strong>. You need to put in the ip range of the clients will be assigned and the virtural ip of the PPTP server.  Mare sure you pick a ip range that is not already used!  The remote IP range below will allow 49 hosts to connect.</p>
<blockquote><p>localip 10.80.0.1<br />
remoteip 10.80.0.2-50</p></blockquote>
<p>Next we want to set up the pptpd server options.</p>
<blockquote><p>username@server:~$ cat /etc/ppp/pptpd-options<br />
name hostname.TLD</p>
<p>refuse-pap<br />
refuse-chap<br />
refuse-mschap<br />
require-mschap-v2<br />
require-mppe-128</p>
<p>ms-dns 192.168.1.1</p>
<p>proxyarp<br />
nodefaultroute<br />
lock<br />
nobsdcomp<br />
noipx<br />
mtu 1490<br />
mru 1490<br />
#plugin radius.so</p></blockquote>
<p>I have the plugin radius.so commented out because that is only necessary for when you are using radius to authenicate the clients.  I will be going over how to set that up in a feture post.  In the mean time we will leave it commented out.</p>
<p>Next we have to set up the user accounts.  The user accounts are set up in a file called /etc/ppp/chap-secrets.  The format is pretty self explanatory but I will go over it any way,  the first filed is the user name that the client will enter into their pptp client, the second filed would be the ip of the PPTP server, just leave it as * for now, forth field is the password the client will have to enter, and the list and final field is the ip adress that the client will be coming from, since you most likely will have no idea where the client will be comign from just leave it as *.  Yes I know password is a really bad password, it is just a example.</p>
<blockquote><p><tt>server:/etc/ppp# cat chap-secrets<br />
# Secrets for authentication using CHAP<br />
# client    server    secret            IP addresses<br />
username     *     password </tt></p></blockquote>
<p>Now run</p>
<blockquote><p>mini:/etc/ppp# /etc/init.d/pptpd start<br />
Starting PPTP Daemon: pptpd.</p></blockquote>
<p>to start the server up.</p>
<p>You should see some entries in /var/log/syslog like the ones below indicating a secessful start.</p>
<blockquote><p>Jan  7 22:31:58 mini pptpd[13512]: MGR: Manager process started<br />
Jan  7 22:31:58 mini pptpd[13512]: MGR: Maximum of 49 connections available</p></blockquote>
<p>Dont forget to put in the proper firewall rules and system settings to foward any necessary traffic.  I will inclue a link to the directions in a fiture post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/set-up-pptp-vpn-server-on-debian-40/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>format usb drive using linux so windows can read it</title>
		<link>http://www.hacktopia.net/wp/format-usb-drive-using-linux-so-windows-can-read-it/</link>
		<comments>http://www.hacktopia.net/wp/format-usb-drive-using-linux-so-windows-can-read-it/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 04:28:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=58</guid>
		<description><![CDATA[So you just go a external USB drive and you want to use it on you Windows box.  Well Windows is just not that smart to read osx formatted partitions. Start by pluging it in, yaha.  Below is a snip it from dmesg that shows the usb drive being recognized when plunged in. cfdisk example [...]]]></description>
			<content:encoded><![CDATA[<p>So you just go a external USB drive and you want to use it on you Windows box.  Well Windows is just not that smart to read osx formatted partitions.</p>
<p>Start by pluging it in, yaha.  Below is a snip it from dmesg that shows the usb drive being recognized when plunged in.</p>
<p>cfdisk example output</p>
<blockquote><p>cfdisk 2.12r</p>
<p>Disk Drive: /dev/sdb<br />
Size: 120034123776 bytes, 120.0 GB<br />
Heads: 255   Sectors per Track: 63   Cylinders: 14593</p>
<p>Name              Flags            Part Type       FS Type                  [Label]               Size (MB)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
sdb1                                Primary        NTFS volume set                                120031.52</p>
<p>[Bootable]  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]  [  Quit  ]  [  Type  ]  [ Units  ]<br />
[ Write  ]</p></blockquote>
<p>Notice that the dmesg output says sdb so the device path will be /dev/sdb, and the first partition will be /dev/sdb1.</p>
<blockquote><p>sb 5-5: new high speed USB device using ehci_hcd and address 4<br />
usb 5-5: configuration #1 chosen from 1 choice<br />
Initializing USB Mass Storage driver&#8230;<br />
scsi2 : SCSI emulation for USB Mass Storage devices<br />
usbcore: registered new driver usb-storage<br />
USB Mass Storage support registered.<br />
usb-storage: device found at 4<br />
usb-storage: waiting for device to settle before scanning<br />
Vendor: Ext Hard  Model:  Disk             Rev:<br />
Type:   Direct-Access                      ANSI SCSI revision: 04<br />
SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)<br />
sdb: Write Protect is off<br />
sdb: Mode Sense: 10 00 00 00<br />
sdb: assuming drive cache: write through<br />
SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)<br />
sdb: Write Protect is off<br />
sdb: Mode Sense: 10 00 00 00<br />
sdb: assuming drive cache: write through<br />
sdb: [mac] sdb1 sdb2<br />
sd 2:0:0:0: Attached scsi disk sdb<br />
usb-storage: device scan complete<br />
SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)<br />
sdb: Write Protect is off<br />
sdb: Mode Sense: 10 00 00 00<br />
sdb: assuming drive cache: write through<br />
sdb: sdb1<br />
SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)<br />
sdb: Write Protect is off<br />
sdb: Mode Sense: 10 00 00 00<br />
sdb: assuming drive cache: write through<br />
sdb: sdb1</p></blockquote>
<p>First you have to delete the osx partition.  I suggest using cfdisk.  It is one of my favorite disk formatting command line gui programs.  fdisk /dev/device also works but is a little trickier to use.</p>
<p>The commands below show how to format the drive</p>
<blockquote><p>server:~# mkdosfs -n &#8220;external disk&#8221; /dev/sdb1<br />
mkdosfs 2.11 (12 Mar 2005)</p></blockquote>
<p>Now go and mount the newly created the file system.</p>
<blockquote><p>mount /dev/sdb1 /mnt/usb</p></blockquote>
<p>Now you can unmount it so that it is safe to remove the usb device.</p>
<blockquote><p>server:/mnt# umount /mnt/usb</p>
<p>server:/mnt# mount<br />
/dev/sda1 on / type ext3 (rw,errors=remount-ro)<br />
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)<br />
proc on /proc type proc (rw,noexec,nosuid,nodev)<br />
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)<br />
procbususb on /proc/bus/usb type usbfs (rw)<br />
udev on /dev type tmpfs (rw,mode=0755)<br />
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)<br />
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)<br />
mini:/mnt#</p></blockquote>
<p>Now you can disconnect the usb drive.</p>
<blockquote><p>usb 5-5: USB disconnect, address 4</p>
<p>server:~# mkdosfs -n &#8220;external disk&#8221; /dev/sdb1<br />
mkdosfs 2.11 (12 Mar 2005)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/format-usb-drive-using-linux-so-windows-can-read-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
