Step 1: Lightly score the flank steak in a crosshatch pattern, making cuts 1/4-inch apart. (There is no need to do this for skirt steak or flap meat.) Place the steaks in a glass or nonreactive baking dish or a resealable plastic bag.
Step 2: Make the marinade/salad dressing: Wash the cilantro and shake dry. Discard the stems. Place about 1/3 of the leaves in a food processor fitted with a chopping blade. Set the remaining leaves aside for the salad. Add the ginger, garlic, sugar, and pepper and run the processor in short bursts to finely chop. Add the fish sauce, lime juice, and soy sauce and process to mix (the sugar granules should be dissolved).
Step 3: Pour half the marinade over the meat, turning a couple of times to coat. Cover with plastic wrap and marinate in the refrigerator for 30 to 60 minutes. Set the remaining marinade aside to finish the salad.
Step 4: Assemble the salad: Line a platter with the lettuce leaves and arrange the cucumber slices, onion, cherry tomatoes, reserved cilantro leaves, mint, and Thai basil (if using) on top. The salad can be prepared up to 1 hour ahead to this stage, but if you do so, cover it with a damp paper towel.
Step 5: Just before serving, set up your grill for direct grilling and preheat to high. Brush and oil the grill grate. Drain the steak well and arrange on the grate. Grill the meat until cooked to taste, 4 to 6 minutes per side for medium-rare if using flank steak (2 to 3 minutes if using skirt steak), turning with tongs.
Step 6: Transfer the steak to a cutting board and let rest for 2 minutes. Very thinly slice the steak across the grain on the diagonal. Arrange the slices over the salad. Spoon the reserved dressing on top. Sprinkle the Thai beef salad with the peanuts, garnish with mint and basil leaves, if desired, and serve at once.