Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
Sockets Question
  • Xin
    Posts: 3,251
    # pyBackdoor - Python Backdoor Project
    # Server Version 0.0.1
    # http://www.iexploit.org
    # Xinapse
    import socket

    HOST = '' # Symbolic name meaning all available interfaces
    PORT = 50207 # Arbitrary non-privileged port
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.bind((HOST, PORT))
    s.listen(1)
    conn, addr = s.accept()
    print 'Connection from ', addr
    while 1:

    data = conn.recv(200)
    print data
    if data == ('hi'):
    print 'works'

    if not data: break
    conn.send(data)
    conn.close()


    At the moment im sending the data via netcat and when i send 'hi' it doesnt print works. I think this may be because every time i send data it leaves a gap in between eg

    hi

    hi

    etga

    hi

    So its actually assuming data is 'hi' and new line, how do i get this to understand that?
    Xin
  • Xin
    Posts: 3,251
    Dont worry fixed it, i need to put \n after it
    Xin