one ring to bind them, one line to find them

 code, hack, python, web  Comments Off on one ring to bind them, one line to find them
Dec 072012
one ring to bind them, one line to find them

I guess if you import enough libraries just about anything can be made into a one liner… if you have imported BeautifulSoup, re, requests, and sys, in python3 you can simply do: print(re.sub(r’^.*imgurl=([^&]+)&.*$’, r’\1′, str(BeautifulSoup(requests.get("http://images.google.com/search?num=50&hl=en&safe=off&site=&tbm=isch&source=hp&biw=1744&bih=1279&q=%s&oq=" % sys.argv[1]).text).find(href=re.compile("imgurl"))))) To find the first hit on a google image search with argv[1]. Google will probably change their URL images later today and it’ll stop working, but I wanted this for a random […]

mounting jffs2

 code, embedded, hack, tech  Comments Off on mounting jffs2
Nov 232012

After mounting a bunch of filesystems I thought I’d just whip up a little shell script to help me out when working with jffs2 images, mtd, and linux (only tested on centos 6.) I won’t go over how to get kernel support and all that crap – there are many guides, and while many won’t work eventually something will for you too ;( This one is fairly simple to […]


 code, hack, ipmi, python, security, tech  Comments Off on avctpasswd
Nov 112012

Since I didn’t find it anywhere else… Avocent, who makes a heck of a lot of BMCs, and at times (like with Dell’s iDRAC, at least version 6) keeps encrypted passwords in (well, quite possible/probable OEM dependent) “/flash/data0/etc/avctpasswd” (don’t be fooled by the /etc/passwd file) using SHA1 hashed passwords converted into Base64. I surmise this file is used to protect the real passwords that are stored in clear text […]

when you’ve really hosed yourself

 hack, tech  Comments Off on when you’ve really hosed yourself
Oct 312012

Or, perhaps, working with a really minimal system… saw two posts that were pretty handy – basically how to reconstruct binaries with the shell alone (no cheats like mv or an editor or anything…); reconstruction by force: http://fakeguido.blogspot.com/2010/08/rescuing-hosed-system-using-only-bash.html And: http://www.eusebeia.dyndns.org/bashcp Some nice little functions here building on the above: http://www.h-i-r.net/2009/08/cratered-your-linux-box-here-are-some.html

HP firmware disks

 hack, tech  Comments Off on HP firmware disks
Sep 302012
HP firmware disks

I’d been playing with them… and since I hadn’t seen this anywhere I’ll put it as a small hack o the day. The disks do what they say (e.g. … install firmware ;)) – basically you burn it to a cd, boot it up, and it has some sort of access to the system. Since I’ve been working with these sorts of things lately I was curious how they […]