Announcement

Collapse
No announcement yet.

Downloading asp-files?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Downloading asp-files?

    I tried Dave's GetWeb-code on this address: http://www.lauritz.com/s_j/4.asp?ItemID=18836

    It didn't work. Is there a trick for asp-files?

    Regards
    Peter



    ------------------
    [email protected]
    www.dreammodel.dk

  • #2
    I don't know what "GetWeb" code you're referring to; I did a search
    on "GetWeb" across all forums and didn't find anything by Dave.

    However, if you're trying to download an asp file via http, it's
    not going to work. When you issue an HTTP GET request of a server
    that processes ASP files (IIS or one with Chilisoft ASP), the web
    server executes the code in the ASP and displays the results. This
    is different than what the typical web server does with regular
    html files (just return them whole to the requestor).

    There are some IIS exploits that will allow you to view the source
    code of an asp rather than just the results of the execution, but
    a normal HTTP GET won't do it.


    ------------------
    Troy King
    [email protected]
    Troy King
    katravax at yahoo dot com

    Comment


    • #3
      I don't see troubles with this page.
      But, of course, should be correct values in TCP OPEN.
      + it's necessary to use authorization with certain proxy servers.

      Code:
         #Compile Exe
         #Register None
         #Dim All
         #Include "WIN32API.INC"
      
         Function PbMain
            Dim Buffer As String, kBuffer As Long, i As Long, j As Long
           
            Tcp Open Port 80 At "www.lauritz.com" As #1 TimeOut 5000
            Tcp Print #1, "GET <A HREF="http://www.lauritz.com/s_j/4.asp?ItemID=18836"" TARGET=_blank>http://www.lauritz.com/s_j/4.asp?ItemID=18836"</A>  + " HTTP/1.0"
            Tcp Print #1, ""
            kBuffer = 2048: Buffer$ = Space$(kBuffer)
            Open "Tmp.Html" For Output As #2
            Do
               Tcp Recv #1, kBuffer, Buffer
               If Len(Buffer) = 0 Then Exit Do
               Print #2, Buffer;
               Locate 2, 1: Print "Read" + Str$(Lof(2)) + " bytes"
            Loop
            Close #2
            
            Open "Tmp.Html" For Binary As #2: Get$ #2, Lof(2), Buffer: Close #2
            i = Instr(Buffer, $CrLf + $CrLf)
            If UCase$(Left$(Buffer, 5)) = "HTTP/" And i Then Buffer = Mid$(Buffer, i + 4)
            Tcp Close #1
            Open "Tmp.Html" For Output As #2: Print #2, Buffer;: Close #2
            
         End Function
      ------------------
      E-MAIL: [email protected]

      Comment


      • #4
        Unless a server enables "Allow ASP Source to be viewed" you will ONLY get the resulting html.


        I wish it weren't true myself hehe, but it is.


        Scott

        ------------------
        Scott
        Scott Turchin
        MCSE, MCP+I
        http://www.tngbbs.com
        ----------------------
        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

        Comment

        Working...
        X