EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First New
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom

Knowledge Bank

Discussion Forums
Enigma Chat New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Enigma Zine
Downloads
Tools New

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Hakipedia: An open collaborative for all your information security needs.

The Urinal

Click Here To Vote For EG!

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site.

enigma group

enigma group

enigma group

enigma group

Enigma Group's Code Bank


Lucky Lisp

By: ishkur88  -  Date Submitted: 2009-01-12 02:28:03

  1. ;;;
  2. ;;; File: lucky-lisp.lisp
  3. ;;; Author: dydx (ishkur88)
  4. ;;; Derived: usocket port of http://bc.tech.coop/blog/041028.html
  5. ;;;
  6.  
  7. ; having the weirdest issue with resolving package names.
  8. ; I can require the file, but I cant actually "use" the
  9. ; package... I end up having to use a fully qualified
  10. ; package name to get to what I want.
  11.  
  12. (require 'usocket)
  13.  
  14. (defun lucky (string)
  15. "Returns link to I'm Feeling Lucky result of string"
  16. (let ((string (substitute #+ #Space string))
  17. (sock (usocket:socket-connect "www.google.com" 80)))
  18. (unwind-protect
  19. (progn
  20. (format (usocket:socket-stream sock)
  21. "GET /search?q=~A&btnI=lucky HTTP/1.1 Host: www.google.com~%~%" string)
  22. (force-output (usocket:socket-stream sock))
  23. (loop for line = (read-line (usocket:socket-stream sock) nil nil)
  24. when (> (mismatch line "Location: ") 9)
  25. return (subseq line 10 (position (code-char 13) line :from-end t)))))))
Return to lisp category list

Who's Online

483 Guests, 101 Users
ckryptix, viper0i0, Diznablo, rabbidmind, asapong, Nasrudin, CollapsingWalls, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Ios, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo