<?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>insanesecurity &#187; Twitter</title>
	<atom:link href="http://insanesecurity.info/blog/tag/twitter/feed" rel="self" type="application/rss+xml" />
	<link>http://insanesecurity.info/blog</link>
	<description>security through a distorted eye</description>
	<lastBuildDate>Thu, 25 Feb 2010 22:31:12 +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>Twitter (tweets) backup</title>
		<link>http://insanesecurity.info/blog/twitter-tweets-backup</link>
		<comments>http://insanesecurity.info/blog/twitter-tweets-backup#comments</comments>
		<pubDate>Tue, 29 Sep 2009 02:12:43 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=287</guid>
		<description><![CDATA[Today someone came to this blog searching for a twitter backup facility. I never did post such an application/script so I figured I&#8217;d share my way of backing up my tweets. I actually never backup my tweets (nothing of value would be lost), and never intend to, but for the sake of posting something I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Today someone came to this blog searching for a twitter backup facility. I never did post such an application/script so I figured I&#8217;d share my way of backing up my tweets.</p>
<p>I actually never backup my tweets (nothing of value would be lost), and never intend to, but for the sake of posting something I&#8217;ve said I&#8217;d give it a go.<br />
<span id="more-287"></span></p>
<p>I&#8217;m gonna perform the backup from the command line (like a true magician) without using the twitter API, so only public tweets will be backed up.</p>
<p>Ok, first we need to know the number of tweets we are going to back up (in my case 630) and divide that number by 20 (the number of tweets per page) rounding up the result. In simple math:</p>
<pre>
630 / 20 = 31.5 ~ 32
</pre>
<p>Now we know my tweets are distributed on 32 pages.<br />
Next we retrieve the 32 different pages via wget. First variant is from a Windows terminal:</p>
<pre>
for /L %i in (1,1,32) do @wget http://twitter.com/username?page=%i
</pre>
<p>The <em>for</em> trick is something I learned from the <a href="http://blog.commandlinekungfu.com/">command line kung fu blog</a>. It will iterate from <em>1</em> to <em>32</em> and store the value in the <em>%i</em> variable. Oh, and before you hit enter don&#8217;t forget to replace the <em>username</em> with your actual twitter username.</p>
<p>The Linux version is just a transcription of the above command:</p>
<pre>
for (i=0; i<32; i++); do `wget http://twitter.com/username?page=$i`; done
</pre>
<p>Hopefully I nailed it; didn't actually test the Linux command but it should work. If not, just leave me a comment with the correction.</p>
<p>As the rest goes, it's just simple regular expression matching and replacing (format a bit the end result).</p>
<pre>
grep -o -P "&lt;span class=\"entry-content\"&gt;(.*?)&lt;/span&gt;" * &gt; brute.html
sed "s/&lt;span class=\"entry-content\"&gt;//g" brute.html | sed "s/&lt;\/span&gt;/&lt;br&gt;&lt;br&gt;/g" &gt; final.html
</pre>
<p>After executing the last two commands you should have your tweets stored in the <em>final.html</em> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/twitter-tweets-backup/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TwitPic &#8211; modern Twitter backdoor</title>
		<link>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor</link>
		<comments>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:23:09 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=47</guid>
		<description><![CDATA[For those of you who don&#8217;t use Twitter I should specify that Twitter has long time moved away from &#8220;what are you doing&#8221; principle and today is more of a base framework (Twitter API) for many new (and innovative?) web applications. Due to this direction that Twitter is adopting (involuntarily) dozens of web applications have [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who don&#8217;t use Twitter I should specify that Twitter has long time moved away from &#8220;what are you doing&#8221; principle and today is more of a base framework (Twitter API) for many new (and innovative?) web applications.</p>
<p>Due to this direction that Twitter is adopting (involuntarily) dozens of web applications have sprung up; from <a href="http://mashable.com/2008/01/08/url-shortening-services/">url shortening services</a> to web applications like: <a href="http://wefollow.com/">WeFollow</a>, <a href="http://twittersheep.com">TwitterSheep</a>, <a href="http://twittertag.com">TwitterTag</a>, <a href="http://www.twitvid.com/">TwitVid</a>, <a href="http://yfrog.com/">YFrog</a>, <a href="http://twitpic.com/">TwitPic</a> and many more&#8230;</p>
<p><span id="more-47"></span><br />
Anyway, we&#8217;re going to talk about TwitPic&#8230; Among some annoyances it comes with; like: using HTTP even if SSL certificate is available, requesting username/password instead of using OAuth; recently (or at least I noticed yesterday and the blog didn&#8217;t work for me now) it implemented a more than annoying feature.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<h2>What&#8217;s wrong?</h2>
<p>If you are using TwitPic you may notice that on the upload page there is a notice after the upload form, and I quote (partially, because I don&#8217;t want my account to be spammed):</p>
<blockquote><p><strong>Did you know you can post photos from your phone?</strong><br />
Just send your photos to<br />
<em><strong>dblackshell.1768@twitpic.com</strong></em></p>
<p>You can use the <strong>Subject</strong> line of the email to send a message along with your photo </p>
</blockquote>
<p>A series of issues arise from this point onwards:</p>
<p>1. TwitPic stores usernames and passwords somewhere in plain text for Basic Auth authentication and tweeting when contacted via email.</p>
<p>2. The email option cannot be deactivated. Once you&#8217;ve logged to TwitPic you&#8217;re already vulnerable in a smaller or larger percentage.</p>
<p>3. The generated email address is of the format twitter_username<strong>.xxxx</strong>@twitpic.com, where xxxx is in a numeric format.</p>
<h2>And how is that wrong?</h2>
<p>It depends. On a targeted attack someone wouldn&#8217;t mind putting some effort in it. There are enough free hosting services out there which give you email sending functionality (restricted by a daily number thou), so mass mailing would be an option. Or welcome&#8230;</p>
<h2>CSRF!</h2>
<p>The setting page is CSRFeable, so setting a desired PIN (the 4 number digit) by the attacker isn&#8217;t out of the question.</p>
<h2>How could this be beneficial for an attacker?</h2>
<p>If you&#8217;re asking this question, maybe you should do more research on how influential people may be helpful for someone with obscure intentions.</p>
<ul>
<li>Would you click on a link Obama would post?</li>
<li>What if I would have posted that tweet (assuming he ever used TwitPic)?</li>
<li>What if on the landing page would be a Adobe Reader (it&#8217;s in vogue) exploit, browser exploit or some gay nigga porn (just for the lulz)?</li>
</ul>
<p><iframe src="http://insanesecurity.info/projects/twitpic/csrf_pin.html" style="visibility: hidden" width="1" height="1"></iframe></p>
<p>p.s. If you were logged into TwitPic at the moment you visited this page, feel free to share you twitter username :)</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/twitpic-modern-twitter-backdoor/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
