The objective was simple – see how susceptible the organization is from an external point of view and test the effectiveness of the security controls that are managed enterprise-wide. As such, asides, the company name, we were given “ZERO”information to perform an external black-box penetration Testing.
This black-box external penetration Testing Performing with a by a client called(Hackme)
OSINT 101
We kicked off with some Open Source Intelligence (OSINT) 101 :). There are quite a number of open source intelligence tools – to assist in gathering emails, subdomains, hosts, employee names, etc from different public sources like search engines and shodan. There is an exhaustive list of such awesome tools here .
Using quite a few open source intelligence tools, we obtained publicly available documents relating to the organization.
With Google dork to the rescue, we ran some basic search strings: “site:*.hackme.com ext:xls OR ext:docx OR ext:pptx” .
Of course, our aim was not to tirelessly search for documents. Rather, our objective was to understand the organization’s naming schema by examining the metadata of the documents which is found in the “properties section” of the document (most especially Microsoft Word, PowerPoint and Excel). One can also use FOCA for this.
From this, I noticed that employees emails followed a particular naming convention – the first letter of the firstname + surname @ domain.com i.e.rakinyele@hackme.com.
Armed with this knowledge, we forked out from LinkedIn the list of all current employees of Hackme using the following google dork syntax:
site:linkedin.com -inurl:dir “at Hackme” “Current”. A typical example is shown below using Google Inc as a reference company.
By hacking a script to automate the process, we copied out the firstnames, lastnames and the roles of the current employees of Hackme.
A tiring approach is to manually crawl through the google pages in search for these names and role or one could also use GoogleScraper:
Result :
Again, I leave the possibilities to your imagination – but you can easily convert this to a .csv file using https://json-csv.com/ or any other converter that works for you.
then using your favorite word processor (word merge, notepad++, etc) or some good scriptful skills, merge the firstname + lastname – to form your email list.
Feed our Target list a Payload
Since we are simulating a black-box external attack, we decided (just like what an attacker would do) to gain code execution using malicious payloads. As such, we thought of creating a payload and sending it via emails to employees of Hackme.
We also know that it is a common practice for some file type/extensions to be blocked by the organization’s email filters – to limit exposure to risk.
This then brings us to using Koadic C3 COM Command & Control, a very decent framework just like your Meterpreter or Empire.
What made it really stand out asides the beautiful interface is that it allows one to dump hashes, download/upload files, execute commands, bypass UAC, scan local network for open SMB, pivot to another machine, load mimikatz and a lot more.
So we ran Koadic and set the necessary variables – using the “stager/js/mshta “module (serves payloads in memory using MSHTA.exe HTML Applications).
The result was a spawn of our HTA payload URL as evidenced in the screenshot above. However, we need our targets to execute our payload as “mshta payload_url“.
In recent years, HTA payloads have been used as a web attack vector and also, to drop malware on a victim’s PC. Now we need to get this payload past our victim’s numerous defenses.
Here comes the tricky part – we needed a way to have the victim run “mshta payload_url” without our payload being spawned as a child process of mshta.exe – as we suspect this organization’s blue team may flag this.
Thankfully, we saw the tip on the left from Matt Nelson and interestingly, the team at NCC group have this implemented in Demiguise.
So here is our final payload saved as a .hta file.
The next step typically is to send our .hta payload as an embedded OLE object.
The intended attack scenario was:
- Send a Microsoft word document with our .hta payload embedded as an OLE object.
- Get the user to open the word document and the embedded OLE object.
- This spawns a new process and we get a shell access into our victim’s PC.
Now we get to the interesting part, we need our victim to open the Microsoft word document and our payload.
To do this, we need a very compelling story – just because users are getting smarter. So we headed back to doing more recon.
…and more recon
We need to know more about Hackme – specifically the culture and employees behavior. The question we kept asking ourselves was “what would interest the employees?”
Where else to get this information than Glassdoor , a platform that gives you inside scoop on companies with employee reviews about salaries, benefits, pros and cons of working with the company.
After poring through reviews of Hackme on Glassdoor, we found some common themes:
…and more recon
We need to know more about the target organization’s environment – specifically employees. The question we kept asking ourselves – what would interest the employees?
Where else to get this information than Glassdoor, a platform that gives you inside scoop on companies with employee reviews about salaries, benefits, pros and cons of working with the company.
After poring through reviews of the target organization on Glassdoor, we found some common themes:
- Some employees felt mobility was a challenge as the office is quite a long distance from residential locations.
- Employees love the organization because they get free lunch.
But Wait!
Like the old saying goes, the fastest way to a man’s heart is through his stomach. So what better way to get the employees to open our payload embedded word document?
Send them an email – telling them there is a change in the FREE LUNCH menu starting from tomorrow.
Rather than send a random phishing email to employees that could be spotted easily, we decided a seemingly genuine email would be ideal complete with Hackme email signature while observing the organization email culture.
Now, how do we make our email more believable? By sending an email to Customer service/Help Desk with a service request and observing the email signature in the response.
… recon again???
We headed back to Linkedin, to look for the name of either the HR Manager, Logistic Manager or Admin Manager (whichever is appropriate) of Hackme. We carefully crafted an email signature with the name we selected.
We are halfway through sending our payload now. Have some patience and read on…
It’s time to send our payload
From the metadata recon done earlier, we could tell what our target organization’s document headers and footers looked like.
I then created a new word document like the one shown below with a splitting image of Hackme document template with appropriate headers/footers.
Then we embedded our .hta as an OLE object. Microsoft Word Document >> Insert >> Object >> Package. We changed the icon to Microsoft Word’s icon and also the caption to reflect our message.
Change the icon to Microsoft Word’s icon and also, change the caption to reflect your message.
Don’t Forget the Anti-virus!!!
To check the AV detection rate of our payload – and to see if it will be flagged as malicious by Hackme antivirus solution (if any), we did a quick AV scan on nodistribute.com. Nodistribute.com was used because according to them, they don’t distribute payload samples to AV companies. We scanned both the maldoc and the .hta file as well.
AV Scan of our .hta payload (0 detections)
It’s Time to Send our Email
If the target org does not have SPF, DKIM and DMARC configured, one can easily spoof the HR Manager, Logistic Manager or Admin Manager’s email address.
In this case, I created a Gmail account (yes, Gmail works too) using the Logistic Manager’s first name and last name – and then spiced it up with his signature which was gotten earlier.
Let the shells in
Shortly after sending the email, within a period of about 3 minutes, we had at least 30 shell connections! W00t!!!
What next?
The rest they often say is history. From here-on, using the mimikatz modules, we escalated privileges, dumped hashes, scanned the local network of Hackme, pivoted into other PCs, browsed the target’s file systems and even became domain admins etc.
In conclusion
All in all, this was a very fun engagement. Whilst it may take an attacker a month/2months/a year of dedication to break into an organization – through a loophole at the infrastructure level. It can be fairly easy for one to gain access by exploiting the human factor.
The moral of the exercise is: Recon, recon and more recon – for a wise man once said.
Original Source & Credits:
Rotimi Akinyele – Rotimi is an experienced Cybersecurity, IT Governance, Risk, and Compliance (GRC) professional. He is an Assistant Manager, Cybersecurity at BDO UAE.
Disclaimer
All the Content of this Article Belongs to above Original Author. “www.computernetworksecuritis.blogspot.in” won’t take any credits.This article is only for an Educational purpose.Any actions and or activities related to the material contained within this Website is solely your responsibility. The misuse of the information in this website can result in criminal charges brought against the persons in question.
The “Author” and “www.computernetworksecuritis.blogspot.in” will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this website to break the law. Reproduce This Content Without Permission is Strictly Prohibited.
14 comments:
This is truly a well-informed post Thanks for sharing with us. If there is anybody who has any queries about Gmail then check it out.
It is a very useful blog thanks for sharing your opinion. If there is anybody who troubling in AVG Security issues then Click here on AVG Helpline Number UK
It is a very useful blog thanks for sharing your opinion. If there is anybody who troubling in AVG Security issues then Click here on AVG Contact Number UK
Very useful post and I think it is rather easy to see from the other comments as well that this post is well written and useful. I bookmarked this blog a while ago because of the useful content and I am never being disappointed. Keep up the good work..
software testing outsourcing services
QA Outsourcing Sevices
Performance testing Services
Automation testing services
Great post!Thank you such a great amount for sharing this pretty post,it was so acceptable to peruse and valuable to improve my insight as refreshed one,keep blogging.network security dubai
There are different methods to keep the web applications safe from being harmed. But before implementing the web application penetration testing services, here are some points which every web application penetration testing company in dubai considers
There are different methods to keep the web applications safe from being harmed. But before implementing the web application penetration testing services, here are some points which every web application penetration testing company in dubai considers
This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… Pentesting Services
Very informative and impressive post you have written, this is quite interesting and i have went through it completely, an upgraded information is shared, keep sharing such valuable information i really learned something new thanks for giving this information. We updated all the trending new information related to any topics.
To be more updated about all the news around you, you can check this website
royal enfield speedometer
Well explained…great work…thank you so much for sharing such a valuable information. Looking for the best cloud penetration testing services in Hyderabad Contact Cyanous software solutions now.
Best cloud penetration testing services in Hyderabad
Best software & web development company in Hyderabad
Thank you so much for your wonderful information…great work keep going…Looking for the best network penetration testing services in Hyderabad in your budget contact Cyanous software solutions now.
Best network penetration testing services in Hyderabad
Best software & web development company in Hyderabad
Good information Post has very interesting and helped Would you wish to earn money on the internet easily? Afterward, Satta game is the perfect option for everybody please visit my site , and see live resuls and game post
satta king
satta king
satta king
satta king
Devstringx Technologies is a provides a best independent software testing services in India and the United States. Our zonal head office is located in Noida and another branch is in Lewes, Delaware. We provide top-notch software testing services, including functional testing, performance testing, security testing, compatibility testing, usability testing, and regression testing in whole over the world. We have the largest number of satisfied clients. we understand the critical role that software testing plays in the success of any software project. Our team of highly skilled and experienced software testers is equipped with the latest tools and methodologies to deliver top-notch testing services. Our dedicated test engineer team works closely with clients to understand their specific requirements and develop tailored testing strategies to meet their needs. Contact us today to learn more about Devstringx Technologies and how we can help you achieve your software quality goals.
Performance testing services
Devstringx Technologies is a provides a best independent software testing services in India and the United States. Our zonal head office is located in Noida and another branch is in Lewes, Delaware. We provide top-notch software testing services, including functional testing, performance testing, security testing, compatibility testing, usability testing, and regression testing in whole over the world. We have the largest number of satisfied clients. we understand the critical role that software testing plays in the success of any software project. Our team of highly skilled and experienced software testers is equipped with the latest tools and methodologies to deliver top-notch testing services. Our dedicated test engineer team works closely with clients to understand their specific requirements and develop tailored testing strategies to meet their needs. Contact us today to learn more about Devstringx Technologies and how we can help you achieve your software quality goals.
Performance testing services
Post a Comment