View Single Post
Old 07-01-2016, 09:23 PM  
deonbell
Confirmed User
 
deonbell's Avatar
 
Industry Role:
Join Date: Sep 2015
Posts: 1,045
Trying to make first python program, But get error.

I try to learn Python, but I get error.
No direct IP access, Cloudflare.
Here is my codes

Do I need Cloudflare IP or should I try different ways? Using Seleneum to open browser work better?

Code:
#read a list of usernames, check casino website to see if profile exists.

import socket
import sys
import time

targetsite = "www.pornhubcasino.com"
print targetsite

targetport =  80
print targetport


print "started"
print "........."
inputfile = open('usernamelist.txt', 'r')
for inputname in inputfile:
    time.sleep(3)
    response = " "
    inputname = inputname.strip('\n')
    print targetsite
    print targetport
    print inputname
   

    fuzzdata = "GET " + "/user/" + inputname
    print fuzzdata
    client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    client.settimeout(2)
    client.connect((targetsite,int(targetport)))
    client.send(fuzzdata + "\r\n\r\n")
    response = client.recv(4096)
    print response
    client.close
deonbell is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote