-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscriptscan.py
More file actions
43 lines (37 loc) · 1.11 KB
/
scriptscan.py
File metadata and controls
43 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests
from selenium import webdriver
import os
from selenium.webdriver.chrome.options import Options
def scriptscan(url):
try:
os.mkdir('report')
os.chdir('report')
except:
os.chdir('report')
try:
os.mkdir('Script Scan Results')
os.chdir('Script Scan Results')
except:
os.chdir('Script Scan Results')
f=open("file.txt","wb")
os.chdir('./../..')
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(executable_path=r"D:\Dhanbad\chromedriver.exe",chrome_options=chrome_options)
driver.get(url)
pageSource = driver.page_source
driver.quit()
urll="https://shellray.com/upload"
f.write(pageSource.encode())
f.close()
req=requests.post(urll,files={"file":'file.txt'})
os.chdir('report')
os.chdir('Script Scan Results')
os.remove('file.txt')
f=open("file.txt","w")
print(req.text)
f.write(req.text)
f.close()
os.chdir('./../..')