Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正 windows 下執行無法建立目錄 #5

Closed
lschg opened this issue Dec 25, 2024 · 1 comment
Closed

修正 windows 下執行無法建立目錄 #5

lschg opened this issue Dec 25, 2024 · 1 comment

Comments

@lschg
Copy link

lschg commented Dec 25, 2024

發現在 windows 執行 crack.py 時,BE5000 會建立 /etc/config/dropbear? 目錄,造成程式執行失敗 ?
經修改程式碼後,在 windows 下原始的 ping1.template 可成功建立 /etc/config/dropbear
因只在 windows 下執行並不知其他作業系統狀況,提出敬請參考。
修改部分如下:
def create_payload():
with open("ping1.template", "r") as file:
template = file.read()
# Replace Windows line endings with Unix line endings
# template = template.replace('\r\n', '\n')
txt = template.replace("{{LOCAL_IP}}", LOCAL_IP).replace("{{PORT}}", str(PORT))
binary = txt.encode()
with open("ping1", "wb") as file:
# file.write(template.replace("{{LOCAL_IP}}", LOCAL_IP).replace("{{PORT}}", str(PORT)))
file.write(binary)
sshot-18

@z-jack
Copy link
Owner

z-jack commented Dec 25, 2024

感谢,因手头没有Windows设备,一直没办法测试。我会把你的解决方案作为Windows的执行代码

z-jack added a commit that referenced this issue Dec 25, 2024
@z-jack z-jack closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants