Maria's front door has a house number – 48 – screwed in to the wood and its own letterbox, but it isn't possible for a postman to get here to deliver anything. The healthcare assistant's home is a shed in the back garden of a shabbily converted bedsit property, only accessible via the main building and through the filthy, rubbish-strewn yard.

Her thrifty landlord has recycled the front door from another property, but Maria likes it; she likes having her own entrance and her own privacy. On balance, she thinks the shed is a better place to live than the crowded HMO (house of multiple occupation) she was in before. It has electricity and a tiny kitchen which leads into a bathroom, but there's no hot water, so when she wants to wash she needs to boil two huge vats of water on the stove.

Maria sleeps on a mattress on the floor, the furniture is broken, and the flat is heated only by a feeble electric radiator. When Newham council's planning officials knocked on her door a few weeks ago, she was sitting dressed and wrapped in a duvet against the cold.

She pays £350 in rent a month to a Mr McGuinness, a landlord the officials recognise as someone who "tends to go for the lower end of the market". Given that her wages are not huge, it's at the limit of what Maria can afford.

The officials ask if the rent seems fair. She laughs and says she doesn't think so, particularly when you take into account the man with mental health problems who lives in the main house and who regularly defecates in the garden, which is already scattered with detritus left by former tenants – old kettles and beer cans.

"We don't know where her toilet effluent is going to," Christine Lyons, the council's planning enforcement team leader, says, peering anxiously to the side of the building.

Converted sheds have become an increasingly mainstream – if illegal – part of the London property market. It's a logical development, given the explosion of property prices throughout the capital, and the huge shortage of supply. As central London becomes more expensive, people are pushed further out and rental prices even in Newham, which is the second most deprived borough in England and Wales, are rising fast.

Landlords are subdividing family homes into smaller and smaller units, haphazardly extending plumbing and electricity connections from the main properties into the garden sheds and garages, which they have no problem in renting out.

Newham's mayor, Sir Robin Wales, is dismayed. "It's big money. You get a few breeze blocks, sling up some crappy old shed in your back garden, and now you're making hundreds and hundreds of pounds a week. It doesn't take long for you to make a lot of money out of it, provided you are prepared to trade in human misery.

"We found a walk-in freezer where people have been living, paying rent to live there," Wales says. "The record was one house with 38 people, of whom 16 were children."

About a quarter of the borough's landlords take cash rents. "They just take the money and they don't give a toss about the conditions the people are living in. It is poor people who are being exploited by rogue landlords trying to trade on people's misery."

Wales says a number of factors are combining to make people willing to rent the most unappealing places. More people are renting because they can't afford deposits for a mortgage; there is an acute shortage of social housing; new housing benefit caps mean families are being pushed from expensive boroughs to cheaper areas; changes in eligibility criteria mean tenants under 35 are obliged to share properties. The value of benefits are falling, so people have less money to spend. Some of the tenants are illegal immigrants, unable to complain without facing deportation.

"If we don't do something, we will become a vast overcrowded ghetto; we'll have even more families living in squalor and misery and it will be impossible to stop," the mayor adds, explaining his decision to set up a supersheds taskforce, pouring £17.5m into enforcement, increasing its team of planning officers from 18 to 55.

"They're costing us a fortune, but we have to do it."Staff are conducting a door-to-door survey of the entire borough, mapping sheds that appear to be occupied. The council has also commissioned an aerial survey of the borough, which will use thermal heat detection to see which unauthorised properties are being lived in. The mayor also hopes to introduce a landlord licensing scheme that will force higher standards on to the market.

On 30 April, the housing minister, Grant Shapps, announced that the government was creating a nationwide "beds in sheds" taskforce, to identify the thousands of sheds and outbuildings being illegally rented out, often to illegal migrants. He said it was "a scandal that these back-garden slums exist to exploit people, many of whom ... find themselves trapped into paying extortionate rents to live in these cramped conditions".

Christine Lyons and her planning enforcement colleague Ryan Ward criss-cross Newham, checking up on houses where they believe sheds have been built and rented out. They are also looking for houses that have been subdivided to a dangerous and illegal degree.

First they park outside a large Edwardian semi-detached family home, near Forest Gate. While they wait for someone to answer the door, they examine the old clothes and dirty sleeping bags abandoned in the front yard. The first man to emerge, a student from Bangladesh, still in his pyjamas, says the house is shared by four people, but it quickly becomes obvious there are probably four times that number living here.

Perfectly relaxed about showing the council the conditions in which the landlord keeps the house, he takes the officials into his medium-sized ground floor bedroom: mattresses are laid out on every bit of the floor not taken up by the double bed. There's enough bedding to suggest four or five people are living here, although the student says absolutely not, it's just arranged like that because friends came round yesterday and stayed over – but there's no way of verifying that.

Two men are still asleep on the double bed: one wakes up, laughing at the arrival of planning officials; the other stays asleep, gently snoring, for the duration of the inspection. The mattress on the bed looks dirty and above the bedroom door there is a large rectangle of sticky yellow tape covered with the corpses of some of the cockroaches who share the room.

The student, who says he's studying at the London School of Commerce, says he splits the £400 monthly rent for the room with a friend. He has been in the UK for three years, and is getting used to the price of renting in London. "It is a good price. There is electricity, there is internet." He works in his free time as a waiter to help pay the rent. "The rest of the money I take from my parents [in Bangladesh]."

As the planning officials stand talking to him, a few more tenants emerge from other rooms; no one is quite sure how many people are living here, but Ryan Ward calculates that there are probably 15 over the three storeys, sharing just two bathrooms. In the kitchen there are four enormous fridges in a row, but no kitchen table or space to eat.

The tenant in the front room is responsible for collecting the rent every month, but no one answers when Ward hammers at his door, and it's not clear if he's there.

A young mother is sitting with her three-month-old baby in a cluttered room at the back of the house; her husband is out at work. She doesn't speak much English, but manages to explain that she has been living here with her husband, who is here from Pakistan on a student visa, for the past month. From the number of beds in the room, it looks like they might be sharing it with a third adult.

Somewhere else in the house, there's another family with two children, a two-year-old and a five-year-old, but they are out and their room is locked, their pushchairs jamming up the hallway. Jeans are hanging to dry on the bannisters and there are piles of clothes in the communal corridors. A notice tells tenants not to touch a light switch because the wiring is faulty.

The shed, by contrast, seems to be locked and empty, although it's clear that it has been built to be rented out.

The planning officials look over the garden fence at other sheds built in the surrounding gardens, noting signs of human inhabitation — extractor fans and satellite dishes. These aren't wooden potting sheds but professionally built concrete structures, many of them with showers and cooking hobs. Over a shed door in a neighbouring garden, someone has fixed a sign with the words: "God bless our home."

Lyons is uneasy about health and safety and notes that the house isn't licensed as an HMO (a licence is required if there are more than six unrelated people living together). "That was a three-storey building with no fire alarm system. We are waiting for someone to die." She makes a note to ask a health visitor to check on the baby.

Lyons is still occasionally shocked by what she sees. "Sometimes you can't believe you are not in a third-world country," she says.

During two mornings of raids, it becomes clear her work is very time-consuming and frustrating. Tenants are frequently out (or pretend to be out) and landlords are usually hostile — telling implausible stories of sheds constructed as gyms and luxury outhouses, insisting that no one is living inside, despite the presence of wardrobes and mattresses, visible through the windows. If they are obstructive and refuse entry, Lyons is obliged to send an enforcement order and return at a later date.

Most of these rooms and sheds are rented out informally, through small ads stuck in the window of places such as the "Station Superstore". Handwritten cards advertise "shared accommodation for boys £175 a month"; "double bedroom available to share with a male person".

Later they visit a garage that they have been told has been illegally converted into a home. There's no answer, but when Lyons peers through a crack in the gate she can see that a window and a newly painted white front door have been knocked into the garage wall, and there's a satellite dish, a separate dustbin and daffodils in pots beside the entrance.

She is not impressed by the attempts to make the place look homely, pointing out that the building is about 4 metres by 2. 5 metres. "It's only single skinned," she says, banging on the roll-up metal door. "You can imagine how cold it gets."

Lyons sees her work as a campaign to use planning legislation to solve more critical problems: overcrowding and the unsustainable rise in the local population which is putting acute pressure on the NHS and schools. Besides, she worries about the hygiene and safety of the sheds."They're outside the planning system. How do they connect up to the water mains? Are they mixing clean and foul water? The gas and electricity connections are probably illegal.

"With the reduction in housing benefit we will see more of this – landlords dividing up properties so that they can get the maximum rent possible. There have always been houses converted into HMOs, but in the last four years it has almost got out of control."

Newham's mayor hopes the government will consider withdrawing the four-year rule (which means that if a building has existed for four years without attracting complaints, it becomes legal) for properties that are being rented out. "If we allow [this situation] to continue, we will end up with large areas of London filled with crap squalor, with jerry-built things at the back of houses," Wales says. "We don't think that's acceptable."

Lyons has developed a sharp eye for unlicensed HMOs. She looks at the quantity of rubbish piled up at the front of the building, peers through the glass of the front door searching for large numbers of shoes in the entrance hall, looks for bedroom doors secured with individual locks, food supplies being stored on window sills, and pinned-up notices detailing house rules or expressing annoyance about tenants who have flouted them. The illegally subdivided houses are visibly more neglected than neighbouring properties. "Nock on the Door Please" a felt-tipped note instructs visitors, adding (in springtime): "Merry Christmas."

A Lithuanian builder who is working on a nearby site in the Olympic village answers the door at a three-storey red brick terrace house, and is happy to show the planning officials through to the back yard, where a couple are living with their two-year-old in a compact red-brick shed. The family is out, but the child's plastic doll's house, tricyle and green frog-shaped potty are outside the door, waiting for her to return from nursery.

The builder says he shares a top floor room with a friend, splitting the £520 rent, and looks surprised that the council is inspecting the place. "This house is in good condition. It's very clean. You can get cheaper, but there will be a lot of bugs," he says.

Planning officials are less concerned about the large numbers of young men, often from eastern Europe, who share rooms and rents, saving money to take home. It is when there are families crowded into unhygienic conditions that they become more agitated.

There's the noise of a baby crying from the hallway, and Lyons asks if she can speak to the tenants living in the small ground-floor front room. Inside a young woman from Hyderabad is discreetly breast-feeding a new baby, only six-weeks old, underneath a shawl. She lives here with her husband and mother, the four of them sharing the small space, which is crammed with suitcases, shelves, rolled-up mattresses, cardboard boxes, food supplies, cooking utensils, baby carriers and jugs of water.

Although it's sunny outside, the curtains are drawn to stop passers-by from peering in; a celebratory banner on the wall says: "Congratulations! It's a baby boy." After a while her mother takes the baby and begins tending to him, getting him dressed and murmuring at him.

Jyoti, 30, who has an MBA and worked for an American bank before she left India, is good-humoured but politely incredulous at the conditions she has had to put up with since she joined her husband in London. She thinks there are nine people in the house, as well as the family in the back garden. "This many people, I did not expect. When this many people stay together, sharing, obviously there are problems," Jyoti says.

Most unpleasant is the amount of rubbish the household generates, which never fits into the dustbins, and the rats the litter has attracted. "The dustbin problem is there. The rat problem is there." Her husband pays £520 a month for the room. She has had to take on the bulk of the cleaning in the house because the other tenants (with the exception of a man from Sri Lanka upstairs) don't bother.

Jyoti feels most sorry for the neighbours in the shed, who tell her the conditions are very poor: it's damp and the drains seem to be seeping upwards, making an unpleasant smell. "There is a problem with the drains here too. They are not set up for the number of people living here," she says.

There are only two toilets, which she says, "is not at all enough". She is looking forward to returning to Hyderabad, where the living conditions will be much better.

Names have been changed