Exploiting http services with squeak

Markus Gaelli gaelli at emergent.de
Thu Apr 12 23:00:10 UTC 2001


> For example, for this Mabel chatbot, we can do a search for a form tag,
> and we find:
> 
> <form action="http://www.hamill.co.uk/cgi-bin/hamill/mabel1/mabel.cgi"
> method="POST">
> <input type="text" name="d" size="70" maxlength="300">
> <input type="hidden" name="s"
> value="6=,9(92+~;=0~+~5+~=0:~,/</*'=,9px{lfcV=,:8'=,9~2/(9~*w+~6)1=0+6=,9_x{lf
> cE9~2/(9~*,)9+~;=0~+~=0:~,/</*+9pppx{lfc|G6=*59Z/~%/)~<*,)9~6)1=0+/8*69_~]~,/+
> *p{LY[OHYL?NLYHUOIK?ZYRUHYLEx{lfcjidjkrlfdmirmgdhrfdmrgkdhrlfdnrjidmnrmldirx{l
> fcefgnkjhhgx{lfcli9/~=0:~T)250~=~0=19r~+'9~'/)2:~+~+19,~0=19~<%~=0%~/*p|~K6=39
> 922~=+.9*522~+9r~L/19=,9">
> </form>
> 
> This tells us that there are two fields:
> 
> d (of type text): contains the input for the bot.  It's the field into
> which y ou are typing the inquiry when you're looking at the page in a
> browser.
> 
> s (of type hidden): the big crazy hidden string is most likely a session
> ID for keeping track of the conversation.
> 
> Looking at HTML source is usually enough, but I'm sure there are times
> when it wouldn't be.
> 
> Aaron
> 
Many thanks for your help, though I haven't still connected to that
chatterbot. I have tried now to send my strings to mabel as follows:

    anUrlString:= 'http://www.hamill.co.uk/cgi-bin/hamill/mabel1/mabel.cgi'.
    anUrl:= anUrlString asUrl.
    anHtmlString:= anUrl retrieveContents content.
    anHtmlDocument := HtmlParser parse: (ReadStream on: anHtmlString).
    anHtmlDocument allSubentitiesDo: [:each |
        (each isKindOf: HtmlForm) ifTrue: [aSessionId:= (each formEntities
at: 2) value]].
    inputs _ Dictionary new.
    inputs 
        at: 'd' put: #('Am I stupid?');
        at: 's' put: (Array with: aSessionId ).
    scamperWindow _ Scamper newOrExistingOn: anUrl.
    scamperWindow model submitFormWithInputs: inputs
        url: anUrl
        method: 'post'.
    scamperWindow activate

But no success.

My problem is also that I would like to inspect cgi-sites in action.
But the form in mabel (and google also for example) doesn't react to
"enter".
As this is the only way I can send my form to mabel in scamper, untill now I
can't inspect mabel in action.

So any ideas what I might do wrong or how to extent scamper-forms with enter
capability?

Or is anyone willing to port the alice chatterbot to squeak ? I currently
only have some aiml-file parsed in. So still a long way, which might be fun.

Markus





More information about the Squeak-dev mailing list