Repository: langsasec/Sign-Sacker
Branch: main
Commit: 4926e029c7fc
Files: 5
Total size: 18.2 KB
Directory structure:
gitextract_psw5z5nh/
├── .gitignore
├── LICENSE
├── README.md
├── Sign-Sacker.py
└── requirements.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2023 langsasec
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Sign-Sacker (签名掠夺者) - 2.0
## 介绍
Sign-Sacker(签名掠夺者):一款数字签名复制器,可将其他官方exe中数字签名,图标,详细信息复制到没有签名的exe中,作为免杀,权限维持,伪装的一种小手段。
## 2024-1-4 项目停更
1. 微调了下代码,只允许了exe,dll文件
2. 项目停更,江湖再见
## 更新 2.0
分别导入含有签名和需要签名的文件,点击生成即可,玩免杀的可能会用到。
新增功能:
1. 掠夺高清图标,完美复刻。
2. 掠夺exe详细信息,以假乱真。

## 效果对比
### 图标对比:


### 数字签名对比:

### 详细信息对比
唯一的遗憾是语言暂未更改,文件版本号是由于飞书实际和显示有差别,大多数是一致的,因此我未做细微调整。

================================================
FILE: Sign-Sacker.py
================================================
import io
import struct
import subprocess
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QPushButton, QFileDialog, QVBoxLayout, \
QWidget, QMessageBox, QCheckBox
import sys
import os
import shutil
from PyQt5.QtWidgets import QDesktopWidget
class SignSacker(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Sign-Sacker(签名掠夺者) By 浪飒 (关注浪飒sec公众号)")
self.setWindowIcon(QIcon('favicon.ico')) # 设置窗口图标
self.resize(700, 400)
# 设置窗口居中显示
screen = QDesktopWidget().screenGeometry()
window_size = self.geometry()
x = int((screen.width() - window_size.width()) / 2)
y = int((screen.height() - window_size.height()) / 2)
self.move(x, y)
widget = QWidget(self)
layout = QVBoxLayout()
widget.setLayout(layout)
self.setCentralWidget(widget)
self.file1_label = QLabel("受害者:", self)
layout.addWidget(self.file1_label)
self.file1_entry = QLineEdit(self)
layout.addWidget(self.file1_entry)
self.choose_button1 = QPushButton("选择含有签名的文件", self)
layout.addWidget(self.choose_button1)
self.choose_button1.clicked.connect(self.choose_file1)
self.file2_label = QLabel("掠夺者:", self)
layout.addWidget(self.file2_label)
self.file2_entry = QLineEdit(self)
layout.addWidget(self.file2_entry)
self.choose_button2 = QPushButton("选择需要伪造签名的文件", self)
layout.addWidget(self.choose_button2)
self.choose_button2.clicked.connect(self.choose_file2)
self.output_label = QLabel("生成文件名:", self)
layout.addWidget(self.output_label)
self.output_entry = QLineEdit(self)
layout.addWidget(self.output_entry)
self.icon_checkbox = QCheckBox("掠夺受害者高清图标(默认保存在'文件名_ico'路径下)", self)
self.details_checkbox = QCheckBox("掠夺受害者所有详细信息(右键属性->详细信息。包括文件说明,文件版本等)", self)
layout.addWidget(self.icon_checkbox)
layout.addWidget(self.details_checkbox)
self.output_label= QLabel("------------------------------------------------------------------------------------", self)
layout.addWidget(self.output_label)
self.output_label = QLabel("温馨提示:", self)
layout.addWidget(self.output_label)
self.output_label= QLabel("1.掠夺后语言默认为英语(美国)。", self)
layout.addWidget(self.output_label)
self.output_label= QLabel("2.掠夺后图标若无变化请粘贴到新的文件夹刷新即可。", self)
layout.addWidget(self.output_label)
self.output_label= QLabel("3.建议对掠夺者进行备份再执行程序。", self)
layout.addWidget(self.output_label)
self.output_label= QLabel("------------------------------------------------------------------------------------", self)
layout.addWidget(self.output_label)
self.process_button = QPushButton("生成文件", self)
layout.addWidget(self.process_button)
self.process_button.clicked.connect(self.process_files)
self.setStyleSheet("""
QLabel {
font-size: 16px;
color: #333;
}
QLineEdit, QPushButton {
font-size: 14px;
height: 30px;
}
QPushButton {
background-color: #4CAF50;
border: none;
color: white;
padding: 6px 12px;
text-align: center;
text-decoration: none;
font-size: 14px;
margin: 4px;
border-radius: 4px;
}
QPushButton:hover {
background-color: #45a049;
}
""")
def choose_file1(self):
file_name, _ = QFileDialog.getOpenFileName(self, "选择文件1", "", "Executable Files (*.exe *.dll)")
if file_name:
self.file1_entry.setText(file_name)
def choose_file2(self):
file_name, _ = QFileDialog.getOpenFileName(self, "选择文件2", "", "Executable Files (*.exe *.dll)")
if file_name:
self.file2_entry.setText(file_name)
# 自动填充生成文件名的文本框
base_name = os.path.basename(file_name)
extension = os.path.splitext(base_name)[1]
if extension.lower() == ".dll":
output_file = os.path.splitext(base_name)[0] + "-Signed.dll"
else:
output_file = os.path.splitext(base_name)[0] + "-Signed.exe"
self.output_entry.setText(os.getcwd().replace('\\','/')+'/'+output_file)
def process_files(self):
file1_path = self.file1_entry.text()
file2_path = self.file2_entry.text()
output_file = self.output_entry.text()
# 验证文件的有效性
if not os.path.exists(file1_path) or not os.path.isfile(file1_path):
self.show_message_box("错误", "文件1无效!")
return
if not os.path.exists(file2_path) or not os.path.isfile(file2_path):
self.show_message_box("错误", "文件2无效!")
return
icon = self.icon_checkbox.isChecked()
version_info = self.details_checkbox.isChecked()
if version_info:
info_sacker(file1_path, file2_path)
if icon:
ico_sacker(file1_path,file2_path)
writeCert(copyCert(file1_path), file2_path, output_file)
message = f"签名已写入:{output_file}"
self.show_message_box("生成文件", message)
def show_message_box(self, title, message):
msg_box = QMessageBox()
msg_box.setWindowTitle(title)
msg_box.setText(message)
msg_box.exec_()
# 获取可执行文件的一些信息,包括PE头中的各个字段的数值。
def gather_file_info_win(binary):
"""
Borrowed from BDF...
I could just skip to certLOC... *shrug*
"""
flItms = {}
binary = open(binary, 'rb')
binary.seek(int('3C', 16))
flItms['buffer'] = 0
flItms['JMPtoCodeAddress'] = 0
flItms['dis_frm_pehdrs_sectble'] = 248
flItms['pe_header_location'] = struct.unpack('