Gravitational lenses on arcseconds scales provide a tool to probe the mass distribution in the lensing galaxies at redshift z 0.5-1.0. Image positions can be fitted using simple smooth galaxy mass models, but observed fluxes are more difficult to match. We analyze the effects of substructures in galaxy halos to explain such anomalies in the cusp and fold lensing configurations. In the first case we use detailed numerical simulations combined with a Monte Carlo approach to compare predictions from the ACDM small scale mass function with observed flux ratios. We extended our analysis down to a mass of ≈ 105 M⊙ for the subhalos. In the second case we try to constrain, with semianalytical approach, the mass and the position of a substructure by considering its effects on the flux of the images: we add to a smooth lens model, which reproduces well the positions of the images but not the anomalous fluxes, one or two substructures (in the mass range ∼ 106 -108 M⊙) described as singular isothermal spheres. In a work in progress we take into account the effect of substructures along the line of the sight.