Jump to content

Flooding CPU Attack - Ikarus Offlineshop System


Ikarus_

Recommended Posts

  • Developer

Hi guys, 

There's a guy that is blackmailing all servers that are using my offlineshop.

Not just my clients, but also those who downloaded it from some idiot's leak.

I'm sharing the fix here as 60/70% of the servers currently open use my shop.

 

Fix:

Spoiler


//FILE : new_offlineshop_manager.cpp
//SEARCH FOR
	bool CShopManager::RecvShopCreateOfferClientPacket(LPCHARACTER ch, TOfferInfo& offer)
	{
		if(!ch)
			return false;

		//offlineshop-updated 03/08/19
		if(ch->GetPlayerID() == offer.dwOwnerID)
			return false;

//ADD UNDER
		// fix flooding offers
		if (!CheckOfferCooldown(ch->GetPlayerID()))
			return false;
      

      
      
//SEARCH FOR:  
    void CShopManager::ClearSearchTimeMap()
	{
		m_searchTimeMap.clear();

//ADD UNDER
		// fix flooding offers
		m_offerCooldownMap.clear();
      
      
      
      
      
      
//SEARCH FOR      
	void CShopManager::ClearSearchTimeMap()
	{
		m_searchTimeMap.clear();
	}

      
//ADD UNDER
	// fix flooding offers
	bool CShopManager::CheckOfferCooldown(DWORD dwPID) {
		DWORD now = get_dword_time();
		const DWORD cooldown_seconds = 15;

		itertype(m_offerCooldownMap) it = m_offerCooldownMap.find(dwPID);
		if (it == m_offerCooldownMap.end()) {
			m_offerCooldownMap[dwPID] = now + cooldown_seconds *1000;
			return true;
		}

		if (it->second > now)
			return false;

		it->second = now + cooldown_seconds * 1000;
		return true;
	}
     
      
      
      
      
      
//FILE : new_offlineshop_manager.h
//SEARCH FOR:
        //search time map (checking to avoid search abouse)
		void		ClearSearchTimeMap();
		bool		CheckSearchTime(DWORD dwPID);

//ADD UNDER:
		// fix flooding offers
		bool		CheckOfferCooldown(DWORD dwPID);
 
      
      
      
//SEARCH FOR:
        AUCTIONMAP		m_mapAuctions;
//ADD UNDER:
		// fix flooding offers
		SEARCHTIMEMAP	m_offerCooldownMap;
      
      

      
      
//SEARCH FOR
int OfflineshopPacketCreateNewShop(LPCHARACTER ch, const char* data, int iBufferLeft)
{
	offlineshop::TSubPacketCGShopCreate* pack = nullptr;
	if(!CanDecode(pack, iBufferLeft))
		return -1;

	int iExtra=0;
	data = Decode(pack, data, &iExtra, &iBufferLeft);

	offlineshop::TShopInfo& rShopInfo = pack->shop;

  
 
//ADD UNDER
	//fix flooding
	if (rShopInfo.dwCount > 500 || rShopInfo.dwCount == 0) {
		sys_err("tried to open a shop with 500+ items.");
		return -1;
	}
      
      
      
      
      
      
      
//FILE : ClientManagerOfflineshop.cpp
//SEARCH FOR:

bool CClientManager::RecvOfflineShopOfferAccepted(const char* data)
{
	offlineshop::TSubPacketGDOfferAccept* subpack;
	data = Decode(subpack, data);

	offlineshop::COfferCache::TOfferCacheInfo* pOffer=nullptr;
	m_offlineshopOfferCache.Get(subpack->dwOfferID,&pOffer);
  
//ADD UNDER:
    if(!pOffer)
    	return true;

 

 

 

Random User :
Why are u sharing it using metin2dev?

Answer:
I m bored to see this guy make money by blackmailing.

 

 

Random User part2:
Is it right to share this fix even with those who are not your customer?

 

 

Answer:
I honestly think that anyone who uses the shop without permission, taking it from sources different from me, is not worthy of help from me, however I can't even allow so many people to be fooled by this idiot boy.

 

 

Random User part3:
Do you know who is blackmailing the p.server founders?

 

Answer:
Yes, i know his discord account Mădălin#2332

I recommend to don't pay him at all. I would like to know other accounts of this guy, if anyone know some please report to me.

I also have the proofs about what i m talking.

 

 

 

BIG DISCLAIMER:
Test the code on a test-sever before to move it on a live-server.

Thanks to @VegaS™ for the tip about cooldown

Edited by Ikarus_
  • Love 15

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Forum Moderator

Typical for romanians, they're so hungry for money..

 

@MadalinAlaska - Banned

You should know that with those things what you did, you won't be happy in a long term.

Have careful with karma, you'll have a server online in one day, those guys will revenge themselves somehow.

  • Good 3
  • Love 1
Link to comment
Share on other sites

  • Developer
4 minutes ago, ALF said:

and he still saying that to me if i have more money to pay he will tell me more fixes 

I m available on discord for who want help 
IkarusDeveloper#3677

 

 

Edited by Ikarus_
  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

My server didn't working after this

 

https://metin2.download/picture/1A106O2iEG4yImOhpSKeIqvCFbh58WIv/.gif

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
34 minutes ago, CaNNab1S said:

My server didn't working after this

 

https://metin2.download/picture/1A106O2iEG4yImOhpSKeIqvCFbh58WIv/.gif

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

the problem is not the fix check ur sysser better because i used the fix and in 1st time it work

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1

" Don`t pretend things change if you always do the same thing"

"Don`t give up on a dream for how long it will take, time will pass the same"

Link to comment
Share on other sites

7 minutes ago, ALF said:

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

the problem is not the fix check ur sysser better because i used the fix and in 1st time it work

All the server it works after this fix.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

5 hours ago, CaNNab1S said:

My server didn't working after this

 

https://metin2.download/picture/1A106O2iEG4yImOhpSKeIqvCFbh58WIv/.gif

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

Then buy that offlineshop from Ikarus and don't cry.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Not Good 1
  • Lmao 1

PeriodWars

release kraken GIF

Link to comment
Share on other sites

@Helia01

Only This:

Quote

 

My server didn't working after this

 

https://metin2.download/picture/1A106O2iEG4yImOhpSKeIqvCFbh58WIv/.gif

https://metin2.download/picture/hYhNyBGcGGyg9b2wnsHjmu6Zxctu5FHp/.png

 

SYSERR: Jan 15 03:30:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Jan 15 03:30:37 :: Process: FDWATCH: peer null in event: ident 21

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Love 2
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.