Jump to content

passive tcp proxy


 Share

Recommended Posts

i started to make a passive proxy in autoit but it is not fully functional and i am out of ideas i was wondering if any one could help thanks

$timer= 1
$timer1 = 1
TCPStartup()
Global $proxyin, $proxyout, $proxyin1


$proxyin1 = TCPListen("127.0.0.1", 89)

Do
    $proxyin = TCPAccept($proxyin1)
    Sleep(10)
Until $proxyin > 0
While 1

    Sleep(100)
    $inrecv = TCPRecv($proxyin, 10000)

    If $inrecv > "" Then
        ConsoleWrite($inrecv)

        Do
            $proxyout = TCPConnect(_site($inrecv), 80)
            Sleep(10)
        Until $proxyout <> -1
        ConsoleWrite(0)


        TCPSend($proxyout, $inrecv)
        $ourrecv = ""
        $timer1 = 0
        Do
            Sleep(500)
            $r = TCPRecv($proxyout, 10000)
            $ourrecv &= $r
            $timer1 = $timer1 + 1
        Until $r > " " or $timer1 = 10
        Do
            Sleep(100)
            $r = TCPRecv($proxyout, 10000)
            $ourrecv &= $r
        Until $r = ""


        ConsoleWrite($ourrecv)
        TCPSend($proxyin, $ourrecv)
        $inrecv = TCPRecv($proxyin, 10000)
        TCPCloseSocket($proxyin)
        Do
            $proxyin = TCPAccept($proxyin1)
            Sleep(10)
        Until $proxyin > 0


    EndIf
WEnd
Func _site($string)
    Local $site = StringSplit($string, @CRLF)
    If $site[2] < " " Then
        $site = StringSplit($site[3], ":", 1)
    Else

        $site = StringSplit($site[2], ":", 1)
    EndIf

    Return TCPNameToIP(StringStripWS($site[2], 8))
EndFunc   ;==>_site
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...