shell bypass 403
曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.かつては雑草やヨモギと共に雨や露を分かち合っていたが、今では松やヒノキと共に霜や雪に耐えている。曾与蒿藜同雨露,Once sharing rain and dew with weeds and wormwood, now enduring frost and snow with pines and cypresses.终随松柏到冰霜.曾与蒿藜同雨露한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.,终随松柏到冰霜.譖セ荳手珍阯懷酔髮ィ髴イ�檎サ磯囂譚セ譟丞芦蜀ー髴�曾与蒿藜同雨露,鏇句笌钂胯棞鍚岄洦闇诧紝缁堥殢鏉炬煆鍒板啺闇�终随松柏到冰霜.曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.曾与蒿藜同雨露,终随松柏到冰霜.
import os
import tarfile
import zipfile
from pkginfo.distribution import Distribution
class SDist(Distribution):
def __init__(self, filename, metadata_version=None):
self.filename = filename
self.metadata_version = metadata_version
self.extractMetadata()
@classmethod
def _get_archive(cls, fqn):
if not os.path.exists(fqn):
raise ValueError('No such file: %s' % fqn)
if fqn.endswith('.zip'):
archive = zipfile.ZipFile(fqn)
names = archive.namelist()
def read_file(name):
return archive.read(name)
elif fqn.endswith('gz') or fqn.endswith('bz2'):
archive = tarfile.TarFile.open(fqn)
names = archive.getnames()
def read_file(name):
return archive.extractfile(name).read()
else:
raise ValueError('Not a known archive format: %s' % fqn)
return archive, names, read_file
def read(self):
fqn = os.path.abspath(
os.path.normpath(self.filename))
archive, names, read_file = self._get_archive(fqn)
try:
tuples = [x.split('/') for x in names if 'PKG-INFO' in x]
schwarz = sorted([(len(x), x) for x in tuples])
for path in [x[1] for x in schwarz]:
candidate = '/'.join(path)
data = read_file(candidate)
if b'Metadata-Version' in data:
return data
finally:
archive.close()
raise ValueError('No PKG-INFO in archive: %s' % fqn)
class UnpackedSDist(SDist):
def __init__(self, filename, metadata_version=None):
if os.path.isdir(filename):
pass
elif os.path.isfile(filename):
filename = os.path.dirname(filename)
else:
raise ValueError('No such file: %s' % filename)
super(UnpackedSDist, self).__init__(
filename, metadata_version=metadata_version)
def read(self):
try:
with open(os.path.join(self.filename, 'PKG-INFO')) as f:
return f.read()
except Exception as e:
raise ValueError('Could not load %s as an unpacked sdist: %s'
% (self.filename, e))