Skip to content

Commit 57627b4

Browse files
committed
update
0 parents  commit 57627b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+6704
-0
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
This is a simple AWD Framework. You should rewrite the attack method in Payload class by yourself.
2+
In your payload, you should upload a shell to a specified host,and return the shell path and password. That's all
3+
4+
# TO DO
5+
1. ~~hot load when modified (finished)~~
6+
2. ~~zoo.php to replace the simple.php => templates/zoo.php.temp~~
7+
3. add unittest
8+
4. trash flow, how to get the path automatic or => modules/sitemap
9+
5. ~~add keyboard event like ctrl+c to stop the current command execution (finished)~~
10+
6. add wget or curl method to download shell from the ccserver, if "echo | base64 -d >> shell.php" method can not be used.
11+
7. ~~make this framework compatitable to the POCSuite modules(Give UP)~~
12+
8. make good use of all kinds of templates, not limited to zoo.php.temp(in modules/auxiliary/*)
13+
9. add colorful cmd output (finished)~
14+
10. add autocomplete integration (finished)~
15+
16+
17+
# Usage
18+
```shell
19+
pip install -r requirements.txt
20+
21+
python kittyrun.py
22+
```
23+
To maintain your shell, you should open a new window,and deep into modules/monitor and run `python zookeeper.py`
24+
25+
if you want to send flag to the awd platform,you should rewite the flag function which is in modules/flag/flag.py
26+
27+
This is framework is based on requests multitheads, which is blocked.
28+
Considering to refactor it,with aiohttp asyncio, welcome to send issue,requirements. sevenqsh@gmail.com

__init__.py

Whitespace-only changes.

configuration.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"shellLocations": [
3+
"/admin/echo_config.php",
4+
"/admin/echo_config1.php",
5+
"/admin/echo_config2.php",
6+
"/admin/echo_config3.php"
7+
],
8+
"webRoot": "/var/www/html",
9+
"flagCommand": "curl http://192.168.100.222/get-flag",
10+
"phpFunction": "system",
11+
"bindAddress": "192.168.3.1",
12+
"bindPort": 4444,
13+
"salt": "yangge^_^",
14+
"targets": [
15+
"192.168.129.70",
16+
"192.168.129.72",
17+
"192.168.129.74",
18+
"192.168.129.76",
19+
"192.168.129.78",
20+
"192.168.129.80",
21+
"192.168.129.82",
22+
"192.168.129.84",
23+
"192.168.129.86",
24+
"192.168.129.88",
25+
"192.168.129.90",
26+
"192.168.129.92",
27+
"192.168.129.94",
28+
"192.168.129.96",
29+
"192.168.129.98",
30+
"192.168.129.100",
31+
"192.168.129.102",
32+
"192.168.129.104",
33+
"192.168.129.106",
34+
"192.168.129.108",
35+
"192.168.129.110",
36+
"192.168.129.112",
37+
"192.168.129.114",
38+
"192.168.129.116",
39+
"192.168.129.118",
40+
"192.168.129.120",
41+
"192.168.129.122",
42+
"192.168.129.124",
43+
"192.168.129.126",
44+
"192.168.129.128",
45+
"192.168.129.130",
46+
"192.168.129.132",
47+
"192.168.129.134",
48+
"192.168.129.136"
49+
],
50+
"shellType": "php",
51+
"ccServer": {
52+
"port": 20000
53+
},
54+
"headers": {
55+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X Metar 1.0"
56+
},
57+
"timeout": 15,
58+
"poolSize": 32,
59+
"defaultHorse": "zoo.php"
60+
}

configuration.py

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import json
6+
import logging
7+
import requests
8+
import threadpool
9+
10+
# from modules.encrypt.rsatool import rsatool
11+
from modules.sitemap.mapper import loadmap
12+
13+
class Configuration(object):
14+
#path: the location of the config file
15+
def __init__(self, path='configuration.json'):
16+
self.load(path)
17+
18+
# save current configuration to json file as default
19+
def save(self):
20+
tmpConfig = {}
21+
for k in self._config:
22+
tmpConfig[k] = getattr(self,k)
23+
if os.access(self._path, os.W_OK):
24+
try:
25+
with open(self._path, 'w') as conf:
26+
conf.write(json.dumps(tmpConfig, indent=4))
27+
self._config = tmpConfig
28+
logging.debug('Configuration Saved')
29+
except:
30+
logging.error('Saving Configuration Failed')
31+
else:
32+
logging.error('Configuration File occupied')
33+
34+
def getConfig(self):
35+
return self._config
36+
37+
def addTarget(self, target):
38+
if not target in getattr(self,'targets'):
39+
getattr(self,'targets').append(target)
40+
41+
def removeTarget(self, target):
42+
while target in getattr(self,'targets'):
43+
getattr(self,'targets').remove(target)
44+
45+
def addShell(self, uri):
46+
while not uri in getattr(self,'shellLocations'):
47+
getattr(self,'shellLocations').append(uri)
48+
49+
def removeShell(self, uri):
50+
while uri in getattr(self,'shellLocations'):
51+
getattr(self,'shellLocations').remove(uri)
52+
53+
def load(self, path):
54+
self._path = os.path.join(os.path.split(os.path.realpath(__file__))[0],path)
55+
if os.access(self._path, os.R_OK):
56+
with open(self._path,'r') as conf:
57+
try:
58+
config = json.loads(conf.read())
59+
self._config = config
60+
for k,v in config.items():
61+
setattr(self,k,v)
62+
pool = threadpool.ThreadPool(getattr(self,'poolSize',16))
63+
setattr(self, 'pool', pool)
64+
setattr(self, 'sitemap', loadmap())
65+
logging.debug('Configuration file loaded')
66+
except:
67+
logging.error('Configuration file format error: ' + self._path)
68+
else:
69+
logging.error('Load configuration error: ' + self._path)
70+
71+
def reload(self):
72+
self.load(self._path)
73+
self.pool = threadpool.ThreadPool(getattr(self,'poolSize',16))
74+
self.sitemap = loadmap()
75+
76+
77+
78+
configuration = Configuration()
79+
80+
if __name__ == '__main__':
81+
print(configuration.sitemap)

0 commit comments

Comments
 (0)