Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- path = "payload-list"
- def isListExists(port):
- global path
- with open(path, "r") as f:
- files = f.readlines()
- for fi in files:
- if port in fi.strip():
- return True
- else:
- return False
- return False
- def appendList(port):
- global path
- if os.path.exists(path):
- if isListExists(port) == False:
- with open("payload-list", "a") as file:
- file.write("{}\n".format(port))
- else:
- createList()
- appendList(port)
- def createList():
- global path
- f = open(path, "w+")
- f.close()
- appendList("4445")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement