Skip to content

Instantly share code, notes, and snippets.

@flerpadoo
Created April 29, 2019 16:05
Show Gist options
  • Save flerpadoo/8ee767539930970cdd76cde6087f7c36 to your computer and use it in GitHub Desktop.
Save flerpadoo/8ee767539930970cdd76cde6087f7c36 to your computer and use it in GitHub Desktop.
Example of something other than nmap in WhatBlockRule.py
install = [
"apt update",
"apt install curl -y",
"curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add",
"echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list",
"apt-get -y update",
"apt-get -y install google-chrome-stable python-pip unzip",
"pip install selenium",
"wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip",
"unzip chromedriver_linux64.zip",
"mv chromedriver /usr/bin/chromedriver",
"chown root:root /usr/bin/chromedriver",
"chmod +x /usr/bin/chromedriver"
]
for cmd in install:
sess.execute(cmd)
sess.execute("curl https://gist.githubusercontent.com/blalbal29ur29et290ty2t/fileNAme.py -o fileName.py")
result = sess.execute("python fileName.py " + data)
f = open('tool-output-list.txt', 'a') # could also be string + data and 'w' for separate files each thread
f.write(result)
print(result)
f.close()
#########################################################
sess.closeSession()
doAPI.deleteDroplet(doAPI.newDroplet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment